Details
-
Bug
-
Status: Closed (View Workflow)
-
Minor
-
Resolution: Fixed
-
10.1(EOL), 10.2(EOL)
-
None
-
10.1.32
Description
from t/type_time.test
SET @@old_mode=zero_date_time_cast; |
CREATE TABLE t1 (a TIME); |
INSERT INTO t1 VALUES ('0000-00-00 10:20:30'),('0000-00-00 10:20:31'); |
INSERT INTO t1 VALUES ('0000-00-01 10:20:30'),('0000-00-01 10:20:31'); |
INSERT INTO t1 VALUES ('31 10:20:30'),('32 10:20:30'),('33 10:20:30'),('34 10:20:30'); |
|
SET @@optimizer_use_condition_selectivity=1; |
SELECT * FROM t1 WHERE a='0000-00-01 10:20:30'; |
SELECT * FROM t1 WHERE a='0000-00-01 10:20:30' AND LENGTH(a)=8; |
EXPLAIN EXTENDED SELECT * FROM t1 WHERE a='0000-00-01 10:20:30' AND LENGTH(a)=8; |
|
SET @@optimizer_use_condition_selectivity=4; |
SELECT * FROM t1 WHERE a='0000-00-01 10:20:30'; |
SELECT * FROM t1 WHERE a='0000-00-01 10:20:30' AND LENGTH(a)=8; |
EXPLAIN EXTENDED SELECT * FROM t1 WHERE a='0000-00-01 10:20:30' AND LENGTH(a)=8; |
MariaDB [test]> SET @@optimizer_use_condition_selectivity=1;
|
Query OK, 0 rows affected (0.00 sec)
|
|
MariaDB [test]> SELECT * FROM t1 WHERE a='0000-00-01 10:20:30' ;
|
+----------+
|
| a |
|
+----------+
|
| 34:20:30 |
|
+----------+
|
1 row in set (0.00 sec)
|
|
MariaDB [test]> SET @@optimizer_use_condition_selectivity=4;
|
Query OK, 0 rows affected (0.00 sec)
|
|
MariaDB [test]> SELECT * FROM t1 WHERE a='0000-00-01 10:20:30';
|
Empty set (0.00 sec)
|
Attachments
Issue Links
- is duplicated by
-
MDEV-11062 Different result for time type with optimizer_use_condition_selectivity=4
- Closed
- relates to
-
MDEV-15253 Default optimizer setting changes for MariaDB 10.4
- Closed