summaryrefslogtreecommitdiff
path: root/mysql-test/r/group_by.result
diff options
context:
space:
mode:
authorVasil Dimov <vasil.dimov@oracle.com>2010-07-21 17:22:29 +0300
committerVasil Dimov <vasil.dimov@oracle.com>2010-07-21 17:22:29 +0300
commit5ba39365176be7042754632489c1e2ec885ba290 (patch)
treea66f5514fa9172ae7f3906bc68be75d6a9c59d82 /mysql-test/r/group_by.result
parent0802e5da694b3105dd723eacd3d7dc92b24f1f0b (diff)
parent74d67316829134f04bac656879408d4f7f2de8a4 (diff)
downloadmariadb-git-5ba39365176be7042754632489c1e2ec885ba290.tar.gz
Merge mysql-trunk-bugfixing -> mysql-trunk-innodb
(resolving conflicts in mysql-test/suite/rpl/t/rpl_sync-slave.opt and configure.cmake)
Diffstat (limited to 'mysql-test/r/group_by.result')
-rw-r--r--mysql-test/r/group_by.result29
1 files changed, 29 insertions, 0 deletions
diff --git a/mysql-test/r/group_by.result b/mysql-test/r/group_by.result
index cdf48376fb0..3416e368dff 100644
--- a/mysql-test/r/group_by.result
+++ b/mysql-test/r/group_by.result
@@ -1812,3 +1812,32 @@ MAX(t2.a)
DROP TABLE t1, t2;
#
# End of 5.1 tests
+#
+# Bug#49771: Incorrect MIN (date) when minimum value is 0000-00-00
+#
+CREATE TABLE t1 (f1 int, f2 DATE);
+INSERT INTO t1 VALUES (1,'2004-04-19'), (1,'0000-00-00'), (1,'2004-04-18'),
+(2,'2004-05-19'), (2,'0001-01-01'), (3,'2004-04-10');
+SELECT MIN(f2),MAX(f2) FROM t1;
+MIN(f2) MAX(f2)
+0000-00-00 2004-05-19
+SELECT f1,MIN(f2),MAX(f2) FROM t1 GROUP BY 1;
+f1 MIN(f2) MAX(f2)
+1 0000-00-00 2004-04-19
+2 0001-01-01 2004-05-19
+3 2004-04-10 2004-04-10
+DROP TABLE t1;
+CREATE TABLE t1 ( f1 int, f2 time);
+INSERT INTO t1 VALUES (1,'01:27:35'), (1,'06:11:01'), (2,'19:53:05'),
+(2,'21:44:25'), (3,'10:55:12'), (3,'05:45:11'), (4,'00:25:00');
+SELECT MIN(f2),MAX(f2) FROM t1;
+MIN(f2) MAX(f2)
+00:25:00 21:44:25
+SELECT f1,MIN(f2),MAX(f2) FROM t1 GROUP BY 1;
+f1 MIN(f2) MAX(f2)
+1 01:27:35 06:11:01
+2 19:53:05 21:44:25
+3 05:45:11 10:55:12
+4 00:25:00 00:25:00
+DROP TABLE t1;
+#End of test#49771