summaryrefslogtreecommitdiff
path: root/sql/item.cc
diff options
context:
space:
mode:
authorhf@deer.mysql.r18.ru <>2003-01-05 14:12:03 +0400
committerhf@deer.mysql.r18.ru <>2003-01-05 14:12:03 +0400
commit445d4262034ec2a986f07fca529b834e8dfba3ee (patch)
tree52129f1c9b18b3f7171f3180a027ada83f8f1f77 /sql/item.cc
parent31dd47f9967669f135f34f07c67efb8f9bfd36e7 (diff)
parentf6e8e1f9858e9f988697890f406f6d6a67abe92a (diff)
downloadmariadb-git-445d4262034ec2a986f07fca529b834e8dfba3ee.tar.gz
Conflicts resolving
Diffstat (limited to 'sql/item.cc')
-rw-r--r--sql/item.cc31
1 files changed, 31 insertions, 0 deletions
diff --git a/sql/item.cc b/sql/item.cc
index b0b56bf9101..310e704bd41 100644
--- a/sql/item.cc
+++ b/sql/item.cc
@@ -1119,6 +1119,37 @@ bool Item_ref::check_loop(uint id)
DBUG_RETURN((*ref)->check_loop(id));
}
+bool Item_default_value::eq(const Item *item, bool binary_cmp) const
+{
+ return item->type() == DEFAULT_VALUE_ITEM &&
+ ((Item_default_value *)item)->arg->eq(arg, binary_cmp);
+}
+
+bool Item_default_value::fix_fields(THD *thd, struct st_table_list *table_list, Item **items)
+{
+ bool res= arg->fix_fields(thd, table_list, items);
+ if (res)
+ return res;
+ if (arg->type() == REF_ITEM)
+ {
+ Item_ref *ref= (Item_ref *)arg;
+ if (ref->ref[0]->type() != FIELD_ITEM)
+ {
+ return 1;
+ }
+ arg= ref->ref[0];
+ }
+ Item_field *field_arg= (Item_field *)arg;
+ Field *def_field= (Field*) sql_alloc(field_arg->field->size_of());
+ if (!def_field)
+ return 1;
+ memcpy(def_field, field_arg->field, field_arg->field->size_of());
+ def_field->move_field(def_field->table->default_values -
+ def_field->table->record[0]);
+ set_field(def_field);
+ return 0;
+}
+
/*
If item is a const function, calculate it and return a const item