summaryrefslogtreecommitdiff
path: root/mysql-test/t/having.test
diff options
context:
space:
mode:
authortimour@mysql.com <>2004-11-09 17:56:33 +0200
committertimour@mysql.com <>2004-11-09 17:56:33 +0200
commit974c29b97b1ce2fe09693d4f711c54ae697fdb5b (patch)
treeb26854415da4cc507b7650b6dafa2faf1e6dbaad /mysql-test/t/having.test
parent660e1236b570f245a839f337bb2aaf11a3e08f62 (diff)
downloadmariadb-git-974c29b97b1ce2fe09693d4f711c54ae697fdb5b.tar.gz
WL#1972 "Evaluate HAVING before SELECT select-list"
- post-review fix regarding Item_fields - added test for the changed name resolution
Diffstat (limited to 'mysql-test/t/having.test')
-rw-r--r--mysql-test/t/having.test6
1 files changed, 5 insertions, 1 deletions
diff --git a/mysql-test/t/having.test b/mysql-test/t/having.test
index d2a5ca4361e..b0fc600030b 100644
--- a/mysql-test/t/having.test
+++ b/mysql-test/t/having.test
@@ -211,6 +211,11 @@ where t1.col2 in
(select t2.col2 from t2
group by t2.col1, t2.col2 having col_t1 <= 10);
+# Item_field must be resolved in the same way as Item_ref
+select sum(col1) from t1
+group by col_t1
+having (select col_t1 from t2 where col_t1 = col_t2 order by col_t2 limit 1);
+
# nested queries with HAVING, inner having column resolved in outer FROM clause
# the outer having column is not referenced in GROUP BY which results in an error
--error 1054
@@ -256,7 +261,6 @@ group by col_t1
having col_t1 in (select sum(t2.col1) from t2
group by t2.col2, t2.col1 having t2.col1 = col_t1);
-
#
# queries with joins and ambiguous column names
#