sql: update ptr to VDBE after its creation in sql_txn
VDBE object is used in struct sql_txn to add new autoincrement ids in sequence_next(). List of these ids is returned later as a query execution result. sql_txn is created once SQL statement is executed inside transaction and exists till commit or rollback. After its creation it contains pointer to current VDBE. Each VDBE is freed after statement is executed. Hence, after first SQL statement within transaction is executed, sql_txn will point to freed memory (dangling pointer). This leads to crash in the next processed statement. Fix to this bug is simple: we must re-assign pointer to VDBE in sql_txn before VDBE execution. Closes #4157
Please register or sign in to comment