summaryrefslogtreecommitdiff
path: root/mysql-test/r/group_by.result
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/r/group_by.result')
-rw-r--r--mysql-test/r/group_by.result61
1 files changed, 46 insertions, 15 deletions
diff --git a/mysql-test/r/group_by.result b/mysql-test/r/group_by.result
index b57bc21524e..cffed9529d6 100644
--- a/mysql-test/r/group_by.result
+++ b/mysql-test/r/group_by.result
@@ -1948,6 +1948,52 @@ DROP TABLE t1;
SET SQL_BIG_TABLES=0;
# End of 5.1 tests
#
+# LP bug#694450 Wrong result with non-standard GROUP BY + ORDER BY
+#
+SET SESSION SQL_MODE='ONLY_FULL_GROUP_BY';
+CREATE TABLE t1 (
+f1 int(11), f2 int(11), f3 datetime, f4 varchar(1), PRIMARY KEY (f1)) ;
+INSERT IGNORE INTO t1 VALUES ('1','9','2004-10-11 18:13','x'),('2','5','2004-03-07 14:02','g'),('3','1','2004-04-09 09:38','o'),('4','0','1900-01-01 00:00','g'),('5','1','2009-02-19 02:05','v');
+SELECT alias2.f3 AS field1 , alias2.f1 AS field2 FROM t1 AS alias1 JOIN t1 AS alias2 ON alias2.f1 = alias1.f2 AND alias2.f1 != alias1.f4 GROUP BY field1 , field2 ORDER BY alias1.f2 , field2;
+field1 field2
+2004-10-11 18:13:00 1
+2009-02-19 02:05:00 5
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: 'x'
+Warning 1292 Truncated incorrect DOUBLE value: 'g'
+Warning 1292 Truncated incorrect DOUBLE value: 'o'
+Warning 1292 Truncated incorrect DOUBLE value: 'g'
+Warning 1292 Truncated incorrect DOUBLE value: 'v'
+SELECT alias2.f3 AS field1 , alias2.f1 AS field2 FROM t1 AS alias1 JOIN t1 AS alias2 ON alias2.f1 = alias1.f2 AND alias2.f1 != alias1.f4 GROUP BY field1 , field2 ;
+field1 field2
+2004-10-11 18:13:00 1
+2009-02-19 02:05:00 5
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: 'x'
+Warning 1292 Truncated incorrect DOUBLE value: 'g'
+Warning 1292 Truncated incorrect DOUBLE value: 'o'
+Warning 1292 Truncated incorrect DOUBLE value: 'g'
+Warning 1292 Truncated incorrect DOUBLE value: 'v'
+SET SESSION SQL_MODE=default;
+drop table t1;
+# End of 5.2 tests
+#
+# lp:872702: Crash in add_ref_to_table_cond() when grouping by a PK
+#
+CREATE TABLE t1 (a int, PRIMARY KEY (a)) ;
+INSERT INTO t1 VALUES (14),(15),(16),(17),(18),(19),(20);
+CREATE TABLE t2 (a int) ;
+SELECT a
+FROM t1
+WHERE a = (
+SELECT t2.a
+FROM t2
+) OR t1.a = 73
+GROUP BY 1;
+a
+DROP TABLE t1, t2;
+# End of 5.3 tests
+#
# Bug#49771: Incorrect MIN (date) when minimum value is 0000-00-00
#
CREATE TABLE t1 (f1 int, f2 DATE);
@@ -1976,18 +2022,3 @@ f1 MIN(f2) MAX(f2)
4 00:25:00 00:25:00
DROP TABLE t1;
#End of test#49771
-#
-# lp:872702: Crash in add_ref_to_table_cond() when grouping by a PK
-#
-CREATE TABLE t1 (a int, PRIMARY KEY (a)) ;
-INSERT INTO t1 VALUES (14),(15),(16),(17),(18),(19),(20);
-CREATE TABLE t2 (a int) ;
-SELECT a
-FROM t1
-WHERE a = (
-SELECT t2.a
-FROM t2
-) OR t1.a = 73
-GROUP BY 1;
-a
-DROP TABLE t1, t2;