summaryrefslogtreecommitdiff
path: root/sql/item.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/item.cc')
-rw-r--r--sql/item.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/sql/item.cc b/sql/item.cc
index a57f3c0fa96..9149a1240ea 100644
--- a/sql/item.cc
+++ b/sql/item.cc
@@ -1664,7 +1664,10 @@ Item_field::Item_field(Name_resolution_context *context_arg,
field(0), result_field(0), item_equal(0), no_const_subst(0),
have_privileges(0), any_privileges(0), fixed_as_field(0)
{
+ SELECT_LEX *select= current_thd->lex->current_select;
collation.set(DERIVATION_IMPLICIT);
+ if (select && select->parsing_place != IN_HAVING)
+ select->select_n_where_fields++;
}
// Constructor need to process subselect with temporary tables (see Item)