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

cannot drop a user if its hostname part is not lowercase

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 5.5.34, 10.0.6
    • 5.5.35, 10.0.8
    • None
    • None

    Description

      Normally, all values in the mysql.user.host column are lowercase. The parser converts all host names to lowercase in sql_yacc.yy. But mysql_install_db does not, so if the actual local host name is not lowercase it'll end up this way in the mysql.user table.

      This user entry becomes impossible to drop:

      insert mysql.user (host) values ('Foo');
      flush privileges;
      select user,host from mysql.user;
      drop user ''@Foo;
      --error ER_CANNOT_USER
      drop user ''@Foo;
      flush privileges;
      select user,host from mysql.user;
      drop user ''@foo;
      flush privileges;
      select user,host from mysql.user;

      Note flush privileges after every drop user. Because the user is actually deleted from the in-memory structures, but not from the table on disk. That's why the second drop user fails, but if we re-read privilege tables, it reappears.

      Attachments

        Issue Links

          Activity

            People

              serg Sergei Golubchik
              serg Sergei Golubchik
              Votes:
              0 Vote for this issue
              Watchers:
              1 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.