summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
Diffstat (limited to 'sql')
-rw-r--r--sql/item_cmpfunc.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc
index 24075ac838d..6e1afd4ef09 100644
--- a/sql/item_cmpfunc.cc
+++ b/sql/item_cmpfunc.cc
@@ -55,8 +55,8 @@ static void agg_cmp_type(THD *thd, Item_result *type, Item **items, uint nitems)
bool all_constant= TRUE;
/* If the first argument is a FIELD_ITEM, pull out the field. */
- if (items[0]->type() == Item::FIELD_ITEM)
- field=((Item_field *)items[0])->field;
+ if (items[0]->real_item()->type() == Item::FIELD_ITEM)
+ field=((Item_field *)(items[0]->real_item()))->field;
/* But if it can't be compared as a longlong, we don't really care. */
if (field && !field->can_be_compared_as_longlong())
field= NULL;