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

cannot drop a user if its hostname part is not lowercase

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 5.5.34, 10.0.6
    • Fix Version/s: 5.5.35, 10.0.8
    • Component/s: None
    • Labels:
      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.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

              Hide
              serg Sergei Golubchik added a comment -

              fixed in MDEV-5530, MySQL Bug #12917164

              Show
              serg Sergei Golubchik added a comment - fixed in MDEV-5530 , MySQL Bug #12917164

                People

                • Assignee:
                  serg Sergei Golubchik
                  Reporter:
                  serg Sergei Golubchik
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  1 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: