summaryrefslogtreecommitdiff
path: root/mysql-test/t/union.test
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/t/union.test')
-rw-r--r--mysql-test/t/union.test14
1 files changed, 14 insertions, 0 deletions
diff --git a/mysql-test/t/union.test b/mysql-test/t/union.test
index abea52fe584..a2e1fd09ade 100644
--- a/mysql-test/t/union.test
+++ b/mysql-test/t/union.test
@@ -1421,6 +1421,20 @@ drop table t1;
--echo End of 5.0 tests
+#
+# Bug #24595639: INCORRECT BEHAVIOR IN QUERY WITH UNION AND GROUP BY
+#
+create table t1 (a int, b int);
+insert into t1 values (1,1),(2,2),(3,3);
+create table t2 (c varchar(30), d varchar(30));
+insert into t1 values ('1','1'),('2','2'),('4','4');
+create table t3 (e int, f int);
+insert into t3 values (1,1),(2,2),(31,31),(32,32);
+select e,f, (e , f) in (select e,b from t1 union select c,d from t2) as sub from t3;
+select avg(f), (e , f) in (select e,b from t1 union select c,d from t2) as sub from t3 group by sub;
+drop table t1,t2,t3;
+
+--echo End of 5.5 tests
--echo #
--echo # WL#1763 Avoid creating temporary table in UNION ALL