diff options
Diffstat (limited to 'mysql-test/main/select_pkeycache.result')
-rw-r--r-- | mysql-test/main/select_pkeycache.result | 143 |
1 files changed, 95 insertions, 48 deletions
diff --git a/mysql-test/main/select_pkeycache.result b/mysql-test/main/select_pkeycache.result index 352ab4ddef4..f4fd91233b5 100644 --- a/mysql-test/main/select_pkeycache.result +++ b/mysql-test/main/select_pkeycache.result @@ -2118,8 +2118,8 @@ INSERT INTO t2 VALUES (1,3,10,'2002-06-01 08:00:00',35),(1,3,1010,'2002-06-01 12 SELECT a.gvid, (SUM(CASE b.sampletid WHEN 140 THEN b.samplevalue ELSE 0 END)) as the_success,(SUM(CASE b.sampletid WHEN 141 THEN b.samplevalue ELSE 0 END)) as the_fail,(SUM(CASE b.sampletid WHEN 142 THEN b.samplevalue ELSE 0 END)) as the_size,(SUM(CASE b.sampletid WHEN 143 THEN b.samplevalue ELSE 0 END)) as the_time FROM t1 a, t2 b WHERE a.hmid = b.hmid AND a.volid = b.volid AND b.sampletime >= 'wrong-date-value' AND b.sampletime < 'wrong-date-value' AND b.sampletid IN (140, 141, 142, 143) GROUP BY a.gvid; gvid the_success the_fail the_size the_time Warnings: -Warning 1292 Incorrect datetime value: 'wrong-date-value' -Warning 1292 Incorrect datetime value: 'wrong-date-value' +Warning 1292 Truncated incorrect datetime value: 'wrong-date-value' +Warning 1292 Truncated incorrect datetime value: 'wrong-date-value' SELECT a.gvid, (SUM(CASE b.sampletid WHEN 140 THEN b.samplevalue ELSE 0 END)) as the_success,(SUM(CASE b.sampletid WHEN 141 THEN b.samplevalue ELSE 0 END)) as the_fail,(SUM(CASE b.sampletid WHEN 142 THEN b.samplevalue ELSE 0 END)) as the_size,(SUM(CASE b.sampletid WHEN 143 THEN b.samplevalue ELSE 0 END)) as the_time FROM t1 a, t2 b WHERE a.hmid = b.hmid AND a.volid = b.volid AND b.sampletime >= NULL AND b.sampletime < NULL AND b.sampletid IN (140, 141, 142, 143) GROUP BY a.gvid; gvid the_success the_fail the_size the_time DROP TABLE t1,t2; @@ -2786,7 +2786,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 index key1 key1 5 NULL 4 Using where; Using index explain select min(key1) from t1 where key1 >= 0.3762 and rand() + 0.5 >= 0.5; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range key1 key1 5 NULL 3 Using where; Using index +1 SIMPLE t1 index key1 key1 5 NULL 4 Using where; Using index select max(key1) from t1 where key1 <= 0.6158; max(key1) 0.6158 @@ -3408,7 +3408,7 @@ ERROR 42000: You have an error in your SQL syntax; check the manual that corresp CREATE TABLE t1 (sku int PRIMARY KEY, pr int); CREATE TABLE t2 (sku int PRIMARY KEY, sppr int, name varchar(255)); INSERT INTO t1 VALUES -(10, 10), (20, 10), (30, 20), (40, 30), (50, 10), (60, 10); +(10, 10), (20, 10), (30, 20), (40, 30), (50, 10), (60, 10), (70, 10); INSERT INTO t2 VALUES (10, 10, 'aaa'), (20, 10, 'bbb'), (30, 10, 'ccc'), (40, 20, 'ddd'), (50, 10, 'eee'), (60, 20, 'fff'), (70, 20, 'ggg'), (80, 30, 'hhh'); @@ -3422,7 +3422,7 @@ SELECT t2.sku, t2.sppr, t2.name, t1.sku, t1.pr FROM t2, t1 WHERE t2.sku=20 AND (t2.sku=t1.sku OR t2.sppr=t1.sku); id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t2 const PRIMARY PRIMARY 4 const 1 -1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL 2 Using index condition; Using where +1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL 2 Using index condition DROP TABLE t1,t2; SET SQL_MODE='NO_UNSIGNED_SUBTRACTION'; CREATE TABLE t1 (i TINYINT UNSIGNED NOT NULL); @@ -3453,6 +3453,7 @@ create table t2 (a int, b int, c int, e int, primary key(a,b,c)); insert into t2 select A.a, B.a, C.a, C.a from t1 A, t1 B, t1 C; analyze table t2; Table Op Msg_type Msg_text +test.t2 analyze status Engine-independent statistics collected test.t2 analyze status OK select 'In next EXPLAIN, B.rows must be exactly 10:' Z; Z @@ -3474,13 +3475,13 @@ INSERT INTO t2 VALUES EXPLAIN SELECT a, c, d, f FROM t1,t2 WHERE a=c AND b BETWEEN 4 AND 6; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range PRIMARY,b b 5 NULL 3 Using index condition -1 SIMPLE t2 ref c c 5 test.t1.a 2 +1 SIMPLE t2 ALL c NULL NULL NULL 18 Using where +1 SIMPLE t1 eq_ref|filter PRIMARY,b PRIMARY|b 4|5 test.t2.c 1 (30%) Using where; Using rowid filter EXPLAIN SELECT a, c, d, f FROM t1,t2 WHERE a=c AND b BETWEEN 4 AND 6 AND a > 0; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range PRIMARY,b b 5 NULL 3 Using index condition; Using where -1 SIMPLE t2 ref c c 5 test.t1.a 2 +1 SIMPLE t2 ALL c NULL NULL NULL 18 Using where +1 SIMPLE t1 eq_ref|filter PRIMARY,b PRIMARY|b 4|5 test.t2.c 1 (30%) Using where; Using rowid filter DROP TABLE t1, t2; create table t1 ( a int unsigned not null auto_increment primary key, @@ -3522,7 +3523,7 @@ INSERT INTO t2 VALUES EXPLAIN SELECT b FROM t1, t2 WHERE b=c AND a=1; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 const PRIMARY PRIMARY 4 const 1 -1 SIMPLE t2 ref idx idx 4 const 7 Using index +1 SIMPLE t2 ref idx idx 4 const 8 Using index EXPLAIN SELECT b FROM t1, t2 WHERE b=c AND a=4; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 const PRIMARY PRIMARY 4 const 1 @@ -3533,14 +3534,14 @@ INSERT INTO t1 VALUES (1,2), (2,NULL), (3,2); CREATE TABLE t2 (b int, c INT, INDEX idx1(b)); INSERT INTO t2 VALUES (2,1), (3,2); CREATE TABLE t3 (d int, e int, INDEX idx1(d)); -INSERT INTO t3 VALUES (2,10), (2,20), (1,30), (2,40), (2,50); +INSERT INTO t3 VALUES (2,10), (2,20), (1,30), (2,40), (2,50), (1,60), (3,70), (1,80), (3,90); EXPLAIN SELECT * FROM t1 LEFT JOIN t2 ON t2.b=t1.a INNER JOIN t3 ON t3.d=t1.id WHERE t1.id=2; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 const PRIMARY PRIMARY 4 const 1 1 SIMPLE t2 const idx1 NULL NULL NULL 1 -1 SIMPLE t3 ref idx1 idx1 5 const 3 +1 SIMPLE t3 ref idx1 idx1 5 const 4 SELECT * FROM t1 LEFT JOIN t2 ON t2.b=t1.a INNER JOIN t3 ON t3.d=t1.id WHERE t1.id=2; id a b c d e @@ -3569,7 +3570,7 @@ EXPLAIN SELECT t2.* FROM t1 JOIN t2 ON t2.fk=t1.pk WHERE t2.fk < 'c' AND t2.pk=t1.fk; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range PRIMARY PRIMARY 12 NULL 3 Using index condition; Using where +1 SIMPLE t1 range PRIMARY PRIMARY 12 NULL 2 Using index condition; Using where 1 SIMPLE t2 eq_ref PRIMARY PRIMARY 18 test.t1.fk 1 Using where EXPLAIN SELECT t2.* FROM t1 JOIN t2 ON t2.fk=t1.pk @@ -3616,7 +3617,7 @@ t3.a=t2.a AND t3.c IN ('bb','ee'); id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 const PRIMARY PRIMARY 4 const 1 1 SIMPLE t2 range si si 5 NULL 4 Using index condition; Using where -1 SIMPLE t3 eq_ref PRIMARY,ci PRIMARY 4 test.t2.a 1 Using where +1 SIMPLE t3 eq_ref|filter PRIMARY,ci PRIMARY|ci 4|5 test.t2.a 1 (30%) Using where; Using rowid filter EXPLAIN SELECT t3.a FROM t1,t2,t3 WHERE t1.id = 8 AND t2.i BETWEEN t1.b AND t1.e AND @@ -3624,7 +3625,7 @@ t3.a=t2.a AND t3.c IN ('bb','ee') ; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 const PRIMARY PRIMARY 4 const 1 1 SIMPLE t2 range si,ai si 5 NULL 4 Using index condition; Using where -1 SIMPLE t3 eq_ref PRIMARY,ci PRIMARY 4 test.t2.a 1 Using where +1 SIMPLE t3 eq_ref|filter PRIMARY,ci PRIMARY|ci 4|5 test.t2.a 1 (30%) Using where; Using rowid filter EXPLAIN SELECT t3.a FROM t1,t2 FORCE INDEX (si),t3 WHERE t1.id = 8 AND (t2.i=t1.b OR t2.i=t1.e) AND t3.a=t2.a AND @@ -3698,6 +3699,10 @@ INSERT INTO t1 SELECT * FROM t1 WHERE ID1_with_null IS NULL; INSERT INTO t1 SELECT * FROM t1 WHERE ID2_with_null IS NULL; INSERT INTO t1 SELECT * FROM t1 WHERE ID1_with_null IS NULL; INSERT INTO t1 SELECT * FROM t1 WHERE ID2_with_null IS NULL; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status Engine-independent statistics collected +test.t1 analyze status OK SELECT COUNT(*) FROM t1 WHERE ID1_with_null IS NULL AND ID2_with_null=3; COUNT(*) 24 @@ -3713,45 +3718,47 @@ COUNT(*) EXPLAIN SELECT * FROM t1 WHERE ID_better=1 AND ID1_with_null IS NULL AND ID2_with_null=3 ; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ref idx1,idx2 idx2 4 const 1 Using where +1 SIMPLE t1 ref idx1,idx2 idx2 4 const 2 Using where EXPLAIN SELECT * FROM t1 WHERE ID_better=1 AND ID1_with_null=3 AND ID2_with_null=3 IS NULL ; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ref idx1,idx2 idx2 4 const 1 Using where +1 SIMPLE t1 ref idx1,idx2 idx2 4 const 2 Using where EXPLAIN SELECT * FROM t1 WHERE ID_better=1 AND ID1_with_null IS NULL AND ID2_with_null IS NULL; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ref idx1,idx2 idx2 4 const 1 Using where +1 SIMPLE t1 ref idx1,idx2 idx2 4 const 2 Using where DROP INDEX idx1 ON t1; CREATE UNIQUE INDEX idx1 ON t1(ID1_with_null,ID2_with_null); EXPLAIN SELECT * FROM t1 WHERE ID_better=1 AND ID1_with_null IS NULL AND ID2_with_null=3 ; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ref idx1,idx2 idx2 4 const 1 Using where +1 SIMPLE t1 ref idx1,idx2 idx2 4 const 2 Using where EXPLAIN SELECT * FROM t1 WHERE ID_better=1 AND ID1_with_null=3 AND ID2_with_null IS NULL ; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ref idx1,idx2 idx2 4 const 1 Using where +1 SIMPLE t1 ref idx1,idx2 idx2 4 const 2 Using where EXPLAIN SELECT * FROM t1 WHERE ID_better=1 AND ID1_with_null IS NULL AND ID2_with_null IS NULL; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ref idx1,idx2 idx2 4 const 1 Using where +1 SIMPLE t1 ref idx1,idx2 idx2 4 const 2 Using where EXPLAIN SELECT * FROM t1 WHERE ID_better=1 AND ID1_with_null IS NULL AND (ID2_with_null=1 OR ID2_with_null=2); id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ref idx1,idx2 idx2 4 const 1 Using where +1 SIMPLE t1 ref|filter idx1,idx2 idx1|idx2 5|4 const 2 (1%) Using index condition; Using where; Using rowid filter DROP TABLE t1; CREATE TABLE t1 (a INT, ts TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, KEY ts(ts)); INSERT INTO t1 VALUES (30,"2006-01-03 23:00:00"), (31,"2006-01-03 23:00:00"); ANALYZE TABLE t1; Table Op Msg_type Msg_text +test.t1 analyze status Engine-independent statistics collected test.t1 analyze status OK CREATE TABLE t2 (a INT, dt1 DATETIME, dt2 DATETIME, PRIMARY KEY (a)); INSERT INTO t2 VALUES (30, "2006-01-01 00:00:00", "2999-12-31 00:00:00"); INSERT INTO t2 SELECT a+1,dt1,dt2 FROM t2; ANALYZE TABLE t2; Table Op Msg_type Msg_text +test.t2 analyze status Engine-independent statistics collected test.t2 analyze status OK EXPLAIN SELECT * FROM t1 LEFT JOIN t2 ON (t1.a=t2.a) WHERE t1.a=30 @@ -3759,7 +3766,7 @@ AND t1.ts BETWEEN t2.dt1 AND t2.dt2 AND t1.ts BETWEEN "2006-01-01" AND "2006-12-31"; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t2 const PRIMARY PRIMARY 4 const 1 -1 SIMPLE t1 range ts ts 4 NULL 1 Using index condition; Using where +1 SIMPLE t1 range ts ts 4 NULL 2 Using index condition; Using where SELECT * FROM t1 LEFT JOIN t2 ON (t1.a=t2.a) WHERE t1.a=30 AND t1.ts BETWEEN t2.dt1 AND t2.dt2 AND t1.ts BETWEEN "2006-01-01" AND "2006-12-31"; @@ -3801,6 +3808,7 @@ INSERT INTO t1 VALUES ('ccc'), ('bb'), ('cc '), ('aa '), ('aa'); INSERT INTO t2 VALUES ('bb',1), ('aa',2), ('cc ',3); INSERT INTO t2 VALUES (concat('cc ', 0x06), 4); INSERT INTO t2 VALUES ('cc',5), ('bb ',6), ('cc ',7); +INSERT INTO t2 VALUES ('bb ',8), ('aa',9), ('aa',10), ('bb',11); SELECT * FROM t2; name n bb 1 @@ -3810,27 +3818,39 @@ cc 4 cc 5 bb 6 cc 7 +bb 8 +aa 9 +aa 10 +bb 11 SELECT * FROM t2 ORDER BY name; name n aa 2 +aa 10 +aa 9 bb 1 +bb 8 bb 6 +bb 11 cc 4 -cc 3 -cc 5 cc 7 +cc 5 +cc 3 SELECT name, LENGTH(name), n FROM t2 ORDER BY name; name LENGTH(name) n aa 2 2 +aa 2 10 +aa 2 9 bb 2 1 +bb 3 8 bb 3 6 +bb 2 11 cc 4 4 -cc 5 3 -cc 2 5 cc 3 7 +cc 2 5 +cc 5 3 EXPLAIN SELECT name, LENGTH(name), n FROM t2 WHERE name='cc '; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 ref name name 6 const 3 Using where +1 SIMPLE t2 ref name name 6 const 4 Using where SELECT name, LENGTH(name), n FROM t2 WHERE name='cc '; name LENGTH(name) n cc 5 3 @@ -3838,7 +3858,7 @@ cc 2 5 cc 3 7 EXPLAIN SELECT name , LENGTH(name), n FROM t2 WHERE name LIKE 'cc%'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 range name name 6 NULL 3 Using where +1 SIMPLE t2 range name name 6 NULL 4 Using where SELECT name , LENGTH(name), n FROM t2 WHERE name LIKE 'cc%'; name LENGTH(name) n cc 5 3 @@ -3847,7 +3867,7 @@ cc 2 5 cc 3 7 EXPLAIN SELECT name , LENGTH(name), n FROM t2 WHERE name LIKE 'cc%' ORDER BY name; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 range name name 6 NULL 3 Using where; Using filesort +1 SIMPLE t2 range name name 6 NULL 4 Using where; Using filesort SELECT name , LENGTH(name), n FROM t2 WHERE name LIKE 'cc%' ORDER BY name; name LENGTH(name) n cc 4 4 @@ -3863,11 +3883,17 @@ name name n ccc NULL NULL bb bb 1 bb bb 6 +bb bb 8 +bb bb 11 cc cc 3 cc cc 5 cc cc 7 aa aa 2 +aa aa 9 +aa aa 10 aa aa 2 +aa aa 9 +aa aa 10 DROP TABLE t1,t2; CREATE TABLE t1 (name text); CREATE TABLE t2 (name text, n int, KEY (name(3))); @@ -3875,6 +3901,7 @@ INSERT INTO t1 VALUES ('ccc'), ('bb'), ('cc '), ('aa '), ('aa'); INSERT INTO t2 VALUES ('bb',1), ('aa',2), ('cc ',3); INSERT INTO t2 VALUES (concat('cc ', 0x06), 4); INSERT INTO t2 VALUES ('cc',5), ('bb ',6), ('cc ',7); +INSERT INTO t2 VALUES ('bb ',8), ('aa',9), ('aa',10), ('bb',11); SELECT * FROM t2; name n bb 1 @@ -3884,11 +3911,19 @@ cc 4 cc 5 bb 6 cc 7 +bb 8 +aa 9 +aa 10 +bb 11 SELECT * FROM t2 ORDER BY name; name n aa 2 +aa 9 +aa 10 bb 1 bb 6 +bb 8 +bb 11 cc 4 cc 3 cc 5 @@ -3896,15 +3931,19 @@ cc 7 SELECT name, LENGTH(name), n FROM t2 ORDER BY name; name LENGTH(name) n aa 2 2 +aa 2 9 +aa 2 10 bb 2 1 bb 3 6 +bb 3 8 +bb 2 11 cc 4 4 cc 5 3 cc 2 5 cc 3 7 EXPLAIN SELECT name, LENGTH(name), n FROM t2 WHERE name='cc '; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 ref name name 6 const 3 Using where +1 SIMPLE t2 ref name name 6 const 4 Using where SELECT name, LENGTH(name), n FROM t2 WHERE name='cc '; name LENGTH(name) n cc 5 3 @@ -3912,7 +3951,7 @@ cc 2 5 cc 3 7 EXPLAIN SELECT name , LENGTH(name), n FROM t2 WHERE name LIKE 'cc%'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 range name name 6 NULL 3 Using where +1 SIMPLE t2 range name name 6 NULL 4 Using where SELECT name , LENGTH(name), n FROM t2 WHERE name LIKE 'cc%'; name LENGTH(name) n cc 5 3 @@ -3921,7 +3960,7 @@ cc 2 5 cc 3 7 EXPLAIN SELECT name , LENGTH(name), n FROM t2 WHERE name LIKE 'cc%' ORDER BY name; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 range name name 6 NULL 3 Using where; Using filesort +1 SIMPLE t2 range name name 6 NULL 4 Using where; Using filesort SELECT name , LENGTH(name), n FROM t2 WHERE name LIKE 'cc%' ORDER BY name; name LENGTH(name) n cc 4 4 @@ -3937,11 +3976,17 @@ name name n ccc NULL NULL bb bb 1 bb bb 6 +bb bb 8 +bb bb 11 cc cc 3 cc cc 5 cc cc 7 aa aa 2 +aa aa 9 +aa aa 10 aa aa 2 +aa aa 9 +aa aa 10 DROP TABLE t1,t2; CREATE TABLE t1 ( access_id int NOT NULL default '0', @@ -4111,7 +4156,7 @@ select str_to_date('2007-10-09','%Y-%m-%d') <= '2007/10/2000:00:00 GMT-6'; str_to_date('2007-10-09','%Y-%m-%d') <= '2007/10/2000:00:00 GMT-6' 0 Warnings: -Warning 1292 Incorrect datetime value: '2007/10/2000:00:00 GMT-6' +Warning 1292 Truncated incorrect datetime value: '2007/10/2000:00:00 GMT-6' select str_to_date('2007-10-01','%Y-%m-%d') = '2007-10-1 00:00:00 GMT-6'; str_to_date('2007-10-01','%Y-%m-%d') = '2007-10-1 00:00:00 GMT-6' 1 @@ -4198,7 +4243,7 @@ select str_to_date('2007-10-00','%Y-%m-%d') between '' and '2007/10/20'; str_to_date('2007-10-00','%Y-%m-%d') between '' and '2007/10/20' 1 Warnings: -Warning 1292 Incorrect datetime value: '' +Warning 1292 Truncated incorrect datetime value: '' select str_to_date('','%Y-%m-%d') between '2007/10/01' and '2007/10/20'; str_to_date('','%Y-%m-%d') between '2007/10/01' and '2007/10/20' 0 @@ -4212,22 +4257,22 @@ select str_to_date('2007-10-00 12:34','%Y-%m-%d %H:%i') = ''; str_to_date('2007-10-00 12:34','%Y-%m-%d %H:%i') = '' 0 Warnings: -Warning 1292 Incorrect datetime value: '' +Warning 1292 Truncated incorrect datetime value: '' select str_to_date('1','%Y-%m-%d') = '1'; str_to_date('1','%Y-%m-%d') = '1' 0 Warnings: -Warning 1292 Incorrect datetime value: '1' +Warning 1292 Truncated incorrect datetime value: '1' select str_to_date('1','%Y-%m-%d') = '1'; str_to_date('1','%Y-%m-%d') = '1' 0 Warnings: -Warning 1292 Incorrect datetime value: '1' +Warning 1292 Truncated incorrect datetime value: '1' select str_to_date('','%Y-%m-%d') = ''; str_to_date('','%Y-%m-%d') = '' 1 Warnings: -Warning 1292 Incorrect datetime value: '' +Warning 1292 Truncated incorrect datetime value: '' select str_to_date('2000-01-01','%Y-%m-%d') between '1000-01-01' and '2001-01-01'; str_to_date('2000-01-01','%Y-%m-%d') between '1000-01-01' and '2001-01-01' 1 @@ -4645,6 +4690,8 @@ WHERE int_key IN (SELECT 1 FROM t1) HAVING date_nokey = '10:41:7' ORDER BY date_key; date_nokey +Warnings: +Warning 1292 Truncated incorrect datetime value: '10:41:7' DROP TABLE t1,t2; CREATE TABLE t1 (a INT NOT NULL, b INT); INSERT INTO t1 VALUES (1, 1); @@ -5211,7 +5258,7 @@ INSERT INTO `CC` VALUES EXPLAIN SELECT `varchar_nokey` G1 FROM CC WHERE `int_nokey` AND `int_key` <= 4 HAVING G1 ORDER BY `varchar_key` LIMIT 6 ; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE CC range int_key int_key 4 NULL 10 Using index condition; Using where; Using filesort +1 SIMPLE CC range int_key int_key 4 NULL 9 Using index condition; Using where; Using filesort SELECT `varchar_nokey` G1 FROM CC WHERE `int_nokey` AND `int_key` <= 4 HAVING G1 ORDER BY `varchar_key` LIMIT 6 ; G1 @@ -5282,30 +5329,30 @@ SELECT * FROM t1 HAVING f1 = 'zz'; f1 0000-00-00 Warnings: -Warning 1292 Incorrect datetime value: 'zz' +Warning 1292 Truncated incorrect datetime value: 'zz' SELECT * FROM t1 HAVING f1 <= 'aa' ; f1 0000-00-00 Warnings: -Warning 1292 Incorrect datetime value: 'aa' +Warning 1292 Truncated incorrect datetime value: 'aa' SELECT * FROM t1 HAVING f1 = 'zz' AND f1 <= 'aa' ; f1 0000-00-00 Warnings: -Warning 1292 Incorrect datetime value: 'zz' -Warning 1292 Incorrect datetime value: 'aa' +Warning 1292 Truncated incorrect datetime value: 'zz' +Warning 1292 Truncated incorrect datetime value: 'aa' SELECT * FROM t1 WHERE f1 = 'zz' AND f1 <= 'aa' ; f1 0000-00-00 Warnings: -Warning 1292 Incorrect datetime value: 'zz' -Warning 1292 Incorrect datetime value: 'aa' +Warning 1292 Truncated incorrect datetime value: 'zz' +Warning 1292 Truncated incorrect datetime value: 'aa' SELECT * FROM v1 HAVING f1 = 'zz' AND f1 <= 'aa' ; f1 0000-00-00 Warnings: -Warning 1292 Incorrect datetime value: 'zz' -Warning 1292 Incorrect datetime value: 'aa' +Warning 1292 Truncated incorrect datetime value: 'zz' +Warning 1292 Truncated incorrect datetime value: 'aa' DROP TABLE t1; DROP VIEW v1; # |