Tarantool development patches archive
 help / color / mirror / Atom feed
From: "n.pettik" <korablev@tarantool.org>
To: tarantool-patches@freelists.org
Cc: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>
Subject: [tarantool-patches] Re: [PATCH 5/6] sql: fix error message for improperly created index
Date: Wed, 16 Jan 2019 23:06:43 +0300	[thread overview]
Message-ID: <CAE374F1-AF6B-407F-8BB7-674E31AC94E4@tarantool.org> (raw)
In-Reply-To: <c23039e4-38f8-39de-3ea3-94e6d83738a8@tarantool.org>



> On 14 Jan 2019, at 17:06, Vladislav Shpilevoy <v.shpilevoy@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
-})
-

  reply	other threads:[~2019-01-16 20:06 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-09 12:13 [tarantool-patches] [PATCH 0/6] Introduce ALTER TABLE ADD CONSTRAINT UNIQUE/PK Nikita Pettik
2019-01-09 12:13 ` [tarantool-patches] [PATCH 1/6] sql: move constraint name to struct contraint_parse Nikita Pettik
2019-01-14 14:04   ` [tarantool-patches] " Vladislav Shpilevoy
2019-01-16 20:06     ` n.pettik
2019-01-16 20:54       ` Vladislav Shpilevoy
2019-01-17 10:56       ` Konstantin Osipov
2019-01-17 17:14         ` n.pettik
2019-01-09 12:13 ` [tarantool-patches] [PATCH 2/6] sql: rework ALTER TABLE grammar Nikita Pettik
2019-01-14 14:05   ` [tarantool-patches] " Vladislav Shpilevoy
2019-01-16 20:06     ` n.pettik
2019-01-16 20:54       ` Vladislav Shpilevoy
2019-01-17 11:51   ` Konstantin Osipov
2019-01-17 17:14     ` n.pettik
2019-01-18  1:42       ` Konstantin Osipov
2019-01-09 12:13 ` [tarantool-patches] [PATCH 3/6] sql: remove start token from sql_create_index args Nikita Pettik
2019-01-09 12:13 ` [tarantool-patches] [PATCH 4/6] sql: refactor getNewIid() function Nikita Pettik
2019-01-14 14:05   ` [tarantool-patches] " Vladislav Shpilevoy
2019-01-09 12:13 ` [tarantool-patches] [PATCH 5/6] sql: fix error message for improperly created index Nikita Pettik
2019-01-14 14:06   ` [tarantool-patches] " Vladislav Shpilevoy
2019-01-16 20:06     ` n.pettik [this message]
2019-01-09 12:13 ` [tarantool-patches] [PATCH 6/6] sql: introduce ALTER TABLE ADD CONSTRAINT UNIQUE/PRIMARY KEY Nikita Pettik
2019-01-14 14:06   ` [tarantool-patches] " Vladislav Shpilevoy
2019-01-16 20:06     ` n.pettik
2019-01-16 20:54       ` Vladislav Shpilevoy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAE374F1-AF6B-407F-8BB7-674E31AC94E4@tarantool.org \
    --to=korablev@tarantool.org \
    --cc=tarantool-patches@freelists.org \
    --cc=v.shpilevoy@tarantool.org \
    --subject='[tarantool-patches] Re: [PATCH 5/6] sql: fix error message for improperly created index' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox