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

Roles with trailing white spaces are not cleared correctly

    XMLWordPrintable

Details

    Description

      http://buildbot.askmonty.org/buildbot/builders/kvm-deb-precise-x86/builds/4325/steps/test_5/logs/stdio

      roles.create_and_grant_role              w2 [ fail ]
              Test ended at 2016-11-25 17:38:48
       
      CURRENT_TEST: roles.create_and_grant_role
      --- /usr/share/mysql/mysql-test/suite/roles/create_and_grant_role.result	2016-11-25 13:01:58.000000000 +0200
      +++ /run/shm/var/2/log/create_and_grant_role.reject	2016-11-25 17:38:47.911410836 +0200
      @@ -16,6 +16,7 @@
       GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
       GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION
       GRANT USAGE ON *.* TO 'r1'
      +GRANT foo   TO 'root'@'localhost' WITH ADMIN OPTION
       GRANT r1 TO 'root'@'localhost' WITH ADMIN OPTION
       drop role r1;
       select * from mysql.roles_mapping;
      @@ -24,3 +25,4 @@
       Grants for root@localhost
       GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
       GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION
      +GRANT foo   TO 'root'@'localhost' WITH ADMIN OPTION
       
      mysqltest: Result length mismatch
      

      create role 'foo  ';
      select concat(user, '__'), host from mysql.user;
      select * from mysql.roles_mapping;
      drop role foo;
      select concat(user, '__'), host from mysql.user;
      select * from mysql.roles_mapping;
      --sorted_result
      show grants;
       
       
      -- Here we see
      Grants for root@localhost
      GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
      GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION
      GRANT foo   TO 'root'@'localhost' WITH ADMIN OPTION
      

      The tables are cleared correctly. The problem only lies within the internal data structures. Running flush privileges will fix the problem.

      Attachments

        Issue Links

          Activity

            People

              cvicentiu Vicențiu Ciorbaru
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              2 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.