Loading mysql-test/r/innodb_mysql.result +97 −0 Original line number Diff line number Diff line Loading @@ -1114,4 +1114,101 @@ c b 3 1 3 2 DROP TABLE t1; CREATE TABLE t1 (a INT, b INT, PRIMARY KEY (a), INDEX b (b)) ENGINE=InnoDB; INSERT INTO t1(a,b) VALUES (1,1), (2,2), (3,2); EXPLAIN SELECT * FROM t1 WHERE b=2 ORDER BY a ASC; id 1 select_type SIMPLE table t1 type ref possible_keys b key b key_len 5 ref const rows 1 Extra Using where; Using index SELECT * FROM t1 WHERE b=2 ORDER BY a ASC; a b 2 2 3 2 EXPLAIN SELECT * FROM t1 WHERE b=2 ORDER BY a DESC; id 1 select_type SIMPLE table t1 type ref possible_keys b key b key_len 5 ref const rows 1 Extra Using where; Using index SELECT * FROM t1 WHERE b=2 ORDER BY a DESC; a b 3 2 2 2 EXPLAIN SELECT * FROM t1 ORDER BY b ASC, a ASC; id 1 select_type SIMPLE table t1 type index possible_keys NULL key b key_len 5 ref NULL rows 3 Extra Using index SELECT * FROM t1 ORDER BY b ASC, a ASC; a b 1 1 2 2 3 2 EXPLAIN SELECT * FROM t1 ORDER BY b DESC, a DESC; id 1 select_type SIMPLE table t1 type index possible_keys NULL key b key_len 5 ref NULL rows 3 Extra Using index SELECT * FROM t1 ORDER BY b DESC, a DESC; a b 3 2 2 2 1 1 EXPLAIN SELECT * FROM t1 ORDER BY b ASC, a DESC; id 1 select_type SIMPLE table t1 type index possible_keys NULL key b key_len 5 ref NULL rows 3 Extra Using index; Using filesort SELECT * FROM t1 ORDER BY b ASC, a DESC; a b 1 1 3 2 2 2 EXPLAIN SELECT * FROM t1 ORDER BY b DESC, a ASC; id 1 select_type SIMPLE table t1 type index possible_keys NULL key b key_len 5 ref NULL rows 3 Extra Using index; Using filesort SELECT * FROM t1 ORDER BY b DESC, a ASC; a b 2 2 3 2 1 1 DROP TABLE t1; End of 5.0 tests mysql-test/r/select.result +34 −0 Original line number Diff line number Diff line Loading @@ -4062,4 +4062,38 @@ SHOW WARNINGS; Level Code Message Note 1003 select '0' AS `c1` from `test`.`t1` `join_0` join `test`.`t1` `join_1` join `test`.`t1` `join_2` join `test`.`t1` `join_3` join `test`.`t1` `join_4` join `test`.`t1` `join_5` join `test`.`t1` `join_6` join `test`.`t1` `join_7` where 0 group by '0','0','0','0','0' DROP TABLE t1; SELECT 1 AS ` `; 1 Warnings: Warning 1474 Name ' ' has become '' SELECT 1 AS ` `; 1 Warnings: Warning 1474 Name ' ' has become '' SELECT 1 AS ` x`; x 1 Warnings: Warning 1466 Leading spaces are removed from name ' x' CREATE VIEW v1 AS SELECT 1 AS ` `; Warnings: Warning 1474 Name ' ' has become '' SELECT `` FROM v1; 1 CREATE VIEW v2 AS SELECT 1 AS ` `; Warnings: Warning 1474 Name ' ' has become '' SELECT `` FROM v2; 1 CREATE VIEW v3 AS SELECT 1 AS ` x`; Warnings: Warning 1466 Leading spaces are removed from name ' x' SELECT `x` FROM v3; x 1 DROP VIEW v1, v2, v3; End of 5.0 tests mysql-test/r/type_bit.result +15 −0 Original line number Diff line number Diff line Loading @@ -657,4 +657,19 @@ b # # DROP TABLE t1; CREATE TABLE t1 (a int, b bit(2)); INSERT INTO t1 VALUES (3, 2), (2, 3), (2, 0), (3, 2), (3, 1); SELECT COUNT(DISTINCT b) FROM t1 GROUP BY a; COUNT(DISTINCT b) 2 2 DROP TABLE t1; create table t2 (a int, b bit(2), c char(10)); INSERT INTO t2 VALUES (3, 2, 'two'), (2, 3, 'three'), (2, 0, 'zero'), (3, 2, 'two'), (3, 1, 'one'); SELECT COUNT(DISTINCT b,c) FROM t2 GROUP BY a; COUNT(DISTINCT b,c) 2 2 DROP TABLE t2; End of 5.0 tests mysql-test/t/innodb_mysql.test +23 −0 Original line number Diff line number Diff line Loading @@ -937,4 +937,27 @@ SELECT c,b FROM t1 GROUP BY c,b; DROP TABLE t1; # # Bug #31001: ORDER BY DESC in InnoDB not working # CREATE TABLE t1 (a INT, b INT, PRIMARY KEY (a), INDEX b (b)) ENGINE=InnoDB; INSERT INTO t1(a,b) VALUES (1,1), (2,2), (3,2); #The two queries below should produce different results, but they don't. query_vertical EXPLAIN SELECT * FROM t1 WHERE b=2 ORDER BY a ASC; SELECT * FROM t1 WHERE b=2 ORDER BY a ASC; query_vertical EXPLAIN SELECT * FROM t1 WHERE b=2 ORDER BY a DESC; SELECT * FROM t1 WHERE b=2 ORDER BY a DESC; query_vertical EXPLAIN SELECT * FROM t1 ORDER BY b ASC, a ASC; SELECT * FROM t1 ORDER BY b ASC, a ASC; query_vertical EXPLAIN SELECT * FROM t1 ORDER BY b DESC, a DESC; SELECT * FROM t1 ORDER BY b DESC, a DESC; query_vertical EXPLAIN SELECT * FROM t1 ORDER BY b ASC, a DESC; SELECT * FROM t1 ORDER BY b ASC, a DESC; query_vertical EXPLAIN SELECT * FROM t1 ORDER BY b DESC, a ASC; SELECT * FROM t1 ORDER BY b DESC, a ASC; DROP TABLE t1; --echo End of 5.0 tests mysql-test/t/select.test +24 −0 Original line number Diff line number Diff line Loading @@ -3460,4 +3460,28 @@ SHOW WARNINGS; DROP TABLE t1; # # Bug #27695: Misleading warning when declaring all space column names and # truncation of one-space column names to zero length names. # --disable_ps_protocol SELECT 1 AS ` `; SELECT 1 AS ` `; SELECT 1 AS ` x`; CREATE VIEW v1 AS SELECT 1 AS ` `; SELECT `` FROM v1; CREATE VIEW v2 AS SELECT 1 AS ` `; SELECT `` FROM v2; CREATE VIEW v3 AS SELECT 1 AS ` x`; SELECT `x` FROM v3; DROP VIEW v1, v2, v3; --enable_ps_protocol --echo End of 5.0 tests Loading
mysql-test/r/innodb_mysql.result +97 −0 Original line number Diff line number Diff line Loading @@ -1114,4 +1114,101 @@ c b 3 1 3 2 DROP TABLE t1; CREATE TABLE t1 (a INT, b INT, PRIMARY KEY (a), INDEX b (b)) ENGINE=InnoDB; INSERT INTO t1(a,b) VALUES (1,1), (2,2), (3,2); EXPLAIN SELECT * FROM t1 WHERE b=2 ORDER BY a ASC; id 1 select_type SIMPLE table t1 type ref possible_keys b key b key_len 5 ref const rows 1 Extra Using where; Using index SELECT * FROM t1 WHERE b=2 ORDER BY a ASC; a b 2 2 3 2 EXPLAIN SELECT * FROM t1 WHERE b=2 ORDER BY a DESC; id 1 select_type SIMPLE table t1 type ref possible_keys b key b key_len 5 ref const rows 1 Extra Using where; Using index SELECT * FROM t1 WHERE b=2 ORDER BY a DESC; a b 3 2 2 2 EXPLAIN SELECT * FROM t1 ORDER BY b ASC, a ASC; id 1 select_type SIMPLE table t1 type index possible_keys NULL key b key_len 5 ref NULL rows 3 Extra Using index SELECT * FROM t1 ORDER BY b ASC, a ASC; a b 1 1 2 2 3 2 EXPLAIN SELECT * FROM t1 ORDER BY b DESC, a DESC; id 1 select_type SIMPLE table t1 type index possible_keys NULL key b key_len 5 ref NULL rows 3 Extra Using index SELECT * FROM t1 ORDER BY b DESC, a DESC; a b 3 2 2 2 1 1 EXPLAIN SELECT * FROM t1 ORDER BY b ASC, a DESC; id 1 select_type SIMPLE table t1 type index possible_keys NULL key b key_len 5 ref NULL rows 3 Extra Using index; Using filesort SELECT * FROM t1 ORDER BY b ASC, a DESC; a b 1 1 3 2 2 2 EXPLAIN SELECT * FROM t1 ORDER BY b DESC, a ASC; id 1 select_type SIMPLE table t1 type index possible_keys NULL key b key_len 5 ref NULL rows 3 Extra Using index; Using filesort SELECT * FROM t1 ORDER BY b DESC, a ASC; a b 2 2 3 2 1 1 DROP TABLE t1; End of 5.0 tests
mysql-test/r/select.result +34 −0 Original line number Diff line number Diff line Loading @@ -4062,4 +4062,38 @@ SHOW WARNINGS; Level Code Message Note 1003 select '0' AS `c1` from `test`.`t1` `join_0` join `test`.`t1` `join_1` join `test`.`t1` `join_2` join `test`.`t1` `join_3` join `test`.`t1` `join_4` join `test`.`t1` `join_5` join `test`.`t1` `join_6` join `test`.`t1` `join_7` where 0 group by '0','0','0','0','0' DROP TABLE t1; SELECT 1 AS ` `; 1 Warnings: Warning 1474 Name ' ' has become '' SELECT 1 AS ` `; 1 Warnings: Warning 1474 Name ' ' has become '' SELECT 1 AS ` x`; x 1 Warnings: Warning 1466 Leading spaces are removed from name ' x' CREATE VIEW v1 AS SELECT 1 AS ` `; Warnings: Warning 1474 Name ' ' has become '' SELECT `` FROM v1; 1 CREATE VIEW v2 AS SELECT 1 AS ` `; Warnings: Warning 1474 Name ' ' has become '' SELECT `` FROM v2; 1 CREATE VIEW v3 AS SELECT 1 AS ` x`; Warnings: Warning 1466 Leading spaces are removed from name ' x' SELECT `x` FROM v3; x 1 DROP VIEW v1, v2, v3; End of 5.0 tests
mysql-test/r/type_bit.result +15 −0 Original line number Diff line number Diff line Loading @@ -657,4 +657,19 @@ b # # DROP TABLE t1; CREATE TABLE t1 (a int, b bit(2)); INSERT INTO t1 VALUES (3, 2), (2, 3), (2, 0), (3, 2), (3, 1); SELECT COUNT(DISTINCT b) FROM t1 GROUP BY a; COUNT(DISTINCT b) 2 2 DROP TABLE t1; create table t2 (a int, b bit(2), c char(10)); INSERT INTO t2 VALUES (3, 2, 'two'), (2, 3, 'three'), (2, 0, 'zero'), (3, 2, 'two'), (3, 1, 'one'); SELECT COUNT(DISTINCT b,c) FROM t2 GROUP BY a; COUNT(DISTINCT b,c) 2 2 DROP TABLE t2; End of 5.0 tests
mysql-test/t/innodb_mysql.test +23 −0 Original line number Diff line number Diff line Loading @@ -937,4 +937,27 @@ SELECT c,b FROM t1 GROUP BY c,b; DROP TABLE t1; # # Bug #31001: ORDER BY DESC in InnoDB not working # CREATE TABLE t1 (a INT, b INT, PRIMARY KEY (a), INDEX b (b)) ENGINE=InnoDB; INSERT INTO t1(a,b) VALUES (1,1), (2,2), (3,2); #The two queries below should produce different results, but they don't. query_vertical EXPLAIN SELECT * FROM t1 WHERE b=2 ORDER BY a ASC; SELECT * FROM t1 WHERE b=2 ORDER BY a ASC; query_vertical EXPLAIN SELECT * FROM t1 WHERE b=2 ORDER BY a DESC; SELECT * FROM t1 WHERE b=2 ORDER BY a DESC; query_vertical EXPLAIN SELECT * FROM t1 ORDER BY b ASC, a ASC; SELECT * FROM t1 ORDER BY b ASC, a ASC; query_vertical EXPLAIN SELECT * FROM t1 ORDER BY b DESC, a DESC; SELECT * FROM t1 ORDER BY b DESC, a DESC; query_vertical EXPLAIN SELECT * FROM t1 ORDER BY b ASC, a DESC; SELECT * FROM t1 ORDER BY b ASC, a DESC; query_vertical EXPLAIN SELECT * FROM t1 ORDER BY b DESC, a ASC; SELECT * FROM t1 ORDER BY b DESC, a ASC; DROP TABLE t1; --echo End of 5.0 tests
mysql-test/t/select.test +24 −0 Original line number Diff line number Diff line Loading @@ -3460,4 +3460,28 @@ SHOW WARNINGS; DROP TABLE t1; # # Bug #27695: Misleading warning when declaring all space column names and # truncation of one-space column names to zero length names. # --disable_ps_protocol SELECT 1 AS ` `; SELECT 1 AS ` `; SELECT 1 AS ` x`; CREATE VIEW v1 AS SELECT 1 AS ` `; SELECT `` FROM v1; CREATE VIEW v2 AS SELECT 1 AS ` `; SELECT `` FROM v2; CREATE VIEW v3 AS SELECT 1 AS ` x`; SELECT `x` FROM v3; DROP VIEW v1, v2, v3; --enable_ps_protocol --echo End of 5.0 tests