From: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>
To: "n.pettik" <korablev@tarantool.org>, tarantool-patches@freelists.org
Subject: [tarantool-patches] Re: [PATCH 2/5] schema: add new system space for FK constraints
Date: Mon, 6 Aug 2018 21:24:58 +0300 [thread overview]
Message-ID: <a149102b-7c78-ca4d-3a38-2b123bf25669@tarantool.org> (raw)
In-Reply-To: <0DFF30FE-9BAF-4149-910A-A552D2740080@tarantool.org>
Hi!
On 06/08/2018 03:28, n.pettik wrote:
> Firstly, I don’t understand some of your fixes:
>
> @@ -3855,11 +3853,9 @@ on_replace_dd_fk_constraint(struct trigger * /* trigger*/, void *event)
> memset(fkey, 0, sizeof(*fkey));
> fkey->def = fk_def;
> fkey->index_id = fk_index->def->iid;
> + rlist_add_entry(&child_space->child_fkey, fkey, child_link);
> + rlist_add_entry(&parent_space->parent_fkey, fkey, parent_link);
> if (old_tuple == NULL) {
> - rlist_add_entry(&child_space->child_fkey, fkey,
> - child_link);
> - rlist_add_entry(&parent_space->parent_fkey, fkey,
> - parent_link);
> struct trigger *on_rollback =
> txn_alter_trigger_new(on_create_fkey_rollback,
> fkey);
> @@ -3868,10 +3864,6 @@ on_replace_dd_fk_constraint(struct trigger * /* trigger*/, void *event)
> struct fkey *old_fk =
> fkey_grab_by_name(&child_space->child_fkey,
> fk_def->name);
> - rlist_add_entry(&child_space->child_fkey, fkey,
> - child_link);
> - rlist_add_entry(&parent_space->parent_fkey, fkey,
> - parent_link);
>
> In case of replace we must firstly remove entry and only then insert new one.
> It is easy to check that the way you suggest doesn’t work (just modify test you provided):
Yes, your are right. This was a buggy hunk. Thanks for the fix!
next prev parent reply other threads:[~2018-08-06 18:25 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-13 2:04 [tarantool-patches] [PATCH 0/5] Move FK constraints to server Nikita Pettik
2018-07-13 2:04 ` [tarantool-patches] [PATCH 1/5] sql: prohibit creation of FK on unexisting tables Nikita Pettik
2018-07-17 21:05 ` [tarantool-patches] " Vladislav Shpilevoy
2018-07-25 10:03 ` n.pettik
2018-07-26 20:12 ` Vladislav Shpilevoy
2018-08-01 20:54 ` n.pettik
2018-08-02 22:15 ` Vladislav Shpilevoy
2018-08-06 0:27 ` n.pettik
2018-07-13 2:04 ` [tarantool-patches] [PATCH 2/5] schema: add new system space for FK constraints Nikita Pettik
2018-07-17 21:05 ` [tarantool-patches] " Vladislav Shpilevoy
2018-07-25 10:03 ` n.pettik
2018-07-26 20:12 ` Vladislav Shpilevoy
2018-08-01 20:54 ` n.pettik
2018-08-02 22:15 ` Vladislav Shpilevoy
2018-08-06 0:28 ` n.pettik
2018-08-06 18:24 ` Vladislav Shpilevoy [this message]
2018-07-13 2:04 ` [tarantool-patches] [PATCH 3/5] sql: introduce ADD CONSTRAINT statement Nikita Pettik
2018-07-17 21:05 ` [tarantool-patches] " Vladislav Shpilevoy
2018-07-25 10:03 ` n.pettik
2018-07-26 20:12 ` Vladislav Shpilevoy
2018-08-01 20:54 ` n.pettik
2018-08-02 22:15 ` Vladislav Shpilevoy
2018-08-06 0:28 ` n.pettik
2018-08-06 18:24 ` Vladislav Shpilevoy
2018-08-06 23:43 ` n.pettik
2018-07-13 2:04 ` [tarantool-patches] [PATCH 4/5] sql: display error on FK creation and drop failure Nikita Pettik
2018-07-17 21:04 ` [tarantool-patches] " Vladislav Shpilevoy
2018-07-25 10:03 ` n.pettik
2018-07-26 20:11 ` Vladislav Shpilevoy
2018-07-13 2:04 ` [tarantool-patches] [PATCH 5/5] sql: remove SQLITE_OMIT_FOREIGN_KEY define guard Nikita Pettik
2018-07-17 21:04 ` [tarantool-patches] Re: [PATCH 0/5] Move FK constraints to server Vladislav Shpilevoy
2018-08-07 14:57 ` 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=a149102b-7c78-ca4d-3a38-2b123bf25669@tarantool.org \
--to=v.shpilevoy@tarantool.org \
--cc=korablev@tarantool.org \
--cc=tarantool-patches@freelists.org \
--subject='[tarantool-patches] Re: [PATCH 2/5] schema: add new system space for FK constraints' \
/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