Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
10.4(EOL)
-
None
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
- relates to
-
MDEV-4667 DATE('string') incompability between mysql and mariadb
-
- Closed
-
-
MDEV-17342 Mariadb is giving warning for this query and table
-
- Open
-
-
MDEV-17478 Wrong result for TIME('+100:20:30')
-
- Closed
-
-
MDEV-17625 Different warnings when comparing a garbage to DATETIME vs TIME
-
- Closed
-
-
MDEV-17634 Regression: TIME(0)=TIME('z') returns NULL vs 1
-
- Closed
-
-
MDEV-17632 Inconsistent behavior of conversion to DATETIME for comparison
-
- Open
-
The problem is repeatable in all versions starting from 5.5, but for an empty string in x2 (instead of garbage like 'k'):
The first SELECT returns:
+------+
| pk |
+------+
| 17 |
+------+
1 row in set, 1 warning (0.00 sec)
The second SELECT returns:
Empty set, 1 warning (0.00 sec)
The problem is also repeatable for DATETIME in all versions starting with 5.5, for both empty string and garbage:
The first SELECT returns two rows:
+------+
| pk |
+------+
| 17 |
| 18 |
+------+
2 rows in set, 2 warnings (0.00 sec)
The second SELECT returns empty set.