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

Different results using table or view when comparing values of time type

    Details

      Description

      10.4, reproducible after commit f6a20205148853f4cd352a21de3b77f2372ad50d

      CREATE TABLE t1 (pk int, x1 time, x2 varchar(1));
      INSERT INTO t1 VALUES (17,'09:16:37','k'),(70,'19:44:22','k');
      CREATE VIEW v1 AS SELECT * FROM t1;
       
      SELECT pk FROM t1 WHERE x1 >x2;
      SELECT pk FROM v1 WHERE x1 >x2;
      

      MariaDB [test2]> SELECT pk FROM t1 WHERE x1 >x2;
      +------+
      | pk   |
      +------+
      |   17 |
      |   70 |
      +------+
      2 rows in set, 2 warnings (0.002 sec)
      Warning (Code 1292): Truncated incorrect time value: 'k'
      Warning (Code 1292): Truncated incorrect time value: 'k'
       
      MariaDB [test2]> SELECT pk FROM v1 WHERE x1 >x2;
      Empty set, 2 warnings (0.004 sec)
       
      Warning (Code 1292): Truncated incorrect time value: 'k'
      Warning (Code 1292): Truncated incorrect time value: 'k'
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                bar Alexander Barkov
                Reporter:
                alice Alice Sherepa
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: