[Tarantool-patches] [PATCH 1/2] sql: remove grants associated with the table
Vladislav Shpilevoy
v.shpilevoy at tarantool.org
Tue Dec 24 19:47:28 MSK 2019
>> + for (uint8_t token = 0; token < BOX_USER_MAX; ++token) {
>> + if (!access[token].granted)
>> + continue;
>> + had_grants = true;
>
> Personally I wouldn't bother with separate variable solely to
> display comment. Let's keep it tho.
>
We wouldn't either, but appears that VdbeComment asserts when there
is no operation before it. So we must ensure, that the comment is
added only in case at least one opcode is generated.
>> + const struct user *user = user_find_by_token(token);
>> + sqlVdbeAddOp2(v, OP_Integer, user->def->uid, key_reg);
>> + sqlVdbeAddOp4(v, OP_String8, 0, key_reg + 1, 0,
>> + object_type, P4_STATIC);
>> + sqlVdbeAddOp2(v, OP_Integer, object_id, key_reg + 2);
>> + sqlVdbeAddOp3(v, OP_MakeRecord, key_reg, 3, key_reg + 3);
>> + sqlVdbeAddOp2(v, OP_SDelete, BOX_PRIV_ID, key_reg + 3);
>> + }
>> + if (had_grants)
>> + VdbeComment((v, "Remove %s grants", object_type));
>> + sqlReleaseTempRange(parser, key_reg, 4);
>> +}
>> +
More information about the Tarantool-patches
mailing list