From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id CB7522ADC2 for ; Thu, 28 Mar 2019 10:01:38 -0400 (EDT) Received: from turing.freelists.org ([127.0.0.1]) by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id KCyCZCUsWlT4 for ; Thu, 28 Mar 2019 10:01:38 -0400 (EDT) Received: from smtp52.i.mail.ru (smtp52.i.mail.ru [94.100.177.112]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTPS id 8747C2AD3D for ; Thu, 28 Mar 2019 10:01:38 -0400 (EDT) Date: Thu, 28 Mar 2019 17:01:36 +0300 From: Konstantin Osipov Subject: [tarantool-patches] Re: [PATCH v2 3/4] sql: fix error message for improperly created index Message-ID: <20190328140136.GB11518@chai> References: <1e34e241c5647b34a59ae0703eea3bcdc39c8fac.1553729426.git.korablev@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1e34e241c5647b34a59ae0703eea3bcdc39c8fac.1553729426.git.korablev@tarantool.org> Sender: tarantool-patches-bounce@freelists.org Errors-to: tarantool-patches-bounce@freelists.org Reply-To: tarantool-patches@freelists.org List-Help: List-Unsubscribe: List-software: Ecartis version 1.0.0 List-Id: tarantool-patches List-Subscribe: List-Owner: List-post: List-Archive: To: tarantool-patches@freelists.org Cc: v.shpilevoy@tarantool.org, Nikita Pettik * Nikita Pettik [19/03/28 15:11]: > 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. We use ER_ALTER_SPACE error code for that in box/alter.cc: tnt_raise(ClientError, ER_ALTER_SPACE, space_name(old_space), "can not add a secondary key before primary"); Would it be possible to reuse this logic? -- Konstantin Osipov, Moscow, Russia, +7 903 626 22 32 http://tarantool.io - www.twitter.com/kostja_osipov