summaryrefslogtreecommitdiff
path: root/sql/sql_yacc.yy
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2019-02-03 17:22:05 +0200
committerMarko Mäkelä <marko.makela@mariadb.com>2019-02-03 17:22:05 +0200
commita249e57b684a23dce4cbb870ca3eb30c77cb9fd6 (patch)
tree9c50673311474f7efa0d5d110461ad324c7a62e6 /sql/sql_yacc.yy
parent261ce5286f266f1a5fab5e8adc2c08adef658d13 (diff)
parent955c7b32226c816b24a2ed1750e12bc0256565ad (diff)
downloadmariadb-git-a249e57b684a23dce4cbb870ca3eb30c77cb9fd6.tar.gz
Merge 10.1 into 10.2
Temporarily disable a test for commit 2175bfce3e9da8332f10ab0e0286dc93915533a2 because fixing it in 10.2 requires updating libmariadb.
Diffstat (limited to 'sql/sql_yacc.yy')
-rw-r--r--sql/sql_yacc.yy22
1 files changed, 12 insertions, 10 deletions
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy
index 10c2204d193..480c2e9bacb 100644
--- a/sql/sql_yacc.yy
+++ b/sql/sql_yacc.yy
@@ -16441,19 +16441,21 @@ subselect_end:
lex->current_select = lex->current_select->return_after_parsing();
lex->nest_level--;
lex->current_select->n_child_sum_items += child->n_sum_items;
- /*
- A subselect can add fields to an outer select. Reserve space for
- them.
- */
- lex->current_select->select_n_where_fields+=
- child->select_n_where_fields;
/*
- Aggregate functions in having clause may add fields to an outer
- select. Count them also.
+ A subquery (and all the subsequent query blocks in a UNION) can
+ add columns to an outer query block. Reserve space for them.
+ Aggregate functions in having clause can also add fields to an
+ outer select.
*/
- lex->current_select->select_n_having_items+=
- child->select_n_having_items;
+ for (SELECT_LEX *temp= child->master_unit()->first_select();
+ temp != NULL; temp= temp->next_select())
+ {
+ lex->current_select->select_n_where_fields+=
+ temp->select_n_where_fields;
+ lex->current_select->select_n_having_items+=
+ temp->select_n_having_items;
+ }
}
;