summaryrefslogtreecommitdiff
path: root/sql/item.h
diff options
context:
space:
mode:
Diffstat (limited to 'sql/item.h')
-rw-r--r--sql/item.h13
1 files changed, 9 insertions, 4 deletions
diff --git a/sql/item.h b/sql/item.h
index 74ffce6153f..2720dddefd9 100644
--- a/sql/item.h
+++ b/sql/item.h
@@ -3930,7 +3930,7 @@ class Item_param :public Item_basic_value,
m_string.swap(other.m_string);
m_string_ptr.swap(other.m_string_ptr);
}
- double val_real() const;
+ double val_real(const Type_std_attributes *attr) const;
longlong val_int(const Type_std_attributes *attr) const;
my_decimal *val_decimal(my_decimal *dec, const Type_std_attributes *attr);
String *val_str(String *str, const Type_std_attributes *attr);
@@ -4026,7 +4026,7 @@ public:
double val_real() override
{
- return can_return_value() ? value.val_real() : 0e0;
+ return can_return_value() ? value.val_real(this) : 0e0;
}
longlong val_int() override
{
@@ -6448,12 +6448,15 @@ public:
class Item_default_value : public Item_field
{
+ bool vcol_assignment_ok;
void calculate();
public:
Item *arg= nullptr;
Field *cached_field= nullptr;
- Item_default_value(THD *thd, Name_resolution_context *context_arg, Item *a) :
- Item_field(thd, context_arg), arg(a) {}
+ Item_default_value(THD *thd, Name_resolution_context *context_arg, Item *a,
+ bool vcol_assignment_arg)
+ : Item_field(thd, context_arg),
+ vcol_assignment_ok(vcol_assignment_arg), arg(a) {}
Type type() const override { return DEFAULT_VALUE_ITEM; }
bool eq(const Item *item, bool binary_cmp) const override;
bool fix_fields(THD *, Item **) override;
@@ -6492,6 +6495,8 @@ public:
if (field && field->default_value)
field->default_value->expr->update_used_tables();
}
+ bool vcol_assignment_allowed_value() const override
+ { return vcol_assignment_ok; }
Field *get_tmp_table_field() override { return nullptr; }
Item *get_tmp_table_item(THD *) override { return this; }
Item_field *field_for_view_update() override { return nullptr; }