From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp63.i.mail.ru (smtp63.i.mail.ru [217.69.128.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 88ED646970E for ; Wed, 25 Dec 2019 17:33:59 +0300 (MSK) Date: Wed, 25 Dec 2019 17:33:58 +0300 From: Sergey Ostanevich Message-ID: <20191225143358.GO19594@tarantool.org> References: <42c5986f5ab25f00af1bedda8782032ea50463b3.1576844632.git.korablev@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <42c5986f5ab25f00af1bedda8782032ea50463b3.1576844632.git.korablev@tarantool.org> Subject: Re: [Tarantool-patches] [PATCH v3 14/20] box: increment schema_version on ddl operations List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Nikita Pettik Cc: tarantool-patches@dev.tarantool.org Hi! Thanks for the patch, LGTM. Sergos On 20 Dec 15:47, Nikita Pettik wrote: > Some DDL operations such as SQL trigger alter, check and foreign > constraint alter don't result in schema version change. On the other > hand, we are going to rely on schema version to determine expired > prepared statements: for instance, if FK constraint has been created > after DML statement preparation, the latter may ignore FK constraint > (instead of proper "statement has expired" error). Let's fix it and > account schema change on each DDL operation. > > Need for #2592 > --- > src/box/alter.cc | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/src/box/alter.cc b/src/box/alter.cc > index bef25b605..f33c1dfd2 100644 > --- a/src/box/alter.cc > +++ b/src/box/alter.cc > @@ -4773,6 +4773,7 @@ on_replace_dd_trigger(struct trigger * /* trigger */, void *event) > > txn_stmt_on_rollback(stmt, on_rollback); > txn_stmt_on_commit(stmt, on_commit); > + ++schema_version; > return 0; > } > > @@ -5283,6 +5284,7 @@ on_replace_dd_fk_constraint(struct trigger * /* trigger*/, void *event) > space_reset_fk_constraint_mask(child_space); > space_reset_fk_constraint_mask(parent_space); > } > + ++schema_version; > return 0; > } > > @@ -5528,6 +5530,7 @@ on_replace_dd_ck_constraint(struct trigger * /* trigger*/, void *event) > > if (trigger_run(&on_alter_space, space) != 0) > return -1; > + ++schema_version; > return 0; > } > > -- > 2.15.1 >