summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2022-04-14 10:16:54 +0200
committerSergei Golubchik <serg@mariadb.org>2022-04-14 15:43:35 +0200
commitcc08c43ed642ce8f5fc2c35bd1e917f220987c66 (patch)
tree1fcfbf9c3fbb1217f8aef5927d2e39ab9c8a3da1
parentb5e16a6e0381b28b598da80b414168ce9a5016e5 (diff)
downloadmariadb-git-cc08c43ed642ce8f5fc2c35bd1e917f220987c66.tar.gz
cleanup: remove Item_default_value::cached_field
-rw-r--r--sql/item.cc7
-rw-r--r--sql/item.h9
2 files changed, 6 insertions, 10 deletions
diff --git a/sql/item.cc b/sql/item.cc
index cf824039b56..502ca799181 100644
--- a/sql/item.cc
+++ b/sql/item.cc
@@ -1055,8 +1055,7 @@ bool Item_field::check_field_expression_processor(void *arg)
(!field->vcol_info && !org_field->vcol_info)) &&
field->field_index >= org_field->field_index))
{
- my_error(ER_EXPRESSION_REFERS_TO_UNINIT_FIELD,
- MYF(0),
+ my_error(ER_EXPRESSION_REFERS_TO_UNINIT_FIELD, MYF(0),
org_field->field_name, field->field_name);
return 1;
}
@@ -9024,7 +9023,6 @@ bool Item_default_value::fix_fields(THD *thd, Item **items)
}
if (!(def_field= (Field*) thd->alloc(field_arg->field->size_of())))
goto error;
- cached_field= def_field;
memcpy((void *)def_field, (void *)field_arg->field,
field_arg->field->size_of());
def_field->reset_fields();
@@ -9063,8 +9061,7 @@ bool Item_default_value::enchant_default_with_arg_processor(void *proc_arg)
void Item_default_value::cleanup()
{
- delete cached_field; // Free cached blob data
- cached_field= 0;
+ delete field; // Free cached blob data
Item_field::cleanup();
}
diff --git a/sql/item.h b/sql/item.h
index 0823f064af8..35454c69734 100644
--- a/sql/item.h
+++ b/sql/item.h
@@ -5455,18 +5455,17 @@ protected:
Item_default_value(THD *thd, Name_resolution_context *context_arg, Item *a)
:Item_field(thd, context_arg, (const char *)NULL, (const char *)NULL,
(const char *)NULL),
- arg(a), cached_field(NULL) {}
+ arg(a) {}
public:
Item *arg;
- Field *cached_field;
Item_default_value(THD *thd, Name_resolution_context *context_arg)
:Item_field(thd, context_arg, (const char *)NULL, (const char *)NULL,
(const char *)NULL),
- arg(NULL), cached_field(NULL) {}
+ arg(NULL) {}
Item_default_value(THD *thd, Name_resolution_context *context_arg, Field *a)
:Item_field(thd, context_arg, (const char *)NULL, (const char *)NULL,
(const char *)NULL),
- arg(NULL),cached_field(NULL) {}
+ arg(NULL) {}
enum Type type() const { return DEFAULT_VALUE_ITEM; }
bool vcol_assignment_allowed_value() const { return true; }
bool eq(const Item *item, bool binary_cmp) const;
@@ -5498,7 +5497,7 @@ public:
return false;
}
table_map used_tables() const;
- virtual void update_used_tables()
+ void update_used_tables()
{
if (field && field->default_value)
field->default_value->expr->update_used_tables();