From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtpng3.m.smailru.net (smtpng3.m.smailru.net [94.100.177.149]) (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 5811B4696CF for ; Fri, 20 Dec 2019 15:47:43 +0300 (MSK) From: Nikita Pettik Date: Fri, 20 Dec 2019 15:47:19 +0300 Message-Id: <42c5986f5ab25f00af1bedda8782032ea50463b3.1576844632.git.korablev@tarantool.org> In-Reply-To: References: In-Reply-To: References: Subject: [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: tarantool-patches@dev.tarantool.org 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