mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
skip resolving field in table list if table list is not accessable due to groupping (BUG#4814)
mysql-test/r/func_gconcat.result: fix of test queries mysql-test/r/subselect.result: resolving fields of grouped outer SELECT mysql-test/t/func_gconcat.test: fix of test queries mysql-test/t/subselect.test: resolving fields of grouped outer SELECT sql/item.cc: skip resolving field in table list if table list is not accessable due to groupping layout fixed sql/item_subselect.cc: detection of place of subquery sql/item_subselect.h: detection of place of subquery sql/mysql_priv.h: enum_parsing_place made global type sql/sql_lex.cc: enum_parsing_place made global type sql/sql_lex.h: enum_parsing_place made global type sql/sql_yacc.yy: enum_parsing_place made global type
This commit is contained in:
@ -285,15 +285,21 @@ insert into t2 values (1, 5), (2, 4), (3, 3), (3,3);
|
||||
select group_concat(c) from t1;
|
||||
group_concat(c)
|
||||
2,3,4,5
|
||||
select group_concat(c order by (select c from t2 where t2.a=t1.a limit 1)) as grp from t1;
|
||||
grp
|
||||
5,4,3,2
|
||||
select group_concat(c order by (select mid(group_concat(c order by a),1,5) from t2 where t2.a=t1.a)) as grp from t1;
|
||||
grp
|
||||
5,4,3,2
|
||||
select group_concat(c order by (select mid(group_concat(c order by a),1,5) from t2 where t2.a=t1.a) desc) as grp from t1;
|
||||
grp
|
||||
2,4,3,5
|
||||
select t1.a, group_concat(c order by (select c from t2 where t2.a=t1.a limit 1)) as grp from t1 group by 1;
|
||||
a grp
|
||||
1 2
|
||||
2 4,3
|
||||
3 5
|
||||
select t1.a, group_concat(c order by (select mid(group_concat(c order by a),1,5) from t2 where t2.a=t1.a)) as grp from t1 group by 1;
|
||||
a grp
|
||||
1 2
|
||||
2 4,3
|
||||
3 5
|
||||
select t1.a, group_concat(c order by (select mid(group_concat(c order by a),1,5) from t2 where t2.a=t1.a) desc) as grp from t1 group by 1;
|
||||
a grp
|
||||
1 2
|
||||
2 4,3
|
||||
3 5
|
||||
select a,c,(select group_concat(c order by a) from t2 where a=t1.a) as grp from t1 order by grp;
|
||||
a c grp
|
||||
3 5 3,3
|
||||
|
Reference in New Issue
Block a user