summaryrefslogtreecommitdiff
path: root/mysql-test/t/group_by.test
diff options
context:
space:
mode:
authorunknown <igor@rurik.mysql.com>2005-06-20 10:49:04 -0700
committerunknown <igor@rurik.mysql.com>2005-06-20 10:49:04 -0700
commit15b113e186939e091af4c93759dfc1ca66a37fda (patch)
treed3e3da8101082dc4b09e247467e1d8e685e931f3 /mysql-test/t/group_by.test
parent2c7095c82eaf76723839587a63deaa8377390e6e (diff)
downloadmariadb-git-15b113e186939e091af4c93759dfc1ca66a37fda.tar.gz
group_by.result:
Added a test case for bug #11385. group_by.test: Added a test case for bug #11385. field.h: Fixed bug #11385. The bug was due to not defined method decimals for the class Field_datetime. sql/field.h: Fixed bug #11385. The bug was due to not defined method decimals for the class Field_datetime. mysql-test/t/group_by.test: Added atest case for bug #11385. mysql-test/r/group_by.result: Added a test case for bug #11385.
Diffstat (limited to 'mysql-test/t/group_by.test')
-rw-r--r--mysql-test/t/group_by.test15
1 files changed, 14 insertions, 1 deletions
diff --git a/mysql-test/t/group_by.test b/mysql-test/t/group_by.test
index f9d113a9c50..382580cbd4e 100644
--- a/mysql-test/t/group_by.test
+++ b/mysql-test/t/group_by.test
@@ -543,7 +543,7 @@ SELECT hostname, COUNT(DISTINCT user_id) as no FROM t1
DROP TABLE t1;
#
-# Test for bug #8614: GROUP BY 'const with DISTINCT
+# Test for bug #8614: GROUP BY 'const' with DISTINCT
#
CREATE TABLE t1 (a int, b int);
@@ -552,3 +552,16 @@ SELECT a, b FROM t1 GROUP BY 'const';
SELECT DISTINCT a, b FROM t1 GROUP BY 'const';
DROP TABLE t1;
+
+#
+# Test for bug #11385: GROUP BY for datetime converted to decimals
+#
+
+CREATE TABLE t1 (id INT, dt DATETIME);
+INSERT INTO t1 VALUES ( 1, '2005-05-01 12:30:00' );
+INSERT INTO t1 VALUES ( 1, '2005-05-01 12:30:00' );
+INSERT INTO t1 VALUES ( 1, '2005-05-01 12:30:00' );
+INSERT INTO t1 VALUES ( 1, '2005-05-01 12:30:00' );
+SELECT dt DIV 1 AS f, id FROM t1 GROUP BY f;
+
+DROP TABLE t1;