Commit 628d2e4a authored by bell@sanja.is.com.ua's avatar bell@sanja.is.com.ua

Merge sanja.is.com.ua:/home/bell/mysql/bk/mysql-4.1

into sanja.is.com.ua:/home/bell/mysql/bk/work-group_concat-4.1
parents 32fed1e8 8f5c3f39
...@@ -196,3 +196,14 @@ insert into t1 values('test'),('test2'); ...@@ -196,3 +196,14 @@ insert into t1 values('test'),('test2');
select * from t1 having group_concat(bar)=''; select * from t1 having group_concat(bar)='';
bar bar
drop table t1; 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'); ...@@ -119,4 +119,11 @@ insert into t1 values('test'),('test2');
select * from t1 having group_concat(bar)=''; select * from t1 having group_concat(bar)='';
drop table t1; 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;
\ No newline at end of file
...@@ -1773,8 +1773,8 @@ Item_func_group_concat::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref) ...@@ -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++) for (i= 0 ; i < arg_count_order ; i++)
{ {
ORDER *order_item= order[i]; ORDER *order_item= order[i];
Item *item=*order_item->item; if ((*order_item->item)->fix_fields(thd, tables, order_item->item) ||
if (item->fix_fields(thd, tables, &item) || item->check_cols(1)) (*order_item->item)->check_cols(1))
return 1; return 1;
} }
result_field= 0; result_field= 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment