Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-5221

User auto-creation does not work upon GRANT <role>

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 10.0.5
    • 10.0.8
    • None
    • None

    Description

      As discussed on IRC, it should work as a normal GRANT <privilege>, but now it doesn't. The test case is below, cannot push it or record the result since it doesn't work.

      --disable_warnings
      drop database if exists db;
      --enable_warnings
      --error 0,ER_CANNOT_USER
      drop role auto_create;
       
      create database db;
      create role auto_create;
      grant all on db.* to auto_create;
       
      --error 0,ER_CANNOT_USER
      drop user foo@localhost, bar@localhost;
       
      grant auto_create to foo@localhost;
      grant auto_create to bar@localhost identified by 'baz';
       
      --connect (con1,localhost,foo,,db)
      set role 'auto_create';
      create table t1 (i int);
      --disconnect con1
       
      --connect (con1,localhost,bar,baz,db)
      set role auto_create;
      insert into t1 values (1);
      --disconnect con1
       
      --connection default
      drop user foo@localhost, bar@localhost;
       
      set @sql_mode_saved = @@sql_mode;
      set sql_mode = 'no_auto_create_user';
       
      --error ER_PASSWORD_NO_MATCH
      grant auto_create to foo@localhost;
      grant auto_create to bar@localhost identified by 'baz';
       
      --error ER_ACCESS_DENIED_ERROR
      --connect (con1,localhost,foo,,db)
      --connect (con1,localhost,bar,baz,db)
      set role auto_create;
      drop table t1;
      --disconnect con1
       
      --connection default
       
      drop user bar@localhost;
      drop role auto_create;
      drop database db;
       
      set sql_mode = @sql_mode_saved;

      Attachments

        Issue Links

          Activity

            People

              serg Sergei Golubchik
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.