From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp58.i.mail.ru (smtp58.i.mail.ru [217.69.128.38]) (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 98C8646970F for ; Wed, 27 Nov 2019 17:59:27 +0300 (MSK) Date: Wed, 27 Nov 2019 17:59:25 +0300 From: Sergey Ostanevich Message-ID: <20191127145925.GE1718@tarantool.org> References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Subject: Re: [Tarantool-patches] [PATCH v5 5/8] refactoring: clear triggers from fresh exceptions List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Ilya Kosarev Cc: tarantool-patches@dev.tarantool.org Hi! LGTM. Sergos On 22 Nov 05:46, Ilya Kosarev wrote: > Clear triggers from freshly occured exceptions. Trivial replacements: > `diag_raise` by `return -1`, _xc function by it's non _xc version. > > Part of #4247 > --- > src/box/alter.cc | 3 ++- > src/lua/trigger.c | 2 +- > 2 files changed, 3 insertions(+), 2 deletions(-) > > diff --git a/src/box/alter.cc b/src/box/alter.cc > index 2628e1401..4b3bbca31 100644 > --- a/src/box/alter.cc > +++ b/src/box/alter.cc > @@ -5468,7 +5468,8 @@ on_replace_dd_ck_constraint(struct trigger * /* trigger*/, void *event) > if (old_def->language == ck_def->language && > strcmp(old_def->expr_str, ck_def->expr_str) == 0) { > old_def->is_enabled = ck_def->is_enabled; > - trigger_run_xc(&on_alter_space, space); > + if (trigger_run(&on_alter_space, space) != 0) > + return -1; > return 0; > } > } > diff --git a/src/lua/trigger.c b/src/lua/trigger.c > index b1473bcc1..d588fc12c 100644 > --- a/src/lua/trigger.c > +++ b/src/lua/trigger.c > @@ -79,7 +79,7 @@ lbox_trigger_run(struct trigger *ptr, void *event) > if (fiber()->storage.lua.stack == NULL) { > L = luaT_newthread(tarantool_L); > if (L == NULL) > - diag_raise(); > + return -1; > coro_ref = luaL_ref(tarantool_L, LUA_REGISTRYINDEX); > } else { > L = fiber()->storage.lua.stack; > -- > 2.17.1 >