Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Duplicate
-
10.1.18, 10.1(EOL), 10.2(EOL)
-
None
-
10.2.4-1, 10.1.22
Description
Test case
--disable_warnings
|
drop table if exists t1; |
--enable_warnings
|
|
SET timestamp=DEFAULT; |
|
SET @@old_mode=zero_date_time_cast; |
--echo # TIMESTAMP literal, old mode
|
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'); |
SELECT * FROM t1; |
|
--echo # Old mode, TIMESTAMP-alike literal, zon-zero YYYYMMDD, no propagation
|
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; |
EXPLAIN EXTENDED
|
SELECT * FROM t1 WHERE a='0000-00-01 10:20:30' AND LENGTH(a)=30+RAND(); |
|
DROP TABLE t1; |
With : @@optimizer_use_condition_selectivity=1
SELECT * FROM t1 WHERE a='0000-00-01 10:20:30';
|
a
|
34:20:30
|
SELECT * FROM t1 WHERE a='0000-00-01 10:20:30' AND LENGTH(a)=8;
|
a
|
34:20:30
|
With : @@optimizer_use_condition_selectivity=4
SELECT * FROM t1 WHERE a='0000-00-01 10:20:30';
|
a
|
SELECT * FROM t1 WHERE a='0000-00-01 10:20:30' AND LENGTH(a)=8;
|
a
|
Attachments
Issue Links
- duplicates
-
MDEV-15321 different results when using value of optimizer_use_condition_selectivity=4 and =1
- Closed
- relates to
-
MDEV-7635 update defaults and simplify mysqld config parameters
- Closed