summaryrefslogtreecommitdiff
path: root/sql/item.cc
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mariadb.org>2017-07-13 07:21:21 +0400
committerAlexander Barkov <bar@mariadb.org>2017-07-13 07:21:21 +0400
commit29acdcd5427e13bc3aefbbeee17b42bfe23dea84 (patch)
treef8f5365594c3b43e01891b7017f47fa6b934c646 /sql/item.cc
parente33bda183e80ff63a984ed2a938467950b23a3fd (diff)
parentdaec0004502a1f8c2ff7d46de92a61b5c4da1d6c (diff)
downloadmariadb-git-MDEV-9804.tar.gz
Merge remote-tracking branch 'origin/bb-10.2-ext' into 10.3MDEV-9804
Conflicts: VERSION debian/mariadb-backup-10.2.files debian/mariadb-backup-10.2.install debian/mariadb-backup-10.3.files mysql-test/unstable-tests
Diffstat (limited to 'sql/item.cc')
-rw-r--r--sql/item.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/sql/item.cc b/sql/item.cc
index d25d1110910..7d3f8788c3f 100644
--- a/sql/item.cc
+++ b/sql/item.cc
@@ -5479,6 +5479,12 @@ Item_field::fix_outer_field(THD *thd, Field **from_field, Item **reference)
((ref_type == REF_ITEM || ref_type == FIELD_ITEM) ?
(Item_ident*) (*reference) :
0));
+ if (thd->lex->in_sum_func &&
+ thd->lex->in_sum_func->nest_level >= select->nest_level)
+ {
+ set_if_bigger(thd->lex->in_sum_func->max_arg_level,
+ select->nest_level);
+ }
/*
A reference to a view field had been found and we
substituted it instead of this Item (find_field_in_tables