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

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Minor
    • Resolution: Won't Fix
    • 5.1.67, 5.2.14, 5.3.12, 5.5.34
    • None
    • None

    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
      )'

      Attachments

        Activity

          People

            Unassigned Unassigned
            elenst Elena Stepanova
            Votes:
            0 Vote for this issue
            Watchers:
            2 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.