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

Functions in default values in tables with some character sets break SHOW CREATE (and mysqldump)

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • 10.3, 10.4, 10.5, 10.6, 10.7, 10.8, 10.9, 10.10
    • 10.4, 10.5, 10.6
    • Character Sets
    • None

    Description

      CREATE TABLE t (a CHAR(8) DEFAULT REVERSE('aha')) CHARACTER SET utf32;
       
      --echo # In MTR
      SHOW CREATE TABLE t;
      --echo # In the command line client
      --exec $MYSQL test -e "SHOW CREATE TABLE t"
      --echo # In mysqldump
      --exec $MYSQL_DUMP test > $MYSQL_TMP_DIR/1.dump
      --cat_file $MYSQL_TMP_DIR/1.dump
      DROP TABLE t;
      

      In MTR, the output of SHOW CREATE looks all right, but the client and the dump demonstrate the problem:

      10.3 92be8d20

      # In the command line client
      Table	Create Table
      t	CREATE TABLE `t` (\n  `a` char(8) DEFAULT \0\0\0r\0\0\0e\0\0\0v\0\0\0e\0\0\0r\0\0\0s\0\0\0e('aha')\n) ENGINE=MyISAM DEFAULT CHARSET=utf32 COLLATE=utf32_general_ci
       
      # In mysqldump
      ...
      CREATE TABLE `t` (
        `a` char(8) DEFAULT ;
      /*!40101 SET character_set_client = @saved_cs_client */;
      

      Reproducible on all of 10.3-10.11, and 10.2 too; seemingly with any function for a default of a string column.

      Attachments

        Activity

          People

            bar Alexander Barkov
            elenst Elena Stepanova
            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.