sql: make spaces without PK illegal in queries
Our SQL codebase was inherited from SQLite, where each table must have at least one index - primary (if no explicit PK declared, one based on rowid is implicitly created). In Tarantool spaces can exists without indexes. The only existing restriction is that they can't contain any data. Hence, even very basic queries fail with assertion/seagfault if they are applied to spaces with no indexes. Situation when space turns out to remain without PK is quite common due to the absence of transactional DDL: for instance, space drop procedure consists of several steps including dropping all indexes; space itself is dropped at the very end. Thus, if a sequence of queries is interrupted by drop space procedure and one is not finished, the rest of queries will operate on space with no indexes. As a solution to this problem (at least temporary) now we disallow query processing involving spaces without PK except for views. Closes #3780
Showing
- src/box/sql/delete.c 6 additions, 0 deletionssrc/box/sql/delete.c
- test/sql/errinj.result 48 additions, 0 deletionstest/sql/errinj.result
- test/sql/errinj.test.lua 22 additions, 0 deletionstest/sql/errinj.test.lua
- test/sql/no-pk-space.result 61 additions, 0 deletionstest/sql/no-pk-space.result
- test/sql/no-pk-space.test.lua 24 additions, 0 deletionstest/sql/no-pk-space.test.lua
Loading
Please register or sign in to comment