sql: introduce OpenSpace opcode
Prior to this patch, some opcodes could use a pointer to struct space that was set during parsing. However, the pointer to struct space is not really something that defines spaces. A space can be identified by its ID or name. In most cases, specifying space by pointer works fine, but truncate() changes the pointer to space, resulting in a sigfault for prepared statements using the above opcodes. To avoid this problem, a new opcode has been introduced. This opcode uses the space ID to determine the pointer to the struct space at runtime and stores it in the MEM, which is later used in the mentioned opcodes. Closes #7358 NO_DOC=bugfix
Showing
- changelogs/unreleased/gh-7358-prepared-stmt-truncation.md 3 additions, 0 deletionschangelogs/unreleased/gh-7358-prepared-stmt-truncation.md
- src/box/sql/alter.c 4 additions, 2 deletionssrc/box/sql/alter.c
- src/box/sql/build.c 10 additions, 7 deletionssrc/box/sql/build.c
- src/box/sql/delete.c 3 additions, 2 deletionssrc/box/sql/delete.c
- src/box/sql/insert.c 18 additions, 20 deletionssrc/box/sql/insert.c
- src/box/sql/sqlInt.h 7 additions, 8 deletionssrc/box/sql/sqlInt.h
- src/box/sql/trigger.c 3 additions, 6 deletionssrc/box/sql/trigger.c
- src/box/sql/update.c 6 additions, 5 deletionssrc/box/sql/update.c
- src/box/sql/vdbe.c 29 additions, 26 deletionssrc/box/sql/vdbe.c
- src/box/sql/vdbe.h 0 additions, 3 deletionssrc/box/sql/vdbe.h
- src/box/sql/vdbeaux.c 0 additions, 4 deletionssrc/box/sql/vdbeaux.c
- test/sql-luatest/gh_7358_prepared_stmt_truncation_test.lua 37 additions, 0 deletionstest/sql-luatest/gh_7358_prepared_stmt_truncation_test.lua
Loading
Please register or sign in to comment