Tarantool development patches archive
 help / color / mirror / Atom feed
From: "Ilya Kosarev" <i.kosarev@tarantool.org>
To: "Sergey Ostanevich" <sergos@tarantool.org>
Cc: tarantool-patches <tarantool-patches@freelists.org>,
	tarantool-patches <tarantool-patches@dev.tarantool.org>
Subject: Re: [Tarantool-patches] [tarantool-patches] [PATCH v4 11/20] refactoring: use non _xc version of functions in triggers
Date: Sun, 10 Nov 2019 01:52:19 +0300	[thread overview]
Message-ID: <1573339939.692166871@f275.i.mail.ru> (raw)
In-Reply-To: <1573329671.649762688@f148.i.mail.ru>

[-- Attachment #1: Type: text/plain, Size: 1962 bytes --]


Hi!

Thanks for your review.
Yes, i definitely missed diag_set with sequence_by_id. Will be fixed in v5. 

Also i will reconsider combining child & parent space search.
Sincerely,
Ilya Kosarev


>Суббота,  9 ноября 2019, 23:01 +03:00 от Sergey Ostanevich <sergos@tarantool.org>:
>
>Hi!
>
>LGTM, just couple of nits below you can add to a follow-up.
>
>Sergos
>
>>diff --git a/src/box/alter.cc b/src/box/alter.cc
>>index e56d7c6cc..69a749326 100644
>>--- a/src/box/alter.cc
>>+++ b/src/box/alter.cc
>>@@ -4117,14 +4167,18 @@ on_replace_dd_sequence_data(struct trigger * /* trigger */, void *event)
>> 	struct tuple *old_tuple = stmt->old_tuple;
>> 	struct tuple *new_tuple = stmt->new_tuple;
>>
>>-	uint32_t id = tuple_field_u32_xc(old_tuple ?: new_tuple,
>>-					 BOX_SEQUENCE_DATA_FIELD_ID);
>>-	struct sequence *seq = sequence_cache_find(id);
>>+	uint32_t id;
>>+	if (tuple_field_u32(old_tuple ?: new_tuple, BOX_SEQUENCE_DATA_FIELD_ID,
>>+			    &id) != 0)
>>+		return -1;
>>+	struct sequence *seq = sequence_by_id(id);
>> 	if (seq == NULL)
>> 		return -1;
>Note, that here we will miss the diag_set for non-zero value. 
>Perhaps a question of further patches for sequence_by_id() - but I didn't find it in log
>
>>@@ -4958,10 +5034,10 @@ on_replace_dd_fk_constraint(struct trigger * /* trigger*/, void *event)
>> 			fk_constraint_def_new_from_tuple(old_tuple,
>> 						ER_DROP_FK_CONSTRAINT);
>> 		auto fk_def_guard = make_scoped_guard([=] { free(fk_def); });
>>-		struct space *child_space =
>>-			space_cache_find_xc(fk_def->child_id);
>>-		struct space *parent_space =
>>-			space_cache_find_xc(fk_def->parent_id);
>>+		struct space *child_space = space_cache_find(fk_def->child_id);
>>+		struct space *parent_space = space_cache_find(fk_def->parent_id);
>>+		if (child_space == NULL or parent_space == NULL)
>>+			return -1; 
>Shall we return after the first error? Will they affect each other?
>
>>
>     


-- 
Ilya Kosarev

[-- Attachment #2: Type: text/html, Size: 3858 bytes --]

  parent reply	other threads:[~2019-11-09 22:52 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <cover.1569253692.git.i.kosarev@tarantool.org>
     [not found] ` <15e506eb070ddbb0bbb0c0f4388958738f1fbc9a.1569253692.git.i.kosarev@tarantool.org>
     [not found]   ` <20191030085942.GA35607@tarantool.org>
2019-10-30 10:47     ` [Tarantool-patches] [tarantool-patches] [PATCH v4 07/20] refactoring: remove exceptions from index_def_new_from_tuple Ilya Kosarev
2019-10-31  5:02       ` Sergey Ostanevich
     [not found] ` <09dd946a8304f3865ada1638f610a4f9ba2fd3eb.1569253692.git.i.kosarev@tarantool.org>
     [not found]   ` <20191030103454.GB35607@tarantool.org>
2019-10-30 11:02     ` [Tarantool-patches] [tarantool-patches] [PATCH v4 08/20] refactoring: remove exceptions from func_def_new_from_tuple Ilya Kosarev
2019-11-11 14:36       ` Sergey Ostanevich
     [not found] ` <c7b7c7fd16803e60296be60c3e545dbf2ab61ae8.1569253692.git.i.kosarev@tarantool.org>
     [not found]   ` <1573329671.649762688@f148.i.mail.ru>
2019-11-09 22:52     ` Ilya Kosarev [this message]
2019-11-11 14:37       ` [Tarantool-patches] [tarantool-patches] [PATCH v4 11/20] refactoring: use non _xc version of functions in triggers Sergey Ostanevich
     [not found] ` <e5cebfe21734bcfe8b7a8b477968668620cb3aa8.1569253692.git.i.kosarev@tarantool.org>
     [not found]   ` <20191112105951.GC10433@tarantool.org>
2019-11-12 15:32     ` [Tarantool-patches] [tarantool-patches] Re: [PATCH v4 12/20] refactoring: remove exceptions from space_def_new_from_tuple Ilya Kosarev
2019-11-19 15:16       ` Ilya Kosarev
2019-12-16 11:55         ` [Tarantool-patches] [tarantool-patches] Re[2]: " Sergey Ostanevich
     [not found] ` <6f586562e3079b4ca5776b74913894db73bd979f.1569253692.git.i.kosarev@tarantool.org>
     [not found]   ` <20191113133416.dtdgl63r7erfwfht@tarantool.org>
2019-11-13 13:49     ` [Tarantool-patches] [PATCH] refactoring: remove exceptions from fk_constraint_def_new_from_tuple Ilya Kosarev
2019-11-13 16:02       ` Kirill Yukhin
2019-11-13 13:50     ` [Tarantool-patches] [tarantool-patches] Re: [PATCH v4 17/20] " Ilya Kosarev

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=1573339939.692166871@f275.i.mail.ru \
    --to=i.kosarev@tarantool.org \
    --cc=sergos@tarantool.org \
    --cc=tarantool-patches@dev.tarantool.org \
    --cc=tarantool-patches@freelists.org \
    --subject='Re: [Tarantool-patches] [tarantool-patches] [PATCH v4 11/20] refactoring: use non _xc version of functions in triggers' \
    /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