diff options
author | unknown <gkodinov/kgeorge@magare.gmz> | 2007-10-19 15:43:19 +0300 |
---|---|---|
committer | unknown <gkodinov/kgeorge@magare.gmz> | 2007-10-19 15:43:19 +0300 |
commit | b87f0704896f5ab172215ce286a31dedc0e3a568 (patch) | |
tree | 549f9b596e9a8042e40c32dcf92cb428477b3ba4 /mysql-test/t/query_cache.test | |
parent | 3afdb865f1e2c6e0b3b736de2390af1902334e10 (diff) | |
download | mariadb-git-b87f0704896f5ab172215ce286a31dedc0e3a568.tar.gz |
Bug #31157: crash when select+order by the avg of some field within the group by
The uncacheable flag should be set at fix_fields() stage.
Fixed by moving the flag setting to match the one in 5.1
mysql-test/r/query_cache.result:
Bug #31157: test case
mysql-test/t/query_cache.test:
Bug #31157: test case
sql/item_func.cc:
Bug #31157: The uncacheable flag should be set at
fix_fields() stage.
sql/item_func.h:
Bug #31157: The uncacheable flag should be set at
fix_fields() stage.
Diffstat (limited to 'mysql-test/t/query_cache.test')
-rw-r--r-- | mysql-test/t/query_cache.test | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/mysql-test/t/query_cache.test b/mysql-test/t/query_cache.test index d06698cdb17..df57867b75a 100644 --- a/mysql-test/t/query_cache.test +++ b/mysql-test/t/query_cache.test @@ -1333,4 +1333,21 @@ show status like 'Qcache_queries_in_cache'; drop database db2; drop database db3; +# +# 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 |