From: Nikita Pettik <korablev@tarantool.org>
To: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>
Cc: tarantool-patches@dev.tarantool.org
Subject: Re: [Tarantool-patches] [PATCH] sql: support constraint drop
Date: Fri, 21 Feb 2020 02:36:07 +0300 [thread overview]
Message-ID: <20200220233607.GB51816@tarantool.org> (raw)
In-Reply-To: <1fc992ec-c0b8-320e-699d-bfa8047c9833@tarantool.org>
On 21 Feb 00:09, Vladislav Shpilevoy wrote:
> Hi! Thanks for the patch!
>
> > - vdbe_emit_fk_constraint_drop(parse_context, constraint_name,
> > - child->def);
> > - /*
> > - * We account changes to row count only if drop of
> > - * foreign keys take place in a separate
> > - * ALTER TABLE DROP CONSTRAINT statement, since whole
> > - * DROP TABLE always returns 1 (one) as a row count.
> > - */
> > struct Vdbe *v = sqlGetVdbe(parse_context);
> > + assert(v != NULL);
> > + assert(id->type < constraint_type_MAX);
> > + switch (id->type) {
> > + case CONSTRAINT_TYPE_PK:
> > + case CONSTRAINT_TYPE_UNIQUE: {
> > + uint32_t index_id = box_index_id_by_name(space->def->id, name,
> > + strlen(name));
>
> 3. This is definitely not ok. It is not just looking at space *, it is a
> select during parsing. _index has a unique index by space id and name, so
> you can emit a deletion opcode without learning an index id. It shouldn't
> be hard.
Fair note. Then additional request from me: let's remove
box_index_id_by_name() from sql_drop_index() and pragma_index_info()
as well (in a separate patch ofc).
next prev parent reply other threads:[~2020-02-20 23:36 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-09 10:15 Roman Khabibov
2020-01-13 17:00 ` Nikita Pettik
2020-01-24 14:21 ` [Tarantool-patches] [PATCH 2/2] " Roman Khabibov
2020-01-28 17:39 ` Nikita Pettik
2020-02-01 17:36 ` Roman Khabibov
2020-02-11 16:56 ` Nikita Pettik
2020-02-16 10:24 ` Roman Khabibov
2020-02-20 19:55 ` Nikita Pettik
2020-02-20 23:09 ` [Tarantool-patches] [PATCH] " Vladislav Shpilevoy
2020-02-20 23:36 ` Nikita Pettik [this message]
2020-02-29 12:47 ` [Tarantool-patches] [PATCH v2 3/3] " Roman Khabibov
2020-02-29 15:32 ` Vladislav Shpilevoy
2020-03-03 10:13 ` Roman Khabibov
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=20200220233607.GB51816@tarantool.org \
--to=korablev@tarantool.org \
--cc=tarantool-patches@dev.tarantool.org \
--cc=v.shpilevoy@tarantool.org \
--subject='Re: [Tarantool-patches] [PATCH] sql: support constraint drop' \
/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