summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authormonty@hundin.mysql.fi <>2002-03-06 18:36:31 +0200
committermonty@hundin.mysql.fi <>2002-03-06 18:36:31 +0200
commit668d09cc5c4e0c9e7c180f2dfb521244f325cf3f (patch)
treeb15e545bf81d86ec528ceb737592fa34e6024c18 /mysql-test
parentc1ab560c3dcc9b7060d90baffb4d6551203d2cc0 (diff)
downloadmariadb-git-668d09cc5c4e0c9e7c180f2dfb521244f325cf3f.tar.gz
Fixed bug in DATE_FORMAT when used with GROUP BY
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/type_date.result4
-rw-r--r--mysql-test/t/type_date.test13
2 files changed, 17 insertions, 0 deletions
diff --git a/mysql-test/r/type_date.result b/mysql-test/r/type_date.result
index 9aa6d6fb9b7..df8f0ee1814 100644
--- a/mysql-test/r/type_date.result
+++ b/mysql-test/r/type_date.result
@@ -18,3 +18,7 @@ s
date_add(date,INTERVAL 1 DAY) date_add(date,INTERVAL 1 SECOND)
2000-08-11 2000-08-10 00:00:01
2000-08-12 2000-08-11 00:00:01
+DATE_FORMAT("2002-03-06 10:11:12", CONCAT('%a, %d %M %Y %H:%i:%s ' , t2.GMT))
+Wed, 06 March 2002 10:11:12 GMT-0800
+DATE_FORMAT("2002-03-06 10:11:12", CONCAT('%a, %d %M %Y %H:%i:%s ' , t2.GMT)) DATE_FORMAT("2002-03-06 10:11:12", CONCAT('%a, %d %M %Y %H:%i:%s ' , t2.GMT))
+Wed, 06 March 2002 10:11:12 GMT-0800 Wed, 06 March 2002 10:11:12 GMT-0800
diff --git a/mysql-test/t/type_date.test b/mysql-test/t/type_date.test
index 0d2e18bcc94..68c2d55aac9 100644
--- a/mysql-test/t/type_date.test
+++ b/mysql-test/t/type_date.test
@@ -62,3 +62,16 @@ create table t1 (date date);
insert into t1 values ("2000-08-10"),("2000-08-11");
select date_add(date,INTERVAL 1 DAY),date_add(date,INTERVAL 1 SECOND) from t1;
drop table t1;
+
+#
+# Test problem with DATE_FORMAT
+#
+
+CREATE TABLE t1(AFIELD INT);
+INSERT INTO t1 VALUES(1);
+CREATE TABLE t2(GMT VARCHAR(32));
+INSERT INTO t2 VALUES('GMT-0800');
+SELECT DATE_FORMAT("2002-03-06 10:11:12", CONCAT('%a, %d %M %Y %H:%i:%s ' , t2.GMT)) FROM t1, t2 GROUP BY t1.AFIELD;
+INSERT INTO t1 VALUES(1);
+SELECT DATE_FORMAT("2002-03-06 10:11:12", CONCAT('%a, %d %M %Y %H:%i:%s ' , t2.GMT)), DATE_FORMAT("2002-03-06 10:11:12", CONCAT('%a, %d %M %Y %H:%i:%s ' , t2.GMT)) FROM t1,t2 GROUP BY t1.AFIELD;
+drop table t1,t2;