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 9925943D67A for ; Thu, 7 Nov 2019 04:05:10 +0300 (MSK) From: Nikita Pettik Date: Thu, 7 Nov 2019 04:04:52 +0300 Message-Id: <20191107010455.64457-13-korablev@tarantool.org> In-Reply-To: <20191107010455.64457-1-korablev@tarantool.org> References: <20191107010455.64457-1-korablev@tarantool.org> Subject: [Tarantool-patches] [PATCH 12/15] 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 Cc: v.shpilevoy@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 941b638ea..3b7f79b5a 100644 --- a/src/box/alter.cc +++ b/src/box/alter.cc @@ -4110,6 +4110,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; } /** @@ -4565,6 +4566,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; } /** Create an instance of check constraint definition by tuple. */ @@ -4777,6 +4779,7 @@ on_replace_dd_ck_constraint(struct trigger * /* trigger*/, void *event) txn_stmt_on_commit(stmt, on_commit); trigger_run_xc(&on_alter_space, space); + ++schema_version; } /** A trigger invoked on replace in the _func_index space. */ -- 2.15.1