<HTML><BODY><p style="font-family: Arial, Tahoma, Verdana, sans-serif;" data-mce-style="font-family: Arial, Tahoma, Verdana, sans-serif;">Hi!<br><br>Thanks for your review.<br><br>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 <span style="font-family: Arial, Tahoma, Verdana, sans-serif;" data-mce-style="font-family: Arial, Tahoma, Verdana, sans-serif;">func_persistent_lua_load sets diagnostics itself.</span><br><br><span style="color: rgb(34, 34, 34); font-family: Rubik, Arial, sans-serif; font-size: 17px;">Sincerely,<br></span>Ilya Kosarev</p><br><br><br><blockquote style="border-left:1px solid #0857A6; margin:10px; padding:0 0 0 10px;">
Среда, 16 октября 2019, 13:47 +03:00 от Sergey Ostanevich <sergos@tarantool.org>:<br>
<br>
<div id="">
<div class="js-helper js-readmsg-msg">
<style type="text/css"></style>
<div>
<div id="style_15712228580377481962_BODY">Hi!<br>
<br>
Just one nit - please, fix. Otherwise LGTM.<br>
<br>
Sergos<br>
<br>
<br>
On 23 Sep 18:56, Ilya Kosarev wrote:<br>
> `tnt_raise` and `diag_raise` are now properly replaced with<br>
> `diag_set` and `return -1` in alter.cc triggers.<br>
> <br>
> Part of #4247<br>
> ---<br>
> src/box/alter.cc | 213 ++++++++++++++++++++++++++++++-----------------<br>
> 1 file changed, 137 insertions(+), 76 deletions(-)<br>
> <br>
> diff --git a/src/box/alter.cc b/src/box/alter.cc<br>
> index 2c1c31023..1fce160f5 100644<br>
> --- a/src/box/alter.cc<br>
> +++ b/src/box/alter.cc<br>
[...]<br>
<br>
> user_cache_delete(uid);<br>
> struct trigger *on_rollback =<br>
> @@ -2960,7 +2990,7 @@ on_replace_dd_func(struct trigger * /* trigger */, void *event)<br>
> txn_alter_trigger_new(on_create_func_rollback, NULL);<br>
> struct func *func = func_new(def);<br>
<br>
This one can return NULL without setting diagnositcs.<br>
<br>
> if (func == NULL)<br>
> - diag_raise();<br>
> + return -1;<br>
> def_guard.is_active = false;<br>
> func_cache_insert(func);<br>
> on_rollback->data = func;<br>
<br>
</div>
</div>
</div>
</div>
</blockquote>
<br>
<br>-- <br>Ilya Kosarev<br></BODY></HTML>