#At file:///home/bernt/mysql/branch/bug42567/ based on revid:bernt.johnsen@stripped
2824 Bernt M. Johnsen 2009-02-26
BUG#42567: Added a testcase to group_by.test and a comment in func_group.test of a possible future test problem
modified:
mysql-test/r/group_by.result
mysql-test/t/func_group.test
mysql-test/t/group_by.test
=== modified file 'mysql-test/r/group_by.result'
--- a/mysql-test/r/group_by.result 2008-11-12 17:51:47 +0000
+++ b/mysql-test/r/group_by.result 2009-02-26 14:41:18 +0000
@@ -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;
=== modified file 'mysql-test/t/func_group.test'
--- a/mysql-test/t/func_group.test 2008-11-24 16:00:09 +0000
+++ b/mysql-test/t/func_group.test 2009-02-26 14:41:18 +0000
@@ -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;
=== modified file 'mysql-test/t/group_by.test'
--- a/mysql-test/t/group_by.test 2008-11-12 17:51:47 +0000
+++ b/mysql-test/t/group_by.test 2009-02-26 14:41:18 +0000
@@ -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 susbtest
+DROP TABLE t1;
+SET @@sql_mode = @old_sql_mode;
Attachment: [text/bzr-bundle] bzr/bernt.johnsen@sun.com-20090226144118-hplblmd7zcsy2xt3.bundle
| Thread |
|---|
| • bzr commit into mysql-5.1-bugteam branch (bernt.johnsen:2824) Bug#42567 | Bernt M. Johnsen | 26 Feb |