Moved test case for bug 31157 from query_cache.test to subselect.test

This commit is contained in:
Kristofer Pettersson 2009-11-03 17:18:43 +01:00
commit cea642e32b
4 changed files with 33 additions and 1 deletions

View file

@ -3544,4 +3544,19 @@ where v in(select v
where t1.g=t2.g) is unknown;
drop table t1, t2;
#
# Bug #31157: Crash when select+order by the avg of some field within the
# group by
#
CREATE TABLE t1 (a ENUM('rainbow'));
INSERT INTO t1 VALUES (),(),(),(),();
SELECT 1 FROM t1 GROUP BY (SELECT 1 FROM t1 ORDER BY AVG(LAST_INSERT_ID()));
DROP TABLE t1;
CREATE TABLE t1 (a LONGBLOB);
INSERT INTO t1 SET a = 'aaaa';
INSERT INTO t1 SET a = 'aaaa';
SELECT 1 FROM t1 GROUP BY
(SELECT LAST_INSERT_ID() FROM t1 ORDER BY MIN(a) ASC LIMIT 1);
DROP TABLE t1;
--echo End of 5.1 tests.