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

Bad "default-character-set" option in [client] option group 50-client.cnf on Debian/Ubuntu

Details

    Description

      The 50-client.cnf configuration file on Debian/Ubuntu currently sets default-character-set:

      $ cat /etc/mysql/mariadb.conf.d/50-client.cnf 
      #
      # This group is read by the client library
      # Use it for options that affect all clients, but not the server
      #
       
      [client]
      # Default is Latin1, if you need UTF-8 set this (also in server section)
      default-character-set = utf8mb4
       
      # Example of client certificate usage
      # ssl-cert=/etc/mysql/client-cert.pem
      # ssl-key=/etc/mysql/client-key.pem
      #
      # Allow only TLS encrypted connections
      # ssl-verify-server-cert=on
       
      # This group is *never* read by mysql client library, though this
      # /etc/mysql/mariadb.cnf.d/client.cnf file is not read by Oracle MySQL
      # client anyway.
      # If you use the same .cnf file for MySQL and MariaDB,
      # use it for MariaDB-only client options
      [client-mariadb]
      

      Not all clients support the default-character-set option, so this causes errors when those clients are used. For example, mysqlbinlog doesn't support it:

      $ mysqlbinlog --help 
      mysqlbinlog: unknown variable 'default-character-set=utf8mb4'
      

      And neither does mysqlslap:

      $ mysqlslap --help 
      mysqlslap: unknown variable 'default-character-set=utf8mb4'
      

      This option should not be in the [client] option group, since not all clients support it.

      Attachments

        Issue Links

          Activity

            GeoffMontee Geoff Montee (Inactive) created issue -
            GeoffMontee Geoff Montee (Inactive) made changes -
            Field Original Value New Value
            Summary Bad option in 50-client.cnf on Debian/Ubuntu Bad "default-character-set" option in [client] group 50-client.cnf on Debian/Ubuntu
            GeoffMontee Geoff Montee (Inactive) made changes -
            GeoffMontee Geoff Montee (Inactive) made changes -
            Component/s Configuration [ 13904 ]
            GeoffMontee Geoff Montee (Inactive) made changes -
            Summary Bad "default-character-set" option in [client] group 50-client.cnf on Debian/Ubuntu Bad "default-character-set" option in [client] option group 50-client.cnf on Debian/Ubuntu
            serg Sergei Golubchik made changes -
            Priority Major [ 3 ] Blocker [ 1 ]
            serg Sergei Golubchik made changes -
            Fix Version/s 10.5.4 [ 24264 ]
            Fix Version/s 10.5 [ 23123 ]
            Assignee Sergei Golubchik [ serg ] Oleksandr Byelkin [ sanja ]
            Resolution Fixed [ 1 ]
            Status Open [ 1 ] Closed [ 6 ]

            I am re-opening this issue for further work.

            The commit 039cb6f6bfaaeafeb87e6d10c88be2cac87654e7 completely reverts and nullifies the previous change to start using utf8mb4 by default. You should not just remove it, in particular without any consultation with people who did the prior work such as me and robertbindar and @serg in https://github.com/MariaDB/server/pull/1504/commits

            We have had UTFMB4 by default in Debian for years and nobody has reported that mysqlbinlog or other tools would be incompatible with it. If they are, shouldn't those tools be updated to support that option? Or this config section moved to another name? Just bluntly disabling it with an inline comment (but without any explaining lines) is not a good option. This needs more work.

            otto Otto Kekäläinen added a comment - I am re-opening this issue for further work. The commit 039cb6f6bfaaeafeb87e6d10c88be2cac87654e7 completely reverts and nullifies the previous change to start using utf8mb4 by default. You should not just remove it, in particular without any consultation with people who did the prior work such as me and robertbindar and @serg in https://github.com/MariaDB/server/pull/1504/commits We have had UTFMB4 by default in Debian for years and nobody has reported that mysqlbinlog or other tools would be incompatible with it. If they are, shouldn't those tools be updated to support that option? Or this config section moved to another name? Just bluntly disabling it with an inline comment (but without any explaining lines) is not a good option. This needs more work.
            otto Otto Kekäläinen made changes -
            Resolution Fixed [ 1 ]
            Status Closed [ 6 ] Stalled [ 10000 ]
            julien.fritsch Julien Fritsch made changes -
            Fix Version/s 10.5 [ 23123 ]
            Fix Version/s 10.5.4 [ 24264 ]
            otto Otto Kekäläinen made changes -

            It doesn't revert and nullify your change, utf8mb4 is still the default for the server, so all tables will use utf8mb4 by default and data will be stored as utf8mb4 by default.

            The mariadb client should not be forced to use utf8mb4 by default, a better default behavior is to auto-detect the character set from the current locale. This is what it does now.

            Some other clients don't recognize default-character-set at all.

            So, in short, while utf8mb4 for the server is fine, for the client it is not.

            serg Sergei Golubchik added a comment - It doesn't revert and nullify your change, utf8mb4 is still the default for the server, so all tables will use utf8mb4 by default and data will be stored as utf8mb4 by default. The mariadb client should not be forced to use utf8mb4 by default, a better default behavior is to auto-detect the character set from the current locale. This is what it does now. Some other clients don't recognize default-character-set at all. So, in short, while utf8mb4 for the server is fine, for the client it is not.
            serg Sergei Golubchik made changes -
            Assignee Oleksandr Byelkin [ sanja ]
            serg Sergei Golubchik made changes -
            Priority Blocker [ 1 ] Major [ 3 ]
            otto Otto Kekäläinen made changes -
            Assignee Otto Kekäläinen [ otto ]
            otto Otto Kekäläinen made changes -
            Status Stalled [ 10000 ] In Progress [ 3 ]

            Final fix (removal of it completely) is included in https://github.com/MariaDB/server/pull/1600

            otto Otto Kekäläinen added a comment - Final fix (removal of it completely) is included in https://github.com/MariaDB/server/pull/1600
            GeoffMontee Geoff Montee (Inactive) made changes -
            alice Alice Sherepa made changes -

            the bug itself (default-character-set in [client]) was fixed in 10.5.4.
            I'm closing it again so that users could see the that bug was fixed and when.

            your PR meanwhile was merged too.

            serg Sergei Golubchik added a comment - the bug itself (default-character-set in [client] ) was fixed in 10.5.4. I'm closing it again so that users could see the that bug was fixed and when. your PR meanwhile was merged too.
            serg Sergei Golubchik made changes -
            Fix Version/s 10.5.4 [ 24264 ]
            Fix Version/s 10.5 [ 23123 ]
            Resolution Fixed [ 1 ]
            Status In Progress [ 3 ] Closed [ 6 ]
            serg Sergei Golubchik made changes -
            Workflow MariaDB v3 [ 110342 ] MariaDB v4 [ 158005 ]

            People

              otto Otto Kekäläinen
              GeoffMontee Geoff Montee (Inactive)
              Votes:
              1 Vote for this issue
              Watchers:
              4 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.