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

Strict SQL with system versioned tables causes issues

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Critical
    • Resolution: Fixed
    • 10.3.8
    • 10.5.4, 10.3.24, 10.4.14
    • Versioned Tables
    • None
    • FreeBSD 11.1-STABLE #0 r321665+e0c4ca60dfc(freenas/11.1-stable)

    Description

      Strict SQL mode conflicts with System Versioned tables (only with some queries)

      Example 1: cannot insert into a table if column names are specified, but okay if they're not

      MariaDB [test]> CREATE TABLE broke (x int) WITH SYSTEM VERSIONING;
      Query OK, 0 rows affected (0.005 sec)
       
      MariaDB [test]> INSERT INTO broke VALUES (1);
      Query OK, 1 row affected (0.002 sec)
       
      MariaDB [test]> INSERT INTO broke (x) VALUES (2);
      Query OK, 1 row affected (0.001 sec)
       
      MariaDB [test]> SET @@SQL_MODE = CONCAT(@@SQL_MODE, ',TRADITIONAL');
      Query OK, 0 rows affected (0.000 sec)
       
      MariaDB [test]> INSERT INTO broke VALUES (3);
      Query OK, 1 row affected (0.001 sec)
       
      MariaDB [test]> INSERT INTO broke (x) VALUES (4);
      ERROR 1978 (22007): Incorrect default value '0000-00-00 00:00:00.000000' for column 'row_start'
       
      MariaDB [test]> SELECT * FROM broke;
      +------+
      | x    |
      +------+
      |    1 |
      |    2 |
      |    3 |
      +------+
      3 rows in set (0.000 sec)
      

      Example 2: Cannot even create a system versioned table

      MariaDB [test]> SET @@SQL_MODE = CONCAT(@@SQL_MODE, ',TRADITIONAL');
      Query OK, 0 rows affected (0.000 sec)
       
      MariaDB [test]> CREATE TABLE broke (x int) WITH SYSTEM VERSIONING;
      ERROR 1067 (42000): Invalid default value for 'row_start'
      

      Attachments

        Issue Links

          Activity

            People

              midenok Aleksey Midenkov
              darkain Vincent Milum Jr
              Votes:
              2 Vote for this issue
              Watchers:
              6 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.