mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
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.
This commit is contained in:
@ -732,3 +732,12 @@ SELECT DISTINCT a, b FROM t1 GROUP BY 'const';
|
||||
a b
|
||||
1 2
|
||||
DROP TABLE t1;
|
||||
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;
|
||||
f id
|
||||
20050501123000 1
|
||||
DROP TABLE t1;
|
||||
|
@ -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;
|
||||
|
Reference in New Issue
Block a user