summaryrefslogtreecommitdiff
path: root/mysql-test/t/group_min_max.test
diff options
context:
space:
mode:
authorunknown <timour@askmonty.org>2011-12-08 12:05:52 +0200
committerunknown <timour@askmonty.org>2011-12-08 12:05:52 +0200
commit314c377422dd13c86591a4de32162467eb540c33 (patch)
tree3096f6e07e04a1d334dbe44aa653d6e2fd238efb /mysql-test/t/group_min_max.test
parent1f3e540385fd7705047242e58800fcceb5ef3da5 (diff)
downloadmariadb-git-314c377422dd13c86591a4de32162467eb540c33.tar.gz
Fixed bug lp:888456
Analysis: The class member QUICK_GROUP_MIN_MAX_SELECT::seen_first_key was not reset between subquery re-executions. Thus each subsequent execution continued from the group that was reached by the previous subquery execution. As a result loose scan reached end of file much earlier, and returned empty result where it shouldn't. Solution: Reset seen_first_key before each re-execution of the loose scan.
Diffstat (limited to 'mysql-test/t/group_min_max.test')
-rw-r--r--mysql-test/t/group_min_max.test14
1 files changed, 14 insertions, 0 deletions
diff --git a/mysql-test/t/group_min_max.test b/mysql-test/t/group_min_max.test
index 8ab7e1c9cb4..bd2cbd8a9f0 100644
--- a/mysql-test/t/group_min_max.test
+++ b/mysql-test/t/group_min_max.test
@@ -1099,5 +1099,19 @@ ORDER BY min_a;
DROP TABLE t1;
+--echo #
+--echo # LP BUG#888456 Wrong result with DISTINCT , ANY , subquery_cache=off , NOT NULL
+--echo #
+
+CREATE TABLE t1 ( a int NOT NULL) ;
+INSERT INTO t1 VALUES (28),(29),(9);
+
+CREATE TABLE t2 ( a int, KEY (a)) ;
+INSERT INTO t2 VALUES (1),(1),(1),(4),(4),(5),(5),(8),(8),(9);
+
+explain select (select t2.a from t2 where t2.a >= t1.a group by t2.a) from t1;
+select (select t2.a from t2 where t2.a >= t1.a group by t2.a) from t1;
+
+drop table t1, t2;
--echo End of 5.1 tests