diff options
author | unknown <evgen@moonbone.local> | 2006-04-24 17:52:15 +0400 |
---|---|---|
committer | unknown <evgen@moonbone.local> | 2006-04-24 17:52:15 +0400 |
commit | ccee4036c2a542dd2eb6dfae8f8e0a4d1190dc15 (patch) | |
tree | ceaf1389974db4bb5e61c87360323618e16642aa /mysql-test | |
parent | 2a138695bf6eecb3c8f6b4e3fcb9a1a224b53c2d (diff) | |
parent | 4b7c4cd27f68b9aac1970b9f21c50d4eee35df7d (diff) | |
download | mariadb-git-ccee4036c2a542dd2eb6dfae8f8e0a4d1190dc15.tar.gz |
Manually merged
sql/item.cc:
Auto merged
sql/sql_select.cc:
Auto merged
Diffstat (limited to 'mysql-test')
-rw-r--r-- | mysql-test/r/having.result | 13 | ||||
-rw-r--r-- | mysql-test/t/having.test | 13 |
2 files changed, 26 insertions, 0 deletions
diff --git a/mysql-test/r/having.result b/mysql-test/r/having.result index fe918e4c3ff..a37f260ff31 100644 --- a/mysql-test/r/having.result +++ b/mysql-test/r/having.result @@ -392,3 +392,16 @@ HAVING HU.PROJ.CITY = HU.STAFF.CITY); EMPNUM GRADE*1000 E3 13000 DROP SCHEMA HU; +USE test; +create table t1(f1 int); +select f1 from t1 having max(f1)=f1; +f1 +select f1 from t1 group by f1 having max(f1)=f1; +f1 +set session sql_mode='ONLY_FULL_GROUP_BY'; +select f1 from t1 having max(f1)=f1; +ERROR 42000: non-grouping field 'f1' is used in HAVING clause +select f1 from t1 group by f1 having max(f1)=f1; +f1 +set session sql_mode=''; +drop table t1; diff --git a/mysql-test/t/having.test b/mysql-test/t/having.test index 9b21e544657..779b694987b 100644 --- a/mysql-test/t/having.test +++ b/mysql-test/t/having.test @@ -393,3 +393,16 @@ SELECT EMPNUM, GRADE*1000 HAVING HU.PROJ.CITY = HU.STAFF.CITY); DROP SCHEMA HU; +USE test; +# +# Bug#18739: non-standard HAVING extension was allowed in strict ANSI sql mode. +# +create table t1(f1 int); +select f1 from t1 having max(f1)=f1; +select f1 from t1 group by f1 having max(f1)=f1; +set session sql_mode='ONLY_FULL_GROUP_BY'; +--error 1461 +select f1 from t1 having max(f1)=f1; +select f1 from t1 group by f1 having max(f1)=f1; +set session sql_mode=''; +drop table t1; |