sql: enable alter rename table
Added new opcode OP_RenameTable, which implements SQL statment: ALTER TABLE old_name RENAME TO new_name; The main idea is to replace corresponding tuple in _space. New tuple will contain new name and new SQL statement, which creates this table. If it is parent table for foreign key, update SQL statement of child table. Then, remove old name from hash table and by calling callback function from VDBE, update database schema with new table name. After all, in the same way update triggers' statements in _trigger table, if any exist. Closes #2204
Showing
- src/box/sql.c 382 additions, 2 deletionssrc/box/sql.c
- src/box/sql/alter.c 3 additions, 307 deletionssrc/box/sql/alter.c
- src/box/sql/build.c 1 addition, 1 deletionsrc/box/sql/build.c
- src/box/sql/func.c 0 additions, 3 deletionssrc/box/sql/func.c
- src/box/sql/opcodes.c 22 additions, 21 deletionssrc/box/sql/opcodes.c
- src/box/sql/opcodes.h 25 additions, 24 deletionssrc/box/sql/opcodes.h
- src/box/sql/sqliteInt.h 0 additions, 1 deletionsrc/box/sql/sqliteInt.h
- src/box/sql/tarantoolInt.h 15 additions, 0 deletionssrc/box/sql/tarantoolInt.h
- src/box/sql/vdbe.c 98 additions, 0 deletionssrc/box/sql/vdbe.c
- src/box/sql/vdbe.h 1 addition, 0 deletionssrc/box/sql/vdbe.h
- src/box/sql/vdbeaux.c 7 additions, 0 deletionssrc/box/sql/vdbeaux.c
- test/sql-tap/alter.test.lua 517 additions, 0 deletionstest/sql-tap/alter.test.lua
- test/sql-tap/index1.test.lua 15 additions, 24 deletionstest/sql-tap/index1.test.lua
Loading
Please register or sign in to comment