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

Strict SQL with system versioned tables causes issues

    Details

    • Type: Bug
    • Status: In Review (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 10.3.8
    • Fix Version/s: 10.3
    • Component/s: Versioned Tables
    • Labels:
      None
    • Environment:
      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

              • Assignee:
                serg Sergei Golubchik
                Reporter:
                darkain Vincent Milum Jr
              • Votes:
                1 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated: