Skip to content
Snippets Groups Projects
Commit 4e72874a authored by Vladimir Davydov's avatar Vladimir Davydov
Browse files

txn: fix txn::sub_stmt_begin array size

We may write to txn->sub_stmt_begin[TXN_SUB_STMT_MAX] so the array size
must be TXN_SUB_STMT_MAX+1 (see txn_begin_stmt). This didn't lead to any
problems, because we would only overwrite txn::signature, which wouldn't
break anything. However, should we change the txn struct, we could get
an unexpected error or even a crash.
parent be5163bf
No related branches found
No related tags found
No related merge requests found
......@@ -180,7 +180,7 @@ struct txn {
* First statement at each statement-level.
* Needed to rollback sub statements.
*/
struct stailq_entry *sub_stmt_begin[TXN_SUB_STMT_MAX];
struct stailq_entry *sub_stmt_begin[TXN_SUB_STMT_MAX + 1];
/** LSN of this transaction when written to WAL. */
int64_t signature;
/** Engine involved in multi-statement transaction. */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment