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

LP:736370 - Datetime functions in subquery context cause wrong result and bogus warnings in mysql-5.1-micro

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • None
    • None
    • None

    Description

      Not repeatable with mysql-5.1. Using a datetime function in a subquery context causes wrong results to be returned and the following warning to be printed out:

      Warning 1292 Incorrect datetime value: '72294422400000000' for column '<left expr>' at row 1

      test case:

      CREATE TABLE t1 (f1 INTEGER, f2 DATE);
      INSERT INTO t1 VALUES (1,'2011-05-05'),(2,'2011-05-05'),(3,'2011-05-05'),(4,'2011-05-05'),(5,'2011-05-05');

      SELECT * FROM t1 WHERE (f1) IN ( SELECT f1 FROM t1); returns correctly 5 rows
      SELECT * FROM t1 WHERE (f1, f2) IN ( SELECT f1 , '2011-05-05' FROM t1); returns 5 rows

      SELECT * FROM t1 WHERE (f1, f2) IN ( SELECT f1 , MAKEDATE( 2011 , 125 ) FROM t1); returns 1 row and 4 warnings

      Attachments

        Activity

          People

            serg Sergei Golubchik
            philipstoev Philip Stoev (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 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.