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

LP:731229 - Different results depending on table access method with TIME column and CURDATE()

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:

      Description

      The following query:

      SELECT * FROM t1 WHERE f1 < CURDATE();

      returns different results in 5.1-micro depending on the access method. FORCE KEY returns no rows while IGNORE KEY returns 2 (that is, all) rows in the table. In mysql-5.1 , both access methods return no rows.

      Test case:

      DROP TABLE IF EXISTS t1;
      CREATE TABLE t1 (f1 time , f2 varchar(5), KEY(f1));
      INSERT INTO t1 VALUES ('00:20:01','a'),('00:20:03','b');
      SELECT * FROM t1 FORCE KEY (f1) WHERE f1 < CURDATE();
      SELECT * FROM t1 IGNORE KEY (f1) WHERE f1 < CURDATE();

      In either version, for either access method, no warning is given even though we are comparing a DATE function to a TIME column.

        Gliffy Diagrams

          Attachments

            Activity

            Hide
            ratzpo Rasmus Johansson added a comment -

            Launchpad bug id: 731229

            Show
            ratzpo Rasmus Johansson added a comment - Launchpad bug id: 731229

              People

              • Assignee:
                serg Sergei Golubchik
                Reporter:
                philipstoev Philip Stoev
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: