memtx: vocally abort a transaction in case of implicit yield
Before this patch, memtx would silently roll back a multi-statement transaction on yield, switching the session to autocommit mode. It would do nothing in case yield happened in a sub-statement in auto-commit mode. This could lead to nasty/painful to debug side-effects in malformed Lua programs. Fix by adding a special transaction state - aborted, and enter this state in case of implicit yield. Check for what happens when a sub-statement yields. Check that yield trigger is removed by a rollback. Fixes gh-2631 Fixes gh-2528
Showing
- src/box/errcode.h 1 addition, 0 deletionssrc/box/errcode.h
- src/box/memtx_engine.c 71 additions, 18 deletionssrc/box/memtx_engine.c
- src/box/txn.c 17 additions, 0 deletionssrc/box/txn.c
- src/box/txn.h 31 additions, 3 deletionssrc/box/txn.h
- src/box/vinyl.c 0 additions, 8 deletionssrc/box/vinyl.c
- test/app/fiber.result 127 additions, 3 deletionstest/app/fiber.result
- test/app/fiber.test.lua 61 additions, 2 deletionstest/app/fiber.test.lua
- test/box/ddl.result 6 additions, 1 deletiontest/box/ddl.result
- test/box/ddl.test.lua 4 additions, 3 deletionstest/box/ddl.test.lua
- test/box/misc.result 2 additions, 1 deletiontest/box/misc.result
- test/box/transaction.result 1 addition, 0 deletionstest/box/transaction.result
- test/engine/iterator.result 7 additions, 5 deletionstest/engine/iterator.result
- test/engine/iterator.test.lua 4 additions, 2 deletionstest/engine/iterator.test.lua
Loading
Please register or sign in to comment