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

SHOW CREATE TABLE corrupts `-quoted table options

    XMLWordPrintable

Details

    • Can result in unexpected behaviour
    • Q2/2026 Server Development, Q3/2026 Server Maintenance

    Description

      e.g.

      set sql_mode='ignore_bad_table_options';
      create table t1 (a int) opt=`two words`;
      show create table t1;
      drop table t1;
      

      the value of the option is a string "two words", but it's shown as

      CREATE TABLE `t1` (
        `a` int(11) DEFAULT NULL
      ) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci `opt`=two words
      

      The second, related, problem is with embedded comment markers.

      set sql_mode='ignore_bad_table_options';
      create table t1 (a int) opt='foo*/bar';
      set sql_mode='';
      show create table t1;
      drop table t1;
      

      gets printed as

      CREATE TABLE `t1` (
        `a` int(11) DEFAULT NULL
      ) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci /* `opt`='foo*/bar' */
      

      Attachments

        Issue Links

          Activity

            People

              serg Sergei Golubchik
              Roel Roel Van de Paar
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - 7.9h Original Estimate - 7.9h
                  7.9h
                  Remaining:
                  Remaining Estimate - 0d
                  0d
                  Logged:
                  Time Spent - 1d 0.5h
                  1d 0.5h

                  Git Integration

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