diff options
author | Georgi Kodinov <kgeorge@mysql.com> | 2009-02-27 17:07:27 +0200 |
---|---|---|
committer | Georgi Kodinov <kgeorge@mysql.com> | 2009-02-27 17:07:27 +0200 |
commit | 2bc070a05a60282880589756baba846fdf8c31b1 (patch) | |
tree | 3f786f7d2299f47073953e967ea1d4e6da5b515b /mysql-test/t/group_min_max.test | |
parent | 34143e4ec7dc59a139ab17a8fd3bb7ea408e0236 (diff) | |
parent | 15760fe9d8434dc9c960c123945b13890456bb5f (diff) | |
download | mariadb-git-2bc070a05a60282880589756baba846fdf8c31b1.tar.gz |
merged the fix for bug 41610 to 5.1-bugteam
Diffstat (limited to 'mysql-test/t/group_min_max.test')
-rw-r--r-- | mysql-test/t/group_min_max.test | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/mysql-test/t/group_min_max.test b/mysql-test/t/group_min_max.test index a7f4325b2d1..adfa77c881c 100644 --- a/mysql-test/t/group_min_max.test +++ b/mysql-test/t/group_min_max.test @@ -961,3 +961,25 @@ insert into t1 (a,b) select a, max(b)+1 from t1 where a = 0 group by a; select * from t1; explain extended select sql_buffer_result a, max(b)+1 from t1 where a = 0 group by a; drop table t1; + + +# +# Bug #41610: key_infix_len can be overwritten causing some group by queries +# to return no rows +# + +CREATE TABLE t1 (a int, b int, c int, d int, + KEY foo (c,d,a,b), KEY bar (c,a,b,d)); + +INSERT INTO t1 VALUES (1, 1, 1, 1), (1, 1, 1, 2), (1, 1, 1, 3), (1, 1, 1, 4); +INSERT INTO t1 SELECT * FROM t1; +INSERT INTO t1 SELECT * FROM t1; +INSERT INTO t1 SELECT a,b,c+1,d FROM t1; + +#Should be non-empty +EXPLAIN SELECT DISTINCT c FROM t1 WHERE d=4; +SELECT DISTINCT c FROM t1 WHERE d=4; + +DROP TABLE t1; + +--echo End of 5.0 tests |