Loading Makefile.am +6 −0 Original line number Diff line number Diff line Loading @@ -135,6 +135,12 @@ test-force-pl: ./mysql-test-run.pl --force && \ ./mysql-test-run.pl --ps-protocol --force #used by autopush.pl to run memory based tests test-force-mem: cd mysql-test; \ ./mysql-test-run.pl --force --mem && \ ./mysql-test-run.pl --ps-protocol --force --mem # Don't update the files from bitkeeper %::SCCS/s.% mysql-test/r/order_by.result +27 −0 Original line number Diff line number Diff line Loading @@ -854,6 +854,33 @@ b a 20 1 10 2 DROP TABLE t1; CREATE TABLE t1 (a INT); INSERT INTO t1 VALUES (1),(2); SELECT a + 1 AS num FROM t1 ORDER BY 30 - num; num 3 2 SELECT CONCAT('test', a) AS str FROM t1 ORDER BY UPPER(str); str test1 test2 SELECT a + 1 AS num FROM t1 GROUP BY 30 - num; num 3 2 SELECT a + 1 AS num FROM t1 HAVING 30 - num; num 2 3 SELECT a + 1 AS num, num + 1 FROM t1; ERROR 42S22: Unknown column 'num' in 'field list' SELECT a + 1 AS num, (select num + 2 FROM t1 LIMIT 1) FROM t1; num (select num + 2 FROM t1 LIMIT 1) 2 4 3 5 SELECT a.a + 1 AS num FROM t1 a JOIN t1 b ON num = b.a; ERROR 42S22: Unknown column 'num' in 'on clause' DROP TABLE t1; CREATE TABLE t1 (a int, b int, PRIMARY KEY (a)); INSERT INTO t1 VALUES (1,1), (2,2), (3,3); explain SELECT t1.b as a, t2.b as c FROM Loading mysql-test/r/subselect.result +17 −0 Original line number Diff line number Diff line Loading @@ -3017,6 +3017,23 @@ a a IN (SELECT a FROM t1) 2 NULL 3 1 DROP TABLE t1,t2; CREATE TABLE t1 (a DATETIME); INSERT INTO t1 VALUES ('1998-09-23'), ('2003-03-25'); CREATE TABLE t2 AS SELECT (SELECT a FROM t1 WHERE a < '2000-01-01') AS sub_a FROM t1 WHERE a > '2000-01-01'; SHOW CREATE TABLE t2; Table Create Table t2 CREATE TABLE `t2` ( `sub_a` datetime default NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 CREATE TABLE t3 AS (SELECT a FROM t1 WHERE a < '2000-01-01') UNION (SELECT a FROM t1 WHERE a > '2000-01-01'); SHOW CREATE TABLE t3; Table Create Table t3 CREATE TABLE `t3` ( `a` datetime default NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DROP TABLE t1,t2,t3; create table t1 (df decimal(5,1)); insert into t1 values(1.1); insert into t1 values(2.2); Loading mysql-test/t/order_by.test +16 −0 Original line number Diff line number Diff line Loading @@ -577,6 +577,22 @@ INSERT INTO t1 VALUES (1,30), (2,20), (1,10), (2,30), (1,20), (2,10); DROP TABLE t1; # # Bug #22457: Column alias in ORDER BY works, but not if in an expression # CREATE TABLE t1 (a INT); INSERT INTO t1 VALUES (1),(2); SELECT a + 1 AS num FROM t1 ORDER BY 30 - num; SELECT CONCAT('test', a) AS str FROM t1 ORDER BY UPPER(str); SELECT a + 1 AS num FROM t1 GROUP BY 30 - num; SELECT a + 1 AS num FROM t1 HAVING 30 - num; --error 1054 SELECT a + 1 AS num, num + 1 FROM t1; SELECT a + 1 AS num, (select num + 2 FROM t1 LIMIT 1) FROM t1; --error 1054 SELECT a.a + 1 AS num FROM t1 a JOIN t1 b ON num = b.a; DROP TABLE t1; # End of 4.1 tests # Loading mysql-test/t/subselect.test +16 −0 Original line number Diff line number Diff line Loading @@ -1972,6 +1972,22 @@ SELECT a, a IN (SELECT a FROM t1) FROM t2; DROP TABLE t1,t2; # # Bug #11302: getObject() returns a String for a sub-query of type datetime # CREATE TABLE t1 (a DATETIME); INSERT INTO t1 VALUES ('1998-09-23'), ('2003-03-25'); CREATE TABLE t2 AS SELECT (SELECT a FROM t1 WHERE a < '2000-01-01') AS sub_a FROM t1 WHERE a > '2000-01-01'; SHOW CREATE TABLE t2; CREATE TABLE t3 AS (SELECT a FROM t1 WHERE a < '2000-01-01') UNION (SELECT a FROM t1 WHERE a > '2000-01-01'); SHOW CREATE TABLE t3; DROP TABLE t1,t2,t3; # End of 4.1 tests # Loading Loading
Makefile.am +6 −0 Original line number Diff line number Diff line Loading @@ -135,6 +135,12 @@ test-force-pl: ./mysql-test-run.pl --force && \ ./mysql-test-run.pl --ps-protocol --force #used by autopush.pl to run memory based tests test-force-mem: cd mysql-test; \ ./mysql-test-run.pl --force --mem && \ ./mysql-test-run.pl --ps-protocol --force --mem # Don't update the files from bitkeeper %::SCCS/s.%
mysql-test/r/order_by.result +27 −0 Original line number Diff line number Diff line Loading @@ -854,6 +854,33 @@ b a 20 1 10 2 DROP TABLE t1; CREATE TABLE t1 (a INT); INSERT INTO t1 VALUES (1),(2); SELECT a + 1 AS num FROM t1 ORDER BY 30 - num; num 3 2 SELECT CONCAT('test', a) AS str FROM t1 ORDER BY UPPER(str); str test1 test2 SELECT a + 1 AS num FROM t1 GROUP BY 30 - num; num 3 2 SELECT a + 1 AS num FROM t1 HAVING 30 - num; num 2 3 SELECT a + 1 AS num, num + 1 FROM t1; ERROR 42S22: Unknown column 'num' in 'field list' SELECT a + 1 AS num, (select num + 2 FROM t1 LIMIT 1) FROM t1; num (select num + 2 FROM t1 LIMIT 1) 2 4 3 5 SELECT a.a + 1 AS num FROM t1 a JOIN t1 b ON num = b.a; ERROR 42S22: Unknown column 'num' in 'on clause' DROP TABLE t1; CREATE TABLE t1 (a int, b int, PRIMARY KEY (a)); INSERT INTO t1 VALUES (1,1), (2,2), (3,3); explain SELECT t1.b as a, t2.b as c FROM Loading
mysql-test/r/subselect.result +17 −0 Original line number Diff line number Diff line Loading @@ -3017,6 +3017,23 @@ a a IN (SELECT a FROM t1) 2 NULL 3 1 DROP TABLE t1,t2; CREATE TABLE t1 (a DATETIME); INSERT INTO t1 VALUES ('1998-09-23'), ('2003-03-25'); CREATE TABLE t2 AS SELECT (SELECT a FROM t1 WHERE a < '2000-01-01') AS sub_a FROM t1 WHERE a > '2000-01-01'; SHOW CREATE TABLE t2; Table Create Table t2 CREATE TABLE `t2` ( `sub_a` datetime default NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 CREATE TABLE t3 AS (SELECT a FROM t1 WHERE a < '2000-01-01') UNION (SELECT a FROM t1 WHERE a > '2000-01-01'); SHOW CREATE TABLE t3; Table Create Table t3 CREATE TABLE `t3` ( `a` datetime default NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DROP TABLE t1,t2,t3; create table t1 (df decimal(5,1)); insert into t1 values(1.1); insert into t1 values(2.2); Loading
mysql-test/t/order_by.test +16 −0 Original line number Diff line number Diff line Loading @@ -577,6 +577,22 @@ INSERT INTO t1 VALUES (1,30), (2,20), (1,10), (2,30), (1,20), (2,10); DROP TABLE t1; # # Bug #22457: Column alias in ORDER BY works, but not if in an expression # CREATE TABLE t1 (a INT); INSERT INTO t1 VALUES (1),(2); SELECT a + 1 AS num FROM t1 ORDER BY 30 - num; SELECT CONCAT('test', a) AS str FROM t1 ORDER BY UPPER(str); SELECT a + 1 AS num FROM t1 GROUP BY 30 - num; SELECT a + 1 AS num FROM t1 HAVING 30 - num; --error 1054 SELECT a + 1 AS num, num + 1 FROM t1; SELECT a + 1 AS num, (select num + 2 FROM t1 LIMIT 1) FROM t1; --error 1054 SELECT a.a + 1 AS num FROM t1 a JOIN t1 b ON num = b.a; DROP TABLE t1; # End of 4.1 tests # Loading
mysql-test/t/subselect.test +16 −0 Original line number Diff line number Diff line Loading @@ -1972,6 +1972,22 @@ SELECT a, a IN (SELECT a FROM t1) FROM t2; DROP TABLE t1,t2; # # Bug #11302: getObject() returns a String for a sub-query of type datetime # CREATE TABLE t1 (a DATETIME); INSERT INTO t1 VALUES ('1998-09-23'), ('2003-03-25'); CREATE TABLE t2 AS SELECT (SELECT a FROM t1 WHERE a < '2000-01-01') AS sub_a FROM t1 WHERE a > '2000-01-01'; SHOW CREATE TABLE t2; CREATE TABLE t3 AS (SELECT a FROM t1 WHERE a < '2000-01-01') UNION (SELECT a FROM t1 WHERE a > '2000-01-01'); SHOW CREATE TABLE t3; DROP TABLE t1,t2,t3; # End of 4.1 tests # Loading