[tarantool-patches] Re: [PATCH 5/6] sql: fix error message for improperly created index
n.pettik
korablev at tarantool.org
Wed Jan 16 23:06:43 MSK 2019
> On 14 Jan 2019, at 17:06, Vladislav Shpilevoy <v.shpilevoy at tarantool.org> wrote:
>
> Thanks for the patch! See 1 comment below.
>
> On 09/01/2019 15:13, Nikita Pettik wrote:
>> Table can be created without any indexes (for instance, from Lua-land).
>> On the other hand, bytecode generated for CREATE INDEX statement
>> attempts at finding entry in _index space with given space id.
>> In case it is not found error "wrong space id" is raised. On the other
>> hand, it is obvious that such message is appeared when table doesn't
>> have any created indexes yet. Hence, lets fix this message to indicate
>> that primary key should be created before any secondary indexes.
>> Closes #3914
>
> The test index1.test.lua fails. I guess, because you introduce
> ADD CONSTRAINT PRIMARY KEY only in the next commit. Lets move this
> part of the test into the latter.
I guess I accidentally put it in this patch.
Moved to the next one.
diff --git a/test/sql-tap/index1.test.lua b/test/sql-tap/index1.test.lua
index ccb6753c9..121381747 100755
--- a/test/sql-tap/index1.test.lua
+++ b/test/sql-tap/index1.test.lua
@@ -1,6 +1,6 @@
#!/usr/bin/env tarantool
test = require("sqltester")
-test:plan(73)
+test:plan(72)
--!./tcltestrunner.lua
-- 2001 September 15
@@ -1034,13 +1034,4 @@ test:do_catchsql_test(
1, "can not add a secondary key before primary"
})
-test:do_catchsql_test(
- "alter-8.2",
- [[
- ALTER TABLE t ADD CONSTRAINT pk PRIMARY KEY("id");
- CREATE UNIQUE INDEX i ON t("id");
- ]], {
- 0
-})
-
More information about the Tarantool-patches
mailing list