From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtpng1.m.smailru.net (smtpng1.m.smailru.net [94.100.181.251]) (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 4CEBF4696CA for ; Thu, 21 Nov 2019 00:28:31 +0300 (MSK) From: Nikita Pettik Date: Thu, 21 Nov 2019 00:28:11 +0300 Message-Id: <005fe990f2add1906bd106356a6c16efa4f027a3.1574277369.git.korablev@tarantool.org> In-Reply-To: References: In-Reply-To: References: Subject: [Tarantool-patches] [PATCH v2 12/16] 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 4a3241a79..921e76725 100644 --- a/src/box/alter.cc +++ b/src/box/alter.cc @@ -4728,6 +4728,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; } @@ -5236,6 +5237,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; } @@ -5480,6 +5482,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