sql: add mechanism to emulate ROWID
It is worth mentioning, that there are two types of ephemeral tables: one holds rows as they are inserted (all rows turn out to be distinct); another adds ROWID column in order to hold equal rows. Inasmuch as original ROWID mechanism is to be removed, the purpose of this patch is to emulate ROWID behavior for ephemeral tables. - Substituted all ephemeral table opcodes which don't rely on SQLite's ROWID with Tarantool ones. - Implemeted opcode OP_NextIdEphemeral to emulate behavior of ROWID feature. In current implemetation ROWID is not hidden PK index, but just another one column to keep in table equal tuples. - Substituted old ephemeral tables with ROWID for INSERT INTO ... SELECT ... FROM statement. It utilizes ephemeral tables as intermediate holder for data from SELECT (before it is inserted to table). Part of #2680
Showing
- src/box/sql.c 60 additions, 0 deletionssrc/box/sql.c
- src/box/sql/btree.c 4 additions, 0 deletionssrc/box/sql/btree.c
- src/box/sql/insert.c 15 additions, 9 deletionssrc/box/sql/insert.c
- src/box/sql/opcodes.c 46 additions, 45 deletionssrc/box/sql/opcodes.c
- src/box/sql/opcodes.h 53 additions, 51 deletionssrc/box/sql/opcodes.h
- src/box/sql/select.c 4 additions, 4 deletionssrc/box/sql/select.c
- src/box/sql/tarantoolInt.h 3 additions, 0 deletionssrc/box/sql/tarantoolInt.h
- src/box/sql/vdbe.c 25 additions, 0 deletionssrc/box/sql/vdbe.c
- test/sql-tap/insert1.test.lua 1 addition, 1 deletiontest/sql-tap/insert1.test.lua
Loading
Please register or sign in to comment