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

Roles with trailing white spaces are not cleared correctly

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

            There is a dependency on a previous test:

            With the commit hash 83f7151da5259fa07ab2c26600009d53adef50f3:

            ./mtr create_and_drop_role create_and_grant_role
            

            the failure is reproduced.

            cvicentiu Vicențiu Ciorbaru added a comment - There is a dependency on a previous test: With the commit hash 83f7151da5259fa07ab2c26600009d53adef50f3: ./mtr create_and_drop_role create_and_grant_role the failure is reproduced.
            cvicentiu Vicențiu Ciorbaru added a comment - Fixed with: https://github.com/mariadb/server/commit/eb4f2e063c341d9f3644339c68cb01679e782001

            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.