[tarantool-patches] Re: [PATCH v4 03/20] refactoring: remove diag_raise and tnt_raise from triggers

Sergey Ostanevich sergos at tarantool.org
Wed Oct 16 13:47:28 MSK 2019


Hi!

Just one nit - please, fix. Otherwise LGTM.

Sergos


On 23 Sep 18:56, Ilya Kosarev wrote:
> `tnt_raise` and `diag_raise` are now properly replaced with
> `diag_set` and `return -1` in alter.cc triggers.
> 
> Part of #4247
> ---
>  src/box/alter.cc | 213 ++++++++++++++++++++++++++++++-----------------
>  1 file changed, 137 insertions(+), 76 deletions(-)
> 
> diff --git a/src/box/alter.cc b/src/box/alter.cc
> index 2c1c31023..1fce160f5 100644
> --- a/src/box/alter.cc
> +++ b/src/box/alter.cc

[...]

>  		user_cache_delete(uid);
>  		struct trigger *on_rollback =
> @@ -2960,7 +2990,7 @@ on_replace_dd_func(struct trigger * /* trigger */, void *event)
>  			txn_alter_trigger_new(on_create_func_rollback, NULL);
>  		struct func *func = func_new(def);

This one can return NULL without setting diagnositcs.

>  		if (func == NULL)
> -			diag_raise();
> +			return -1;
>  		def_guard.is_active = false;
>  		func_cache_insert(func);
>  		on_rollback->data = func;




More information about the Tarantool-patches mailing list