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

SHOW CREATE TABLE produces syntactically incorrect structure

    XMLWordPrintable

    Details

      Description

      Set affected versions to 10.3-10.5 because the commit hasn't been merged up yet.

      create table t (a enum ('x') character set binary);
      show create table t;
      let $def= query_get_value(show create table t,'Create Table',1);
      drop table t;
      eval $def;
       
      # Cleanup
      drop table t;
      

      10.3 32bab2ce

      show create table t;
      Table	Create Table
      t	CREATE TABLE `t` (
        `a` enum('x') CHARACTER SET binary COLLATE binary DEFAULT NULL
      ) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
      drop table t;
      CREATE TABLE `t` (
        `a` enum('x') CHARACTER SET binary COLLATE binary DEFAULT NULL
      ) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;
      bug.t2                                   [ fail ]
              Test ended at 2022-09-17 18:54:54
       
      CURRENT_TEST: bug.t2
      mysqltest: At line 5: query '$def' failed: 1064: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'binary DEFAULT NULL
      ) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swe...' at line 2
      

      The failure started happening after this commit in 10.3:

      commit f1544424de2b8c9d1c3faefbbdd15543db7dfd12
      Author: Alexander Barkov
      Date:   Fri Sep 2 17:32:14 2022 +0400
       
          MDEV-29446 Change SHOW CREATE TABLE to display default collation
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              bar Alexander Barkov
              Reporter:
              elenst Elena Stepanova
              Votes:
              0 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.