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

With some character sets default value of binary column is displayed incorrectly

    XMLWordPrintable

    Details

      Description

      With sjis for a client character set (maybe with others, too), an empty default value of a binary column, which is usually a line of zero-characters, shows some garbage instead, and thus an attempt to re-create the table using the displayed CREATE TABLE fails with ER_INVALID_DEFAULT.

      10.3 92be8d20

      MariaDB [test]> create table t (a binary default '');
      Query OK, 0 rows affected (0.044 sec)
       
      MariaDB [test]> set names sjis;
      Query OK, 0 rows affected (0.000 sec)
       
      MariaDB [test]> show create table t;
      +-------+-------------------------------------------------------------------------------------------------------------------+
      | Table | Create Table                                                                                                      |
      +-------+-------------------------------------------------------------------------------------------------------------------+
      | t     | CREATE TABLE `t` (
        `a` binary(1) DEFAULT '�_0'
      ) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci  |
      +-------+-------------------------------------------------------------------------------------------------------------------+
      1 row in set (0.000 sec)
       
      MariaDB [test]> set names utf8;
      Query OK, 0 rows affected (0.000 sec)
       
      MariaDB [test]> show create table t;
      +-------+------------------------------------------------------------------------------------------------------------------+
      | Table | Create Table                                                                                                     |
      +-------+------------------------------------------------------------------------------------------------------------------+
      | t     | CREATE TABLE `t` (
        `a` binary(1) DEFAULT '\0'
      ) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci |
      +-------+------------------------------------------------------------------------------------------------------------------+
      1 row in set (0.001 sec)
      

        Attachments

          Activity

            People

            Assignee:
            bar Alexander Barkov
            Reporter:
            elenst Elena Stepanova
            Votes:
            0 Vote for this issue
            Watchers:
            1 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.