diff options
author | Bernt M. Johnsen <bernt.johnsen@sun.com> | 2009-02-26 18:17:06 +0100 |
---|---|---|
committer | Bernt M. Johnsen <bernt.johnsen@sun.com> | 2009-02-26 18:17:06 +0100 |
commit | 2cca1991bd25fe9a085ccb4d66ed39d1e054d495 (patch) | |
tree | 97f3c55d9d25c853bb06b607c83b886030e08451 /mysql-test | |
parent | cd5744db13a186add2814da0aed0719817ac075b (diff) | |
download | mariadb-git-2cca1991bd25fe9a085ccb4d66ed39d1e054d495.tar.gz |
Prepared for push (BUG#42567)
Diffstat (limited to 'mysql-test')
-rw-r--r-- | mysql-test/r/group_by.result | 12 | ||||
-rw-r--r-- | mysql-test/t/func_group.test | 2 | ||||
-rw-r--r-- | mysql-test/t/group_by.test | 18 |
3 files changed, 32 insertions, 0 deletions
diff --git a/mysql-test/r/group_by.result b/mysql-test/r/group_by.result index 48f97aeb428..742d4b90807 100644 --- a/mysql-test/r/group_by.result +++ b/mysql-test/r/group_by.result @@ -1691,3 +1691,15 @@ FROM t1; ERROR 21000: Subquery returns more than 1 row DROP TABLE t1; SET @@sql_mode = @old_sql_mode; +SET @old_sql_mode = @@sql_mode; +SET @@sql_mode='ONLY_FULL_GROUP_BY'; +CREATE TABLE t1(i INT); +INSERT INTO t1 VALUES (1), (10); +SELECT COUNT(i) FROM t1; +COUNT(i) +2 +SELECT COUNT(i) FROM t1 WHERE i > 1; +COUNT(i) +1 +DROP TABLE t1; +SET @@sql_mode = @old_sql_mode; diff --git a/mysql-test/t/func_group.test b/mysql-test/t/func_group.test index be4e9c32686..b0a3d0feb79 100644 --- a/mysql-test/t/func_group.test +++ b/mysql-test/t/func_group.test @@ -18,6 +18,8 @@ insert into t1 values (3,5,"C"); insert into t1 values (3,6,"D"); # Test of MySQL field extension with and without matching records. +#### Note: The two following statements may fail if the execution plan +#### or optimizer is changed. The result for column c is undefined. select a,c,sum(a) from t1 group by a; select a,c,sum(a) from t1 where a > 10 group by a; select sum(a) from t1 where a > 10; diff --git a/mysql-test/t/group_by.test b/mysql-test/t/group_by.test index e3cf3ca856d..5b96213034a 100644 --- a/mysql-test/t/group_by.test +++ b/mysql-test/t/group_by.test @@ -1139,4 +1139,22 @@ DROP TABLE t1; SET @@sql_mode = @old_sql_mode; +# +# Bug#42567 Invalid GROUP BY error +# + +# Setup of the subtest +SET @old_sql_mode = @@sql_mode; +SET @@sql_mode='ONLY_FULL_GROUP_BY'; + +CREATE TABLE t1(i INT); +INSERT INTO t1 VALUES (1), (10); + +# The actual test +SELECT COUNT(i) FROM t1; +SELECT COUNT(i) FROM t1 WHERE i > 1; + +# Cleanup of subtest +DROP TABLE t1; +SET @@sql_mode = @old_sql_mode; |