Loading mysql-test/r/bigint.result +10 −0 Original line number Diff line number Diff line Loading @@ -352,3 +352,13 @@ select c1 mod 50 as result from t1; result 6 drop table t1; select cast(19999999999999999999 as signed); cast(19999999999999999999 as signed) 9223372036854775807 Warnings: Error 1292 Truncated incorrect DECIMAL value: '' select cast(-19999999999999999999 as signed); cast(-19999999999999999999 as signed) -9223372036854775808 Warnings: Error 1292 Truncated incorrect DECIMAL value: '' mysql-test/r/func_gconcat.result +26 −0 Original line number Diff line number Diff line Loading @@ -737,4 +737,30 @@ SELECT GROUP_CONCAT(DISTINCT UCASE(b)) FROM t1; GROUP_CONCAT(DISTINCT UCASE(b)) ONE.1,TWO.2,ONE.3 DROP TABLE t1; CREATE TABLE t1( a VARCHAR( 10 ), b INT ); INSERT INTO t1 VALUES ( repeat( 'a', 10 ), 1), ( repeat( 'b', 10 ), 2); SET group_concat_max_len = 20; SELECT GROUP_CONCAT( a ) FROM t1; GROUP_CONCAT( a ) aaaaaaaaaa,bbbbbbbbb Warnings: Warning 1260 1 line(s) were cut by GROUP_CONCAT() SELECT GROUP_CONCAT( DISTINCT a ) FROM t1; GROUP_CONCAT( DISTINCT a ) aaaaaaaaaa,bbbbbbbbb Warnings: Warning 1260 1 line(s) were cut by GROUP_CONCAT() SELECT GROUP_CONCAT( a ORDER BY b ) FROM t1; GROUP_CONCAT( a ORDER BY b ) aaaaaaaaaa,bbbbbbbbb Warnings: Warning 1260 1 line(s) were cut by GROUP_CONCAT() SELECT GROUP_CONCAT( DISTINCT a ORDER BY b ) FROM t1; GROUP_CONCAT( DISTINCT a ORDER BY b ) aaaaaaaaaa,bbbbbbbbb Warnings: Warning 1260 1 line(s) were cut by GROUP_CONCAT() SET group_concat_max_len = DEFAULT; DROP TABLE t1; End of 5.0 tests mysql-test/r/func_group.result +47 −0 Original line number Diff line number Diff line Loading @@ -1330,4 +1330,51 @@ SELECT a,AVG(DISTINCT b) AS average FROM t1 GROUP BY a HAVING average > 50; a average 1 32768.5000 DROP TABLE t1; CREATE TABLE t1 ( a INT, b INT, KEY(a) ); INSERT INTO t1 VALUES (NULL, 1), (NULL, 2); EXPLAIN SELECT MIN(a), MIN(b) FROM t1; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 SELECT MIN(a), MIN(b) FROM t1; MIN(a) MIN(b) NULL 1 CREATE TABLE t2( a INT, b INT, c INT, KEY(a, b) ); INSERT INTO t2 ( a, b, c ) VALUES ( 1, NULL, 2 ), ( 1, 3, 4 ), ( 1, 4, 4 ); EXPLAIN SELECT MIN(b), MIN(c) FROM t2 WHERE a = 1; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t2 ref a a 5 const 2 Using where SELECT MIN(b), MIN(c) FROM t2 WHERE a = 1; MIN(b) MIN(c) 3 2 CREATE TABLE t3 (a INT, b INT, c int, KEY(a, b)); INSERT INTO t3 VALUES (1, NULL, 1), (2, NULL, 2), (2, NULL, 2), (3, NULL, 3); EXPLAIN SELECT MIN(a), MIN(b) FROM t3 where a = 2; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away SELECT MIN(a), MIN(b) FROM t3 where a = 2; MIN(a) MIN(b) 2 NULL CREATE TABLE t4 (a INT, b INT, c int, KEY(a, b)); INSERT INTO t4 VALUES (1, 1, 1), (2, NULL, 2), (2, NULL, 2), (3, 1, 3); EXPLAIN SELECT MIN(a), MIN(b) FROM t4 where a = 2; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away SELECT MIN(a), MIN(b) FROM t4 where a = 2; MIN(a) MIN(b) 2 NULL SELECT MIN(b), min(c) FROM t4 where a = 2; MIN(b) min(c) NULL 2 CREATE TABLE t5( a INT, b INT, KEY( a, b) ); INSERT INTO t5 VALUES( 1, 1 ), ( 1, 2 ); EXPLAIN SELECT MIN(a), MIN(b) FROM t5 WHERE a = 1; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away SELECT MIN(a), MIN(b) FROM t5 WHERE a = 1; MIN(a) MIN(b) 1 1 SELECT MIN(a), MIN(b) FROM t5 WHERE a = 1 and b > 1; MIN(a) MIN(b) 1 2 DROP TABLE t1, t2, t3, t4, t5; End of 5.0 tests mysql-test/r/innodb_mysql.result +21 −0 Original line number Diff line number Diff line Loading @@ -144,6 +144,27 @@ SELECT * FROM t1; c1 cnt 1a 2 DROP TABLE t1; CREATE TABLE t1 ( a1 decimal(10,0) DEFAULT NULL, a2 blob, a3 time DEFAULT NULL, a4 blob, a5 char(175) DEFAULT NULL, a6 timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', a7 tinyblob, INDEX idx (a6,a7(239),a5) ) ENGINE=InnoDB; EXPLAIN SELECT a4 FROM t1 WHERE a6=NULL AND a4='UNcT5pIde4I6c2SheTo4gt92OV1jgJCVkXmzyf325R1DwLURkbYHwhydANIZMbKTgdcR5xS'; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables EXPLAIN SELECT t1.a4 FROM t1, t1 t WHERE t.a6=t.a6 AND t1.a6=NULL AND t1.a4='UNcT5pIde4I6c2SheTo4gt92OV1jgJCVkXmzyf325R1DwLURkbYHwhydANIZMbKTgdcR5xS'; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables DROP TABLE t1; End of 4.1 tests create table t1m (a int) engine=myisam; create table t1i (a int) engine=innodb; Loading mysql-test/r/ps.result +22 −0 Original line number Diff line number Diff line Loading @@ -1114,6 +1114,28 @@ execute stmt; show create table t1; drop table t1; deallocate prepare stmt; CREATE TABLE t1(a int); INSERT INTO t1 VALUES (2), (3), (1); PREPARE st1 FROM '(SELECT a FROM t1) UNION (SELECT a+10 FROM t1) ORDER BY RAND()*0+a'; EXECUTE st1; a 1 2 3 11 12 13 EXECUTE st1; a 1 2 3 11 12 13 DEALLOCATE PREPARE st1; DROP TABLE t1; End of 4.1 tests. create table t1 (a varchar(20)); insert into t1 values ('foo'); Loading Loading
mysql-test/r/bigint.result +10 −0 Original line number Diff line number Diff line Loading @@ -352,3 +352,13 @@ select c1 mod 50 as result from t1; result 6 drop table t1; select cast(19999999999999999999 as signed); cast(19999999999999999999 as signed) 9223372036854775807 Warnings: Error 1292 Truncated incorrect DECIMAL value: '' select cast(-19999999999999999999 as signed); cast(-19999999999999999999 as signed) -9223372036854775808 Warnings: Error 1292 Truncated incorrect DECIMAL value: ''
mysql-test/r/func_gconcat.result +26 −0 Original line number Diff line number Diff line Loading @@ -737,4 +737,30 @@ SELECT GROUP_CONCAT(DISTINCT UCASE(b)) FROM t1; GROUP_CONCAT(DISTINCT UCASE(b)) ONE.1,TWO.2,ONE.3 DROP TABLE t1; CREATE TABLE t1( a VARCHAR( 10 ), b INT ); INSERT INTO t1 VALUES ( repeat( 'a', 10 ), 1), ( repeat( 'b', 10 ), 2); SET group_concat_max_len = 20; SELECT GROUP_CONCAT( a ) FROM t1; GROUP_CONCAT( a ) aaaaaaaaaa,bbbbbbbbb Warnings: Warning 1260 1 line(s) were cut by GROUP_CONCAT() SELECT GROUP_CONCAT( DISTINCT a ) FROM t1; GROUP_CONCAT( DISTINCT a ) aaaaaaaaaa,bbbbbbbbb Warnings: Warning 1260 1 line(s) were cut by GROUP_CONCAT() SELECT GROUP_CONCAT( a ORDER BY b ) FROM t1; GROUP_CONCAT( a ORDER BY b ) aaaaaaaaaa,bbbbbbbbb Warnings: Warning 1260 1 line(s) were cut by GROUP_CONCAT() SELECT GROUP_CONCAT( DISTINCT a ORDER BY b ) FROM t1; GROUP_CONCAT( DISTINCT a ORDER BY b ) aaaaaaaaaa,bbbbbbbbb Warnings: Warning 1260 1 line(s) were cut by GROUP_CONCAT() SET group_concat_max_len = DEFAULT; DROP TABLE t1; End of 5.0 tests
mysql-test/r/func_group.result +47 −0 Original line number Diff line number Diff line Loading @@ -1330,4 +1330,51 @@ SELECT a,AVG(DISTINCT b) AS average FROM t1 GROUP BY a HAVING average > 50; a average 1 32768.5000 DROP TABLE t1; CREATE TABLE t1 ( a INT, b INT, KEY(a) ); INSERT INTO t1 VALUES (NULL, 1), (NULL, 2); EXPLAIN SELECT MIN(a), MIN(b) FROM t1; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 SELECT MIN(a), MIN(b) FROM t1; MIN(a) MIN(b) NULL 1 CREATE TABLE t2( a INT, b INT, c INT, KEY(a, b) ); INSERT INTO t2 ( a, b, c ) VALUES ( 1, NULL, 2 ), ( 1, 3, 4 ), ( 1, 4, 4 ); EXPLAIN SELECT MIN(b), MIN(c) FROM t2 WHERE a = 1; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t2 ref a a 5 const 2 Using where SELECT MIN(b), MIN(c) FROM t2 WHERE a = 1; MIN(b) MIN(c) 3 2 CREATE TABLE t3 (a INT, b INT, c int, KEY(a, b)); INSERT INTO t3 VALUES (1, NULL, 1), (2, NULL, 2), (2, NULL, 2), (3, NULL, 3); EXPLAIN SELECT MIN(a), MIN(b) FROM t3 where a = 2; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away SELECT MIN(a), MIN(b) FROM t3 where a = 2; MIN(a) MIN(b) 2 NULL CREATE TABLE t4 (a INT, b INT, c int, KEY(a, b)); INSERT INTO t4 VALUES (1, 1, 1), (2, NULL, 2), (2, NULL, 2), (3, 1, 3); EXPLAIN SELECT MIN(a), MIN(b) FROM t4 where a = 2; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away SELECT MIN(a), MIN(b) FROM t4 where a = 2; MIN(a) MIN(b) 2 NULL SELECT MIN(b), min(c) FROM t4 where a = 2; MIN(b) min(c) NULL 2 CREATE TABLE t5( a INT, b INT, KEY( a, b) ); INSERT INTO t5 VALUES( 1, 1 ), ( 1, 2 ); EXPLAIN SELECT MIN(a), MIN(b) FROM t5 WHERE a = 1; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away SELECT MIN(a), MIN(b) FROM t5 WHERE a = 1; MIN(a) MIN(b) 1 1 SELECT MIN(a), MIN(b) FROM t5 WHERE a = 1 and b > 1; MIN(a) MIN(b) 1 2 DROP TABLE t1, t2, t3, t4, t5; End of 5.0 tests
mysql-test/r/innodb_mysql.result +21 −0 Original line number Diff line number Diff line Loading @@ -144,6 +144,27 @@ SELECT * FROM t1; c1 cnt 1a 2 DROP TABLE t1; CREATE TABLE t1 ( a1 decimal(10,0) DEFAULT NULL, a2 blob, a3 time DEFAULT NULL, a4 blob, a5 char(175) DEFAULT NULL, a6 timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', a7 tinyblob, INDEX idx (a6,a7(239),a5) ) ENGINE=InnoDB; EXPLAIN SELECT a4 FROM t1 WHERE a6=NULL AND a4='UNcT5pIde4I6c2SheTo4gt92OV1jgJCVkXmzyf325R1DwLURkbYHwhydANIZMbKTgdcR5xS'; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables EXPLAIN SELECT t1.a4 FROM t1, t1 t WHERE t.a6=t.a6 AND t1.a6=NULL AND t1.a4='UNcT5pIde4I6c2SheTo4gt92OV1jgJCVkXmzyf325R1DwLURkbYHwhydANIZMbKTgdcR5xS'; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables DROP TABLE t1; End of 4.1 tests create table t1m (a int) engine=myisam; create table t1i (a int) engine=innodb; Loading
mysql-test/r/ps.result +22 −0 Original line number Diff line number Diff line Loading @@ -1114,6 +1114,28 @@ execute stmt; show create table t1; drop table t1; deallocate prepare stmt; CREATE TABLE t1(a int); INSERT INTO t1 VALUES (2), (3), (1); PREPARE st1 FROM '(SELECT a FROM t1) UNION (SELECT a+10 FROM t1) ORDER BY RAND()*0+a'; EXECUTE st1; a 1 2 3 11 12 13 EXECUTE st1; a 1 2 3 11 12 13 DEALLOCATE PREPARE st1; DROP TABLE t1; End of 4.1 tests. create table t1 (a varchar(20)); insert into t1 values ('foo'); Loading