mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
reduced using of slow current_thd/current_lex macro
initialization of item_thd moved to constructor (in any case we need thd in constructor) initialization of group_concat_max_len to constructor to avoid incorrect length reporting (BUG#757) removed Item_func_group_concat::fix_length_and_dec() because item have its own fix_fields and will not have inherited items mysql-test/r/func_gconcat.result: test for BUG#757 mysql-test/t/func_gconcat.test: test for BUG#757 sql/item_sum.cc: reduced using of slow current_thd/current_lex macro initialization of item_thd moved to constructor (in any case we need thd in constructor) initialization of group_concat_max_len to constructor to avoid incorrect length reporting (BUG#757) sql/item_sum.h: removed Item_func_group_concat::fix_length_and_dec() because item have its own fix_fields and will not have inherited items
This commit is contained in:
@ -177,3 +177,12 @@ ERROR HY000: Invalid use of group function
|
||||
select grp,group_concat(c order by 2) from t1 group by grp;
|
||||
ERROR 42S22: Unknown column '2' in 'group statement'
|
||||
drop table t1;
|
||||
create table t1 (id int, name varchar(16));
|
||||
insert into t1 values (1,'longername'),(1,'evenlongername');
|
||||
select ifnull(group_concat(concat(t1.id, ':', t1.name)), 'shortname') as 'without distinct: how it should be' from t1;
|
||||
without distinct: how it should be
|
||||
1:longername,1:evenlongername
|
||||
select distinct ifnull(group_concat(concat(t1.id, ':', t1.name)), 'shortname') as 'with distinct: cutoff at length of shortname' from t1;
|
||||
with distinct: cutoff at length of shortname
|
||||
1:longername,1:evenlongername
|
||||
drop table t1;
|
||||
|
Reference in New Issue
Block a user