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

Behavior with sql_mode=NO_ZERO_DATE or NO_ZERO_IN_DATE became incompatible with MySQL after changes in MySQL 5.6

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Minor
    • Resolution: Won't Fix
    • 10.0.0, 5.5.28, 5.3.9
    • None
    • None
    • None

    Description

      With sql_mode='NO_ZERO_DATE' MariaDB 5.1-10.0 and MySQL 5.1-5.5 throw an error on an attempt to create a table with a default zero date, e.g.

      set sql_mode='NO_ZERO_DATE';
      # Query OK, 0 rows affected (0.00 sec)
       
      CREATE TABLE t1 (d datetime default 0);
      # ERROR 1067 (42000): Invalid default value for 'd'

      But MySQL 5.6 in the same situation only produces a warning:

      SET sql_mode='NO_ZERO_DATE';
      # Query OK, 0 rows affected (0.00 sec)
       
      CREATE TABLE t1 (d datetime default 0);
      # Query OK, 0 rows affected, 1 warning (2.32 sec)
       
      SHOW WARNINGS;
      # +---------+------+--------------------------------------------+
      # | Level   | Code | Message                                    |
      # +---------+------+--------------------------------------------+
      # | Warning | 1264 | Out of range value for column 'd' at row 1 |
      # +---------+------+--------------------------------------------+
      # 1 row in set (0.00 sec)

      As a result, replication from MySQL 5.6 to MariaDB 10.0 fails with 'Invalid default value for 't'' on query.

      Same is true for NO_ZERO_IN_DATE and corresponding values.

      Attachments

        Issue Links

          Activity

            People

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