#At file:///home/bernt/mysql/branch/6.0-bugteam/ based on revid:davi.arnaut@stripped
3088 Bernt M. Johnsen 2009-02-26 [merge]
Merged from gca-branch (bug 42567)
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 2009-01-08 19:06:44 +0000
+++ b/mysql-test/r/group_by.result 2009-02-26 17:31:59 +0000
@@ -1721,3 +1721,15 @@ id select_type table type possible_keys
SELECT COUNT(varchar_key) AS X FROM t1 WHERE pk = 8 having 'foo'='bar';
X
drop table t1;
+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 17:17:06 +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 20:04:19 +0000
+++ b/mysql-test/t/group_by.test 2009-02-26 17:31:59 +0000
@@ -1167,3 +1167,22 @@ explain SELECT COUNT(varchar_key) AS X F
SELECT COUNT(varchar_key) AS X FROM t1 WHERE pk = 8 having 'foo'='bar';
drop table t1;
+#
+# 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;
+
Attachment: [text/bzr-bundle] bzr/bernt.johnsen@sun.com-20090226181205-by1jwatx1qvxp8ts.bundle
| Thread |
|---|
| • bzr commit into mysql-6.0-bugteam branch (bernt.johnsen:3088) | Bernt M. Johnsen | 26 Feb |