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

Cursor protocol gives incorrect result with sql_mode='ALLOW_INVALID_DATES'

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • 10.4(EOL), 10.5, 10.6, 10.9(EOL), 10.10(EOL), 11.0(EOL), 11.1(EOL), 11.2(EOL)
    • 10.5, 10.6
    • None
    • None

    Description

      Cursor protocol gives incorrect result with sql_mode='ALLOW_INVALID_DATES'- invalid dates are replaced with "0000-00-00" , but it is important for repeating that after inserting invalid date to set sql_mode='ansi,traditional' and insert correct date:

      Testcase:

      CREATE TABLE t1 (col1 date);
       
      set @@sql_mode='STRICT_ALL_TABLES,ALLOW_INVALID_DATES';
      INSERT INTO t1 VALUES ('2004-2-30');
       
      set @@sql_mode='ansi,traditional';
      INSERT IGNORE INTO t1 VALUES('2004-02-29');
       
      select * from t1;
      drop table t1;
      

      Expected value:

      col1
      2004-02-30
      2004-02-29
      

      Actual value:

      col1
      0000-00-00
      2004-02-29
      

      Attachments

        Issue Links

          Activity

            People

              sanja Oleksandr Byelkin
              lstartseva Lena Startseva
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.