summaryrefslogtreecommitdiff
path: root/sql/item.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/item.cc')
-rw-r--r--sql/item.cc16
1 files changed, 4 insertions, 12 deletions
diff --git a/sql/item.cc b/sql/item.cc
index 2a7d2453889..90bfb0d2852 100644
--- a/sql/item.cc
+++ b/sql/item.cc
@@ -6657,20 +6657,12 @@ bool Item_insert_value::fix_fields(THD *thd, Item **items)
}
if (arg->type() == REF_ITEM)
+ arg= static_cast<Item_ref *>(arg)->ref[0];
+ if (arg->type() != FIELD_ITEM)
{
- Item_ref *ref= (Item_ref *)arg;
- if (ref->ref[0]->type() != FIELD_ITEM)
- {
- my_error(ER_BAD_FIELD_ERROR, MYF(0), "", "VALUES() function");
- return TRUE;
- }
- arg= ref->ref[0];
+ my_error(ER_BAD_FIELD_ERROR, MYF(0), "", "VALUES() function");
+ return TRUE;
}
- /*
- According to our SQL grammar, VALUES() function can reference
- only to a column.
- */
- DBUG_ASSERT(arg->type() == FIELD_ITEM);
Item_field *field_arg= (Item_field *)arg;