sql: fail of DROP TABLE doesn't lead to truncate
Deletion of rows from table (which is part of DROP TABLE procedure) is wrapped in transaction now. If any Foreign Key violations occur, then rollback transaction and halt execution of statement. Otherwise, commit changes and continue DROP TABLE routine. This logic is implemented by OP_FkCheckCommit opcode. Added tests for this case. Closes #2953
Showing
- src/box/sql/build.c 11 additions, 2 deletionssrc/box/sql/build.c
- src/box/sql/fkey.c 11 additions, 18 deletionssrc/box/sql/fkey.c
- src/box/sql/opcodes.c 62 additions, 61 deletionssrc/box/sql/opcodes.c
- src/box/sql/opcodes.h 71 additions, 69 deletionssrc/box/sql/opcodes.h
- src/box/sql/vdbe.c 30 additions, 0 deletionssrc/box/sql/vdbe.c
- test/sql-tap/fkey3.test.lua 23 additions, 14 deletionstest/sql-tap/fkey3.test.lua
- test/sql-tap/gh-2953-drop-table-with-FK.test.lua 122 additions, 0 deletionstest/sql-tap/gh-2953-drop-table-with-FK.test.lua
Loading
Please register or sign in to comment