[Maria-developers] MDEV-7288 USER/ROLE: CREATE OR REPLACE, CREATE IF NOT EXISTS, DROP IF EXISTS
Hi Sergei, Please have a look into the patch for MDEV-7288. It consists of the USER/ROLE related part of the big GSoC patch from Sriram that you reviewed earlier, with review suggestions addressed. You earlier had the following suggestions/questions:
diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index 5f077c2..1e156be 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc ... @@ -9215,10 +9252,26 @@ bool mysql_create_user(THD *thd, List <LEX_USER> &lis */ if (handle_grant_data(tables, 0, user_name, NULL)) { - append_user(thd, &wrong_users, user_name); - - result= TRUE; - continue; + if (thd->lex->is_create_or_replace()) + { + if (handle_grant_data(tables, 1, user_name, NULL) <= 0) + { + append_user(thd, &wrong_users, user_name);
I don't understand that at all. If user creation failed, you try to drop it, but don't create a user again, after the old one was dropped. How could it work?
Yeah, it looks confusing, because handle_grant_data() can do different things depending on the arguments. The call for handle_grant_data(tables, 0, user_name, NULL) does not create any users. It only checks if the user already exists. The call for handle_grant_data(tables, 1, user_name, NULL) drops the user. And the call for replace_user_table() after this block is the one that actually creates the user. I have added some comments in the new code, to make it clearer.
@@ -9268,7 +9321,7 @@ bool mysql_create_user(THD *thd, List <LEX_USER> &list, (handle_as_role) ? "CREATE ROLE" : "CREATE USER", wrong_users.c_ptr_safe());
- if (some_users_created) + if (some_users_created || !result)
What is that for? To binlog CREATE IF NOT EXISTS?
Yes, that was the reason. I renamed "some_users_created" to "binlog" and changed the logic slightly to set "binlog" to true under the block checking lex->create_info.if_not_exists(), instead of this additional test for "result". So now it should be easier to read: if (binlog) result |= write_bin_log(thd, FALSE, thd->query(), thd->query_length()); Thanks.
Hi, Alexander! On Dec 18, Alexander Barkov wrote:
Hi Sergei,
Please have a look into the patch for MDEV-7288. It consists of the USER/ROLE related part of the big GSoC patch from Sriram that you reviewed earlier, with review suggestions addressed.
Looks ok, thanks Regards, Sergei
Happy New Year To all. Any link where we have our mariadb road map ? On Tue, Jan 6, 2015 at 9:17 AM, Sergei Golubchik <serg@mariadb.org> wrote:
Hi, Alexander!
On Dec 18, Alexander Barkov wrote:
Hi Sergei,
Please have a look into the patch for MDEV-7288. It consists of the USER/ROLE related part of the big GSoC patch from Sriram that you reviewed earlier, with review suggestions addressed.
Looks ok, thanks
Regards, Sergei
_______________________________________________ Mailing list: https://launchpad.net/~maria-developers Post to : maria-developers@lists.launchpad.net Unsubscribe : https://launchpad.net/~maria-developers More help : https://help.launchpad.net/ListHelp
Hi! It's mariadb.org/jira You can search by version, for example, to see where each issue is planned to appear. Note though that it shows our plans, not promises. Plans might change. On Jan 09, professional professional pandit wrote:
Happy New Year To all.
Any link where we have our mariadb road map ?
Regards, Sergei
participants (3)
-
Alexander Barkov
-
professional professional pandit
-
Sergei Golubchik