summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mysql-test/r/func_gconcat.result10
-rw-r--r--sql/sql_parse.cc5
-rw-r--r--sql/sql_union.cc2
-rw-r--r--sql/sql_yacc.yy2
4 files changed, 15 insertions, 4 deletions
diff --git a/mysql-test/r/func_gconcat.result b/mysql-test/r/func_gconcat.result
index 7889f8953f4..d8a539da3fe 100644
--- a/mysql-test/r/func_gconcat.result
+++ b/mysql-test/r/func_gconcat.result
@@ -611,6 +611,16 @@ count(distinct (f1+1))
1
3
drop table t1;
+create table t1 (f1 int unsigned, f2 varchar(255));
+insert into t1 values (1,repeat('a',255)),(2,repeat('b',255));
+select f2,group_concat(f1) from t1 group by f2;
+Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
+def test t1 t1 f2 f2 253 255 255 Y 0 0 8
+def group_concat(f1) 253 400 1 Y 128 0 63
+f2 group_concat(f1)
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 1
+bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb 2
+drop table t1;
set names latin1;
create table t1 (a char, b char);
insert into t1 values ('a', 'a'), ('a', 'b'), ('b', 'a'), ('b', 'b');
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index 3752fc62d02..c58628cd856 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -6355,17 +6355,18 @@ bool st_select_lex_unit::add_fake_select_lex(THD *thd)
SELECT_LEX *first_sl= first_select();
DBUG_ENTER("add_fake_select_lex");
DBUG_ASSERT(!fake_select_lex);
-
+
if (!(fake_select_lex= new (thd->mem_root) SELECT_LEX()))
DBUG_RETURN(1);
fake_select_lex->include_standalone(this,
(SELECT_LEX_NODE**)&fake_select_lex);
fake_select_lex->select_number= INT_MAX;
+ fake_select_lex->parent_lex= thd->lex; /* Used in init_query. */
fake_select_lex->make_empty_select();
fake_select_lex->linkage= GLOBAL_OPTIONS_TYPE;
fake_select_lex->select_limit= 0;
- fake_select_lex->context.outer_context= first_sl->context.outer_context;
+ fake_select_lex->context.outer_context=first_sl->context.outer_context;
/* allow item list resolving in fake select for ORDER BY */
fake_select_lex->context.resolve_in_select_list= TRUE;
fake_select_lex->context.select_lex= fake_select_lex;
diff --git a/sql/sql_union.cc b/sql/sql_union.cc
index 68036f76e96..c5af81ae55a 100644
--- a/sql/sql_union.cc
+++ b/sql/sql_union.cc
@@ -202,7 +202,7 @@ bool st_select_lex_unit::prepare(THD *thd_arg, select_result *sel_result,
thd_arg->lex->current_select= sl= first_sl;
found_rows_for_union= first_sl->options & OPTION_FOUND_ROWS;
- is_union= test(first_select->next_select() || fake_select_lex);
+ is_union= first_sl->next_select() || fake_select_lex;
/* Global option */
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy
index a911ad41cd7..f3f0990c917 100644
--- a/sql/sql_yacc.yy
+++ b/sql/sql_yacc.yy
@@ -5719,7 +5719,7 @@ order_clause:
SELECT_LEX *first_sl= unit->first_select();
if (!first_sl->next_select() &&
(first_sl->order_list.elements ||
- first_sl->select_limit != HA_POS_ERROR) &&
+ first_sl->select_limit) &&
unit->add_fake_select_lex(lex->thd))
YYABORT;
}