mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
fixed fix_fields() parameters for GROUP_CONCAT() ORDER BY clause
(BUG#1537)
This commit is contained in:
@ -196,3 +196,14 @@ insert into t1 values('test'),('test2');
|
||||
select * from t1 having group_concat(bar)='';
|
||||
bar
|
||||
drop table t1;
|
||||
create table t1 (a int, a1 varchar(10));
|
||||
create table t2 (a0 int);
|
||||
insert into t1 values (0,"a"),(0,"b"),(1,"c");
|
||||
insert into t2 values (1),(2),(3);
|
||||
select group_concat(a1 order by (t1.a IN (select a0 from t2))) from t1;
|
||||
group_concat(a1 order by (t1.a IN (select a0 from t2)))
|
||||
b,a,c
|
||||
select group_concat(a1 order by (t1.a)) from t1;
|
||||
group_concat(a1 order by (t1.a))
|
||||
b,a,c
|
||||
drop table t1, t2;
|
||||
|
@ -119,4 +119,11 @@ insert into t1 values('test'),('test2');
|
||||
select * from t1 having group_concat(bar)='';
|
||||
drop table t1;
|
||||
|
||||
|
||||
# ORDER BY fix_fields()
|
||||
create table t1 (a int, a1 varchar(10));
|
||||
create table t2 (a0 int);
|
||||
insert into t1 values (0,"a"),(0,"b"),(1,"c");
|
||||
insert into t2 values (1),(2),(3);
|
||||
select group_concat(a1 order by (t1.a IN (select a0 from t2))) from t1;
|
||||
select group_concat(a1 order by (t1.a)) from t1;
|
||||
drop table t1, t2;
|
@ -1773,8 +1773,8 @@ Item_func_group_concat::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref)
|
||||
for (i= 0 ; i < arg_count_order ; i++)
|
||||
{
|
||||
ORDER *order_item= order[i];
|
||||
Item *item=*order_item->item;
|
||||
if (item->fix_fields(thd, tables, &item) || item->check_cols(1))
|
||||
if ((*order_item->item)->fix_fields(thd, tables, order_item->item) ||
|
||||
(*order_item->item)->check_cols(1))
|
||||
return 1;
|
||||
}
|
||||
result_field= 0;
|
||||
|
Reference in New Issue
Block a user