mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
A fix (bug #5615 type of aggregate function column wrong when using group by).
mysql-test/r/func_group.result: test case (bug #5615 type of aggregate function column wrong when using group by) mysql-test/t/func_group.test: test case (bug #5615 type of aggregate function column wrong when using group by) sql/sql_select.cc: A fix (bug #5615 type of aggregate function column wrong when using group by): should create a temporary field of the proper type in case of MIN|MAX(field).
This commit is contained in:
@ -719,3 +719,12 @@ one 2
|
||||
two 2
|
||||
three 1
|
||||
drop table t1;
|
||||
create table t1(a int, b datetime);
|
||||
insert into t1 values (1, NOW()), (2, NOW());
|
||||
create table t2 select MAX(b) from t1 group by a;
|
||||
show create table t2;
|
||||
Table Create Table
|
||||
t2 CREATE TABLE `t2` (
|
||||
`MAX(b)` datetime default NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
drop table t1, t2;
|
||||
|
@ -458,3 +458,13 @@ INSERT INTO t1 VALUES
|
||||
|
||||
select val, count(*) from t1 group by val;
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# Bug #5615: type of aggregate function column wrong when using group by
|
||||
#
|
||||
|
||||
create table t1(a int, b datetime);
|
||||
insert into t1 values (1, NOW()), (2, NOW());
|
||||
create table t2 select MAX(b) from t1 group by a;
|
||||
show create table t2;
|
||||
drop table t1, t2;
|
||||
|
Reference in New Issue
Block a user