<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.</p><p style="font-family: Arial, Tahoma, Verdana, sans-serif;" data-mce-style="font-family: Arial, Tahoma, Verdana, sans-serif;">I will fix it in v5.</p><p style="font-family: Arial, Tahoma, Verdana, sans-serif;" data-mce-style="font-family: Arial, Tahoma, Verdana, sans-serif;"><span style="color: #222222;font-family: Rubik, Arial, sans-serif;font-size: 17px;" data-mce-style="color: #222222; 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;">
Пятница, 18 октября 2019, 17:21 +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_15714084941181942899_BODY">Hi!<br>
<br>
On 23 Sep 18:56, Ilya Kosarev wrote:<br>
> modify_priv, revoke_priv & on_replace_dd_priv triggers are<br>
> cleared from exceptions. A list of functions: priv_def_check,<br>
> priv_def_create_from_tuple, user_grant_priv, user_reload_privs,<br>
> rebuild_effective_grants, grant_revoke, role_check, role_grant,<br>
> role_revoke, priv_grant, access_check_ddl & txn_alter_trigger_new<br>
> were also refactored to achieve it. Their usages are updated.<br>
> user_find_xc is removed as far as it is not needed anymore.<br>
> <br>
> Part of #4247<br>
> ---<br>
> src/box/alter.cc | 334 ++++++++++++++++++++++++++++++++++-------------<br>
> src/box/user.cc | 79 +++++++----<br>
> src/box/user.h | 20 +--<br>
> 3 files changed, 303 insertions(+), 130 deletions(-)<br>
> <br>
> diff --git a/src/box/alter.cc b/src/box/alter.cc<br>
> index d4cb9e8d8..85304c47d 100644<br>
[...]<br>
<br>
> @@ -708,8 +710,15 @@ public:<br>
> static struct trigger *<br>
> txn_alter_trigger_new(trigger_f run, void *data)<br>
> {<br>
> + size_t size = sizeof(struct trigger);<br>
> struct trigger *trigger = (struct trigger *)<br>
> - region_calloc_object_xc(&in_txn()->region, struct trigger);<br>
> + region_aligned_alloc(&in_txn()->region, size,<br>
> + alignof(struct trigger));<br>
> + if (trigger == NULL) {<br>
> + diag_set(OutOfMemory, size, "region", "new slab");<br>
> + return NULL;<br>
> + }<br>
> + trigger = (struct trigger *)memset(trigger, 0, size);<br>
> trigger->run = run;<br>
> trigger->data = data;<br>
> trigger->destroy = NULL;<br>
<br>
After memset of the whole struct there's no need in NULL for the field.<br>
Although, I believe contemporary compiller will expand the memset and remove this.<br>
<br>
Otherwise LGTM.<br>
<br>
Sergos<br>
<br>
<br>
</div>
</div>
</div>
</div>
</blockquote>
<br>
<br>-- <br>Ilya Kosarev<br></BODY></HTML>