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

Unexpected ER_NOT_FORM_FILE or ER_VERS_FIELD_WRONG_TYPE upon creating system-versioned table under mysql56_temporal_format=0

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Duplicate
    • 10.3(EOL), 10.4(EOL), 10.5, 10.6, 10.7(EOL), 10.8(EOL), 10.9(EOL), 10.10(EOL)
    • N/A
    • None

    Description

      Apparently timestamp-based versioning is incompatible with pre-mysql56_temporal_format. It's probably all right, but the errors produced due to this incompatibility are rather confusing and inconsistent.

      SET @mysql56= @@mysql56_temporal_format;
      SET GLOBAL mysql56_temporal_format= 0;
      CREATE TABLE t1 (a INT) WITH SYSTEM VERSIONING;
      CREATE TABLE t2 LIKE t1;
       
      # Cleanup
      DROP TABLE IF EXISTS t1, t2;
      SET GLOBAL mysql56_temporal_format= @mysql56;
      

      10.4 5f26f500

      mysqltest: At line 4: query 'CREATE TABLE t2 LIKE t1' failed: 1033: Incorrect information in file: './test/t2.frm'
      

      So, t1 gets created without a complaint, but t2 with supposedly same structure fails.
      Reproducible on 10.4+. 10.3 creates t2 all right, although what will happen to it afterwards, I can't tell.

      If ROW START/END columns are defined explicitly, the table creation fails right away, but the error it produces is confusing.

      SET @mysql56= @@mysql56_temporal_format;
      SET GLOBAL mysql56_temporal_format= 0;
      CREATE TABLE t1 (a INT, s TIMESTAMP(6) AS ROW START, e TIMESTAMP(6) AS ROW END, PERIOD FOR SYSTEM_TIME(s,e)) WITH SYSTEM VERSIONING;
       
      # Cleanup
      DROP TABLE IF EXISTS t1;
      SET GLOBAL mysql56_temporal_format= @mysql56;
      

      mysqltest: At line 3: query 'CREATE TABLE t1 (a INT, s TIMESTAMP(6) AS ROW START, e TIMESTAMP(6) AS ROW END, PERIOD FOR SYSTEM_TIME(s,e)) WITH SYSTEM VERSIONING' failed: 4110: `s` must be of type TIMESTAMP(6) for system-versioned table `t1`
      

      This variation is reproducible on 10.3+.

      Attachments

        Issue Links

          Activity

            People

              midenok Aleksey Midenkov
              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.