txn: fix rollback in case DDL and DML are used in the same transaction
A txn_stmt keeps a reference to the space it modifies. Memtx uses this space reference to revert the statement on error or voluntary rollback so the space must stay valid throughout the whole transaction. The problem is a DML statement may be followed by a DDL statement that modifies the target space in the same transaction. If we try to roll it back before running the rollback triggers installed by the DDL statement, it will access an invalid space object (e.g. missing an index), which will result in a crash. To fix this problem, let's run triggers installed by a statement right after rolling back the statement. Closes #4368
Showing
- src/box/memtx_engine.c 1 addition, 10 deletionssrc/box/memtx_engine.c
- src/box/txn.c 27 additions, 30 deletionssrc/box/txn.c
- src/box/vy_tx.c 2 additions, 1 deletionsrc/box/vy_tx.c
- test/box/transaction.result 27 additions, 0 deletionstest/box/transaction.result
- test/box/transaction.test.lua 20 additions, 0 deletionstest/box/transaction.test.lua
Loading
Please register or sign in to comment