select * from t1 where hours_worked_per_week = 40 and weeks_worked_last_year = 52 and dob < '1949-11-21';
id id2 dob address city hours_worked_per_week weeks_worked_last_year
16 16 1949-11-07 address16 city16 40 52
50 50 1923-09-08 address50 city50 40 52
select * from t1 IGNORE INDEX(dob, weeks_worked_last_year, hours_worked_per_week) where hours_worked_per_week = 40 and weeks_worked_last_year = 52 and dob < '1949-11-21';
id id2 dob address city hours_worked_per_week weeks_worked_last_year
@@ -5315,7 +5315,7 @@ SELECT * FROM t1 WHERE (1=2 OR t1.pk=2) AND t1.a <> 0;
...
@@ -5315,7 +5315,7 @@ SELECT * FROM t1 WHERE (1=2 OR t1.pk=2) AND t1.a <> 0;
id select_type table type possible_keys key key_len ref rows filtered Extra
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
Warnings:
Warnings:
Note 1003 select 2 AS `pk`,0 AS `a` from `test`.`t1` where (0 <> 0)
Note 1003 select 2 AS `pk`,0 AS `a` from `test`.`t1` where 0
DROP TABLE t1;
DROP TABLE t1;
SELECT * FROM mysql.time_zone
SELECT * FROM mysql.time_zone
WHERE ( NOT (Use_leap_seconds <= Use_leap_seconds AND Time_zone_id != 1)
WHERE ( NOT (Use_leap_seconds <= Use_leap_seconds AND Time_zone_id != 1)
...
@@ -5338,7 +5338,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
...
@@ -5338,7 +5338,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 system idx NULL NULL NULL 1 100.00
1 SIMPLE t1 system idx NULL NULL NULL 1 100.00
1 SIMPLE t2 ref idx idx 5 const 1 100.00 Using index
1 SIMPLE t2 ref idx idx 5 const 1 100.00 Using index
Warnings:
Warnings:
Note 1003 select 8 AS `a`,8 AS `b`,`test`.`t2`.`c` AS `c` from `test`.`t2` where ((`test`.`t2`.`c` = 8) and 1)
Note 1003 select 8 AS `a`,8 AS `b`,`test`.`t2`.`c` AS `c` from `test`.`t2` where (`test`.`t2`.`c` = 8)
SELECT * FROM t1 INNER JOIN t2 ON ( c = a )
SELECT * FROM t1 INNER JOIN t2 ON ( c = a )
WHERE 1 IS NULL OR b < 33 AND b = c;
WHERE 1 IS NULL OR b < 33 AND b = c;
a b c
a b c
...
@@ -5462,7 +5462,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
...
@@ -5462,7 +5462,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t2 system PRIMARY NULL NULL NULL 1 100.00
1 SIMPLE t2 system PRIMARY NULL NULL NULL 1 100.00
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
Warnings:
Warnings:
Note 1003 select `test`.`t1`.`pk1` AS `pk1`,`test`.`t1`.`a1` AS `a1`,`test`.`t1`.`b1` AS `b1`,1 AS `pk2`,1 AS `a2` from `test`.`t1` where ((`test`.`t1`.`a1` = 1) and ((`test`.`t1`.`b1` = 6) or 0))
Note 1003 select `test`.`t1`.`pk1` AS `pk1`,`test`.`t1`.`a1` AS `a1`,`test`.`t1`.`b1` AS `b1`,1 AS `pk2`,1 AS `a2` from `test`.`t1` where ((`test`.`t1`.`a1` = 1) and (`test`.`t1`.`b1` = 6))
INSERT INTO t1 VALUES (3,1,6);
INSERT INTO t1 VALUES (3,1,6);
SELECT * FROM t1, t2
SELECT * FROM t1, t2
WHERE a1 = pk2 AND ( ( b1 = 6 OR a2 > 4 ) AND pk2 = a2 OR pk1 IS NULL );
WHERE a1 = pk2 AND ( ( b1 = 6 OR a2 > 4 ) AND pk2 = a2 OR pk1 IS NULL );
@@ -5326,7 +5326,7 @@ SELECT * FROM t1 WHERE (1=2 OR t1.pk=2) AND t1.a <> 0;
...
@@ -5326,7 +5326,7 @@ SELECT * FROM t1 WHERE (1=2 OR t1.pk=2) AND t1.a <> 0;
id select_type table type possible_keys key key_len ref rows filtered Extra
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
Warnings:
Warnings:
Note 1003 select 2 AS `pk`,0 AS `a` from `test`.`t1` where (0 <> 0)
Note 1003 select 2 AS `pk`,0 AS `a` from `test`.`t1` where 0
DROP TABLE t1;
DROP TABLE t1;
SELECT * FROM mysql.time_zone
SELECT * FROM mysql.time_zone
WHERE ( NOT (Use_leap_seconds <= Use_leap_seconds AND Time_zone_id != 1)
WHERE ( NOT (Use_leap_seconds <= Use_leap_seconds AND Time_zone_id != 1)
...
@@ -5349,7 +5349,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
...
@@ -5349,7 +5349,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 system idx NULL NULL NULL 1 100.00
1 SIMPLE t1 system idx NULL NULL NULL 1 100.00
1 SIMPLE t2 ref idx idx 5 const 1 100.00 Using index
1 SIMPLE t2 ref idx idx 5 const 1 100.00 Using index
Warnings:
Warnings:
Note 1003 select 8 AS `a`,8 AS `b`,`test`.`t2`.`c` AS `c` from `test`.`t2` where ((`test`.`t2`.`c` = 8) and 1)
Note 1003 select 8 AS `a`,8 AS `b`,`test`.`t2`.`c` AS `c` from `test`.`t2` where (`test`.`t2`.`c` = 8)
SELECT * FROM t1 INNER JOIN t2 ON ( c = a )
SELECT * FROM t1 INNER JOIN t2 ON ( c = a )
WHERE 1 IS NULL OR b < 33 AND b = c;
WHERE 1 IS NULL OR b < 33 AND b = c;
a b c
a b c
...
@@ -5473,7 +5473,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
...
@@ -5473,7 +5473,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t2 system PRIMARY NULL NULL NULL 1 100.00
1 SIMPLE t2 system PRIMARY NULL NULL NULL 1 100.00
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
Warnings:
Warnings:
Note 1003 select `test`.`t1`.`pk1` AS `pk1`,`test`.`t1`.`a1` AS `a1`,`test`.`t1`.`b1` AS `b1`,1 AS `pk2`,1 AS `a2` from `test`.`t1` where ((`test`.`t1`.`a1` = 1) and ((`test`.`t1`.`b1` = 6) or 0))
Note 1003 select `test`.`t1`.`pk1` AS `pk1`,`test`.`t1`.`a1` AS `a1`,`test`.`t1`.`b1` AS `b1`,1 AS `pk2`,1 AS `a2` from `test`.`t1` where ((`test`.`t1`.`a1` = 1) and (`test`.`t1`.`b1` = 6))
INSERT INTO t1 VALUES (3,1,6);
INSERT INTO t1 VALUES (3,1,6);
SELECT * FROM t1, t2
SELECT * FROM t1, t2
WHERE a1 = pk2 AND ( ( b1 = 6 OR a2 > 4 ) AND pk2 = a2 OR pk1 IS NULL );
WHERE a1 = pk2 AND ( ( b1 = 6 OR a2 > 4 ) AND pk2 = a2 OR pk1 IS NULL );
@@ -5315,7 +5315,7 @@ SELECT * FROM t1 WHERE (1=2 OR t1.pk=2) AND t1.a <> 0;
...
@@ -5315,7 +5315,7 @@ SELECT * FROM t1 WHERE (1=2 OR t1.pk=2) AND t1.a <> 0;
id select_type table type possible_keys key key_len ref rows filtered Extra
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
Warnings:
Warnings:
Note 1003 select 2 AS `pk`,0 AS `a` from `test`.`t1` where (0 <> 0)
Note 1003 select 2 AS `pk`,0 AS `a` from `test`.`t1` where 0
DROP TABLE t1;
DROP TABLE t1;
SELECT * FROM mysql.time_zone
SELECT * FROM mysql.time_zone
WHERE ( NOT (Use_leap_seconds <= Use_leap_seconds AND Time_zone_id != 1)
WHERE ( NOT (Use_leap_seconds <= Use_leap_seconds AND Time_zone_id != 1)
...
@@ -5338,7 +5338,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
...
@@ -5338,7 +5338,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 system idx NULL NULL NULL 1 100.00
1 SIMPLE t1 system idx NULL NULL NULL 1 100.00
1 SIMPLE t2 ref idx idx 5 const 1 100.00 Using index
1 SIMPLE t2 ref idx idx 5 const 1 100.00 Using index
Warnings:
Warnings:
Note 1003 select 8 AS `a`,8 AS `b`,`test`.`t2`.`c` AS `c` from `test`.`t2` where ((`test`.`t2`.`c` = 8) and 1)
Note 1003 select 8 AS `a`,8 AS `b`,`test`.`t2`.`c` AS `c` from `test`.`t2` where (`test`.`t2`.`c` = 8)
SELECT * FROM t1 INNER JOIN t2 ON ( c = a )
SELECT * FROM t1 INNER JOIN t2 ON ( c = a )
WHERE 1 IS NULL OR b < 33 AND b = c;
WHERE 1 IS NULL OR b < 33 AND b = c;
a b c
a b c
...
@@ -5462,7 +5462,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
...
@@ -5462,7 +5462,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t2 system PRIMARY NULL NULL NULL 1 100.00
1 SIMPLE t2 system PRIMARY NULL NULL NULL 1 100.00
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
Warnings:
Warnings:
Note 1003 select `test`.`t1`.`pk1` AS `pk1`,`test`.`t1`.`a1` AS `a1`,`test`.`t1`.`b1` AS `b1`,1 AS `pk2`,1 AS `a2` from `test`.`t1` where ((`test`.`t1`.`a1` = 1) and ((`test`.`t1`.`b1` = 6) or 0))
Note 1003 select `test`.`t1`.`pk1` AS `pk1`,`test`.`t1`.`a1` AS `a1`,`test`.`t1`.`b1` AS `b1`,1 AS `pk2`,1 AS `a2` from `test`.`t1` where ((`test`.`t1`.`a1` = 1) and (`test`.`t1`.`b1` = 6))
INSERT INTO t1 VALUES (3,1,6);
INSERT INTO t1 VALUES (3,1,6);
SELECT * FROM t1, t2
SELECT * FROM t1, t2
WHERE a1 = pk2 AND ( ( b1 = 6 OR a2 > 4 ) AND pk2 = a2 OR pk1 IS NULL );
WHERE a1 = pk2 AND ( ( b1 = 6 OR a2 > 4 ) AND pk2 = a2 OR pk1 IS NULL );