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

CREATE AS SELECT produces invalid table structure (with NULL type) and causes replication failure

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Won't Fix
    • Affects Version/s: 5.1.67, 5.2.14, 5.3.12, 5.5.34
    • Fix Version/s: None
    • Component/s: None
    • Labels:

      Description

      The bug exists in 5.1-5.5, but is fixed in 5.6 some time between 5.6.7 and 5.6.10. I presume the bugfix was merged into 10.0, since it's not reproducible on current 10.0 tree. Apparently it was not important enough to fix it in MySQL 5.5, and no need to fix it in MariaDB 5.5 either, but I want it to be filed for the record so that it could be possible to find it next time.

      
      --source include/master-slave.inc
      --source include/have_binlog_format_row.inc
      
      CREATE TABLE t1 SELECT CASE 1 WHEN 0 THEN NULL END AS f; 
      SHOW CREATE TABLE t1;
      
      --sync_slave_with_master
      

      Result:

      SHOW CREATE TABLE t1;
      Table	Create Table
      t1	CREATE TABLE `t1` (
        `f` null DEFAULT NULL
      ) ENGINE=MyISAM DEFAULT CHARSET=latin1
      

      Replication failure:

      Last_Errno	1064
      Last_Error	Error '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 'null DEFAULT NULL
      )' at line 2' on query. Default database: 'test'. Query: 'CREATE TABLE `t1` (
        `f` null DEFAULT NULL
      )'
      

        Gliffy Diagrams

          Attachments

            Activity

            Hide
            elenst Elena Stepanova added a comment -

            Closing right away as "Won't fix", if somebody thinks differently and wants to fix it in 5.5, please feel free to re-open.

            Show
            elenst Elena Stepanova added a comment - Closing right away as "Won't fix", if somebody thinks differently and wants to fix it in 5.5, please feel free to re-open.

              People

              • Assignee:
                Unassigned
                Reporter:
                elenst Elena Stepanova
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: