diff options
author | Sergei Golubchik <serg@mariadb.org> | 2022-04-21 10:04:04 +0200 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2022-04-21 10:05:50 +0200 |
commit | 6f6c74b0d18d5d4fa8a112a6793653ef5242726d (patch) | |
tree | 0410c1f500341283233dbb9cb39511aab9baf123 /sql/item.cc | |
parent | 4730314a70119ae5857edffe2d1bec86960ef22b (diff) | |
parent | 5ba77222e9fe7af8ff403816b5338b18b342053c (diff) | |
download | mariadb-git-6f6c74b0d18d5d4fa8a112a6793653ef5242726d.tar.gz |
Merge branch '10.2' into 10.3
Diffstat (limited to 'sql/item.cc')
-rw-r--r-- | sql/item.cc | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/sql/item.cc b/sql/item.cc index da4b67d576d..6681d5e375d 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -1045,8 +1045,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.str, field->field_name.str); return 1; } @@ -9444,6 +9443,12 @@ bool Item_default_value::eq(const Item *item, bool binary_cmp) const } +bool Item_default_value::check_field_expression_processor(void *) +{ + field->default_value= ((Item_field *)(arg->real_item()))->field->default_value; + return 0; +} + bool Item_default_value::fix_fields(THD *thd, Item **items) { Item *real_arg; @@ -9485,7 +9490,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(); @@ -9514,8 +9518,7 @@ error: void Item_default_value::cleanup() { - delete cached_field; // Free cached blob data - cached_field= 0; + delete field; // Free cached blob data Item_field::cleanup(); } |