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

DROP USER with unicode hostname doesn't work

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • 10.5.12
    • 10.5, 10.6
    • None
    • None

    Description

      Creating the user 'user'@'�' with utf8 as the client character causes a user to be created that cannot be dropped.
      The unicode characters is (Jira for some reason doesn't show it):
      � U+1F4A9 PILE OF POO

      $ mysql -e "create user 'user'@'�';select user, host, hex(host) from mysql.user where user = 'user'"
      +------+------+-----------+
      | User | Host | hex(host) |
      +------+------+-----------+
      | user |  ??? | 003F3F3F  |
      +------+------+-----------+
      $ mysql  -e "drop user 'user'@'�'"
      ERROR 1396 (HY000) at line 1: Operation DROP USER failed for 'user'@'\0\
      $ mysql -e "drop user 'user'@'???'"
      ERROR 1396 (HY000) at line 1: Operation DROP USER failed for 'user'@'???'
      

      Using --default-character-set=utf8mb4 causes the user to be created "correctly" and it can be dropped with the same host:

      $ mysql --default-character-set=utf8mb4 -e "create user 'user'@'�';select user, host, hex(host) from mysql.user where user = 'user'"
      +------+------+-----------+
      | User | Host | hex(host) |
      +------+------+-----------+
      | user | ?    | 3F        |
      +------+------+-----------+
      $ mysql --default-character-set=utf8mb4 -e "drop user 'user'@'�';"
      
      

      Attachments

        Activity

          People

            sanja Oleksandr Byelkin
            markus makela markus makela
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Git Integration

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