summaryrefslogtreecommitdiff
path: root/mysql-test/r/subselect4.result
diff options
context:
space:
mode:
authorVarun Gupta <varun.gupta@mariadb.com>2020-08-13 16:58:32 +0530
committerVarun Gupta <varun.gupta@mariadb.com>2020-08-13 16:58:32 +0530
commit8ddc2182fdfd8f8b8dcffccb4605cd9deac35c7a (patch)
tree4b0f0ee285b92734f70fc50d10547377bac82b12 /mysql-test/r/subselect4.result
parent101ce10d0ddda1e38806b8d2c491298482e7ab78 (diff)
downloadmariadb-git-8ddc2182fdfd8f8b8dcffccb4605cd9deac35c7a.tar.gz
MDEV-23449: alias do not exist and a query do not report an error
The issue here was for an IN subquery without an aggregate function, the GROUP BY clause was removed. Due to the GROUP BY list being removed, the invalid reference in the GROUP BY clause was never resolved. Remove the GROUP BY listonly when the all the items in the GROUP BY list are resolved.
Diffstat (limited to 'mysql-test/r/subselect4.result')
-rw-r--r--mysql-test/r/subselect4.result8
1 files changed, 8 insertions, 0 deletions
diff --git a/mysql-test/r/subselect4.result b/mysql-test/r/subselect4.result
index e7655131fcf..a4fd1123227 100644
--- a/mysql-test/r/subselect4.result
+++ b/mysql-test/r/subselect4.result
@@ -2648,4 +2648,12 @@ a
1
2
DROP TABLE t1,t2;
+#
+# MDEV-23449: alias do not exist and a query do not report an error
+#
+CREATE TABLE t1(a INT, b INT);
+INSERT INTO t1 VALUES (1,1), (2,2), (3,3), (4,4), (5,5);
+SELECT a, b FROM t1 WHERE a IN (SELECT A.a FROM t1 A GROUP BY s.id);
+ERROR 42S22: Unknown column 's.id' in 'group statement'
+DROP TABLE t1;
# end of 10.1 tests