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

Ilya Kosarev i.kosarev at tarantool.org
Mon Oct 21 14:56:48 MSK 2019


Hi!

Thanks for your review.

Not really. func_new return null only in case either func_c_new, func_lua_new or func_sql_builtin_new (depending on which one was called) returns null. Each of them is doing diag_set before returning NULL, except func_lua_new, which also returns null if invoked func_persistent_lua_load could not allocate memory and therefore didn't exit correctly. Though in this case   func_persistent_lua_load sets diagnostics itself.

Sincerely,
Ilya Kosarev


>Среда, 16 октября 2019, 13:47 +03:00 от Sergey Ostanevich <sergos at tarantool.org>:
>
>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;
>


-- 
Ilya Kosarev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.tarantool.org/pipermail/tarantool-patches/attachments/20191021/3ecf2fb1/attachment.html>


More information about the Tarantool-patches mailing list