summaryrefslogtreecommitdiff
path: root/mysql-test/r
diff options
context:
space:
mode:
authorunknown <sanja@montyprogram.com>2012-03-14 13:58:18 +0200
committerunknown <sanja@montyprogram.com>2012-03-14 13:58:18 +0200
commit5338a28912589f1169b66b880a489ec5636bcd83 (patch)
treed0e1156d56a95d2051d499b065d78395bc302528 /mysql-test/r
parent0f3b8ef28ed19145e0cd850ef522ddf7cf662592 (diff)
parente638e605895fb572047ec8027e91c5438d77cbf4 (diff)
downloadmariadb-git-5338a28912589f1169b66b880a489ec5636bcd83.tar.gz
Merge 5.2->5.3
Diffstat (limited to 'mysql-test/r')
-rw-r--r--mysql-test/r/func_group.result47
-rw-r--r--mysql-test/r/group_by.result19
2 files changed, 66 insertions, 0 deletions
diff --git a/mysql-test/r/func_group.result b/mysql-test/r/func_group.result
index f1d3777e097..9c15af41799 100644
--- a/mysql-test/r/func_group.result
+++ b/mysql-test/r/func_group.result
@@ -1887,6 +1887,53 @@ NULL
NULL
DROP TABLE t1,t2,t3;
#
+# Bug #884175: MIN/MAX for short varchar = long const
+#
+CREATE TABLE t1 (f1 varchar(1), f2 varchar(1), KEY (f2));
+INSERT INTO t1 VALUES ('b', 'b'), ('a','a');
+EXPLAIN
+SELECT MAX(f1) FROM t1 WHERE f1 = 'abc';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using where
+SELECT MAX(f1) FROM t1 WHERE f1 = 'abc';
+MAX(f1)
+NULL
+EXPLAIN
+SELECT MAX(f2) FROM t1 WHERE f2 = 'abc';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ref f2 f2 4 const 1 Using where; Using index
+SELECT MAX(f2) FROM t1 WHERE f2 = 'abc';
+MAX(f2)
+NULL
+EXPLAIN
+SELECT MIN(f1) FROM t1 WHERE f1 >= 'abc';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using where
+SELECT MIN(f1) FROM t1 WHERE f1 >= 'abc';
+MIN(f1)
+b
+EXPLAIN
+SELECT MIN(f2) FROM t1 WHERE f2 >= 'abc';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index f2 f2 4 NULL 2 Using where; Using index
+SELECT MIN(f2) FROM t1 WHERE f2 >= 'abc';
+MIN(f2)
+b
+EXPLAIN
+SELECT MIN(f1) FROM t1 WHERE f1 BETWEEN 'abc' AND 'b' ;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using where
+SELECT MIN(f1) FROM t1 WHERE f1 BETWEEN 'abc' AND 'b' ;
+MIN(f1)
+b
+EXPLAIN
+SELECT MIN(f2) FROM t1 WHERE f2 BETWEEN 'abc' AND 'b' ;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index f2 f2 4 NULL 2 Using where; Using index
+SELECT MIN(f2) FROM t1 WHERE f2 BETWEEN 'abc' AND 'b' ;
+MIN(f2)
+b
+DROP TABLE t1;
End of 5.2 tests
#
# BUG#46680 - Assertion failed in file item_subselect.cc,
diff --git a/mysql-test/r/group_by.result b/mysql-test/r/group_by.result
index 6ac3257ca6c..7405095c965 100644
--- a/mysql-test/r/group_by.result
+++ b/mysql-test/r/group_by.result
@@ -1952,6 +1952,24 @@ 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
+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
+SET SESSION SQL_MODE=default;
+drop table t1;
+# End of 5.2 tests
+#
# BUG#872702: Crash in add_ref_to_table_cond() when grouping by a PK
#
CREATE TABLE t1 (a int, PRIMARY KEY (a)) ;
@@ -1966,3 +1984,4 @@ FROM t2
GROUP BY 1;
a
DROP TABLE t1, t2;
+# End of 5.3 tests