From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: From: Vladimir Davydov Subject: [PATCH 01/10] ddl: unreference view on space drop synchronously Date: Wed, 3 Jul 2019 22:30:03 +0300 Message-Id: <48da942fd73efa055980f799197642a6fb8187da.1562181197.git.vdavydov.dev@gmail.com> In-Reply-To: References: In-Reply-To: References: To: kostja@tarantool.org Cc: tarantool-patches@freelists.org List-ID: Do it on_replace rather than on_commit. This is required to implement transactional DDL. Note, this is the only place where on_replace_dd_space() postpones schema update until after commit. Other than that, space updates are already transactional DDL friendly. --- src/box/alter.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/box/alter.cc b/src/box/alter.cc index e76b9e68..7c4d949f 100644 --- a/src/box/alter.cc +++ b/src/box/alter.cc @@ -1680,7 +1680,6 @@ on_drop_view_commit(struct trigger *trigger, void *event) { (void) event; struct Select *select = (struct Select *)trigger->data; - update_view_references(select, -1, true, NULL); sql_select_delete(sql_get(), select); } @@ -1694,6 +1693,7 @@ on_drop_view_rollback(struct trigger *trigger, void *event) { (void) event; struct Select *select = (struct Select *)trigger->data; + update_view_references(select, 1, true, NULL); sql_select_delete(sql_get(), select); } @@ -1912,6 +1912,7 @@ on_replace_dd_space(struct trigger * /* trigger */, void *event) txn_alter_trigger_new(on_drop_view_rollback, select); txn_on_rollback(txn, on_rollback_view); + update_view_references(select, -1, true, NULL); select_guard.is_active = false; } } else { /* UPDATE, REPLACE */ -- 2.11.0