From: Vladislav Shpilevoy <v.shpilevoy@tarantool.org> To: Nikita Pettik <korablev@tarantool.org>, Chris Sosnin <k.sosnin@tarantool.org> Cc: tarantool-patches@dev.tarantool.org Subject: Re: [Tarantool-patches] [PATCH 1/2] sql: remove grants associated with the table Date: Tue, 24 Dec 2019 17:47:28 +0100 [thread overview] Message-ID: <1965e99f-ca25-c260-3ba9-70d868404d14@tarantool.org> (raw) In-Reply-To: <20191224013731.GE41539@tarantool.org> >> + 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); >> +} >> +
next prev parent reply other threads:[~2019-12-24 16:47 UTC|newest] Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top 2019-12-06 12:53 [Tarantool-patches] [PATCH] " Chris Sosnin 2019-12-07 10:29 ` Chris Sosnin 2019-12-10 23:45 ` Vladislav Shpilevoy 2019-12-11 9:50 ` Chris Sosnin 2019-12-17 23:13 ` Vladislav Shpilevoy 2019-12-17 23:13 ` Vladislav Shpilevoy 2019-12-18 11:00 ` [Tarantool-patches] [PATCH 0/2] sql: revoke table privileges on drop Chris Sosnin 2019-12-18 11:00 ` [Tarantool-patches] [PATCH 1/2] sql: remove grants associated with the table Chris Sosnin 2019-12-24 1:37 ` Nikita Pettik 2019-12-24 16:47 ` Vladislav Shpilevoy [this message] 2019-12-18 11:00 ` [Tarantool-patches] [PATCH 2/2] sql: drop only generated sequence in DROP TABLE Chris Sosnin 2019-12-24 1:23 ` Nikita Pettik 2019-12-24 16:26 ` Vladislav Shpilevoy 2019-12-24 23:19 ` Nikita Pettik
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=1965e99f-ca25-c260-3ba9-70d868404d14@tarantool.org \ --to=v.shpilevoy@tarantool.org \ --cc=k.sosnin@tarantool.org \ --cc=korablev@tarantool.org \ --cc=tarantool-patches@dev.tarantool.org \ --subject='Re: [Tarantool-patches] [PATCH 1/2] sql: remove grants associated with the table' \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox