From: "n.pettik" <korablev@tarantool.org>
To: tarantool-patches@freelists.org
Cc: Ivan Koptelov <ivan.koptelov@tarantool.org>,
Vladislav Shpilevoy <v.shpilevoy@tarantool.org>
Subject: [tarantool-patches] Re: [PATCH v9] sql: add index_def to struct Index
Date: Wed, 4 Jul 2018 12:17:09 +0300 [thread overview]
Message-ID: <2D725625-B171-4451-B1F4-B174CFE679EE@tarantool.org> (raw)
In-Reply-To: <82d4d235-c105-b6b4-dad1-7ae42c23f0ea@tarantool.org>
>
>>> + uint32_t iid, const char *name, uint32_t name_len, bool is_unique,
>>> + struct ExprList *expr_list, u8 idx_type)
>>> +{
>>> + struct space_def *space_def = table->def;
>>> + size_t sql_size = 0;
>>> + struct index_opts opts;
>>> + index_opts_create(&opts);
>>> + index->def = NULL;
>>> + opts.is_unique = is_unique;
>>> + int rc = -1;
>> You don’t use this variable and in the end just reassign it:
>
> This variable is reassigned on success only. On any error we
> go to cleanup or tnt_error and rc remains -1.
Oh, well, then it is OK.
Another one remark (after got approve from team):
@@ -2731,42 +2765,38 @@ sql_create_index(struct Parse *parse, struct Token *token,
* primary key or UNIQUE constraint. We have to invent
* our own name.
*/
- if (token) {
- zName = sqlite3NameFromToken(db, token);
- if (zName == 0)
+ if (token != NULL) {
+ name = sqlite3NameFromToken(db, token);
+ if (name == NULL)
goto exit_create_index;
- assert(token->z != 0);
+ assert(token->z != NULL);
if (!db->init.busy) {
- if (sqlite3HashFind(&db->pSchema->tblHash, zName) !=
+ if (sqlite3HashFind(&db->pSchema->tblHash, name) !=
NULL) {
- sqlite3ErrorMsg(parse,
- "there is already a table named %s",
- zName);
+ sqlite3ErrorMsg(parse, "there is already a "\
+ "table named %s", name);
goto exit_create_index;
There is no need to prohibit creating index with table name, since
index name is local for given table. And most of other DBs also
allow to create index with table name.
next prev parent reply other threads:[~2018-07-04 9:17 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-13 7:30 [tarantool-patches] Re: [PATCH v3] " Ivan Koptelov
2018-06-18 18:45 ` Kirill Shcherbatov
2018-06-21 12:57 ` [tarantool-patches] Re: [PATCH v4] " Ivan Koptelov
2018-06-22 8:46 ` Kirill Shcherbatov
2018-06-27 17:46 ` [tarantool-patches] Re: [PATCH v5] " Ivan Koptelov
2018-06-27 17:57 ` Kirill Shcherbatov
2018-06-28 18:49 ` Vladislav Shpilevoy
2018-06-29 13:49 ` [tarantool-patches] Re: [PATCH v6] " Ivan Koptelov
2018-06-29 20:46 ` Vladislav Shpilevoy
[not found] ` <146c3bd4-e9e6-f943-5a42-c6db966d1c9c@tarantool.org>
2018-07-03 9:00 ` [tarantool-patches] Re: [PATCH v8] " Ivan Koptelov
2018-07-03 9:46 ` [tarantool-patches] Re: [PATCH v8.5] " Ivan Koptelov
2018-07-03 12:13 ` Vladislav Shpilevoy
2018-07-03 11:37 ` [tarantool-patches] Re: [PATCH v9] " Ivan Koptelov
2018-07-03 23:54 ` n.pettik
2018-07-04 0:08 ` Vladislav Shpilevoy
2018-07-04 9:17 ` n.pettik [this message]
2018-07-04 15:55 ` [tarantool-patches] Re: [PATCH v11] " Ivan Koptelov
2018-07-04 19:28 ` n.pettik
2018-07-05 14:50 ` Ivan Koptelov
2018-07-06 0:51 ` n.pettik
2018-07-08 14:17 ` [tarantool-patches] Re: [PATCH v2] " Ivan Koptelov
2018-07-04 10:46 ` [tarantool-patches] Re: [PATCH v9] " Kirill Yukhin
2018-07-04 12:10 ` Kirill Yukhin
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=2D725625-B171-4451-B1F4-B174CFE679EE@tarantool.org \
--to=korablev@tarantool.org \
--cc=ivan.koptelov@tarantool.org \
--cc=tarantool-patches@freelists.org \
--cc=v.shpilevoy@tarantool.org \
--subject='[tarantool-patches] Re: [PATCH v9] sql: add index_def to struct 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