1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

SQL: vers_update_user_fields() mem_root fix [#365 bug 12]

Related to #365 bug 3.
This commit is contained in:
Aleksey Midenkov
2017-12-07 16:52:05 +03:00
parent ad51d77f79
commit 37adb4c066
3 changed files with 4 additions and 4 deletions

View File

@ -2615,7 +2615,7 @@ TABLE *Delayed_insert::get_local_table(THD* client_thd)
} }
*field=0; *field=0;
if (copy->versioned() && copy->vers_update_user_field()) if (copy->versioned() && copy->vers_update_user_field(client_thd->mem_root))
goto error; goto error;
if (share->virtual_fields || share->default_expressions || if (share->virtual_fields || share->default_expressions ||

View File

@ -7705,10 +7705,10 @@ void TABLE::vers_update_fields()
} }
bool TABLE::vers_update_user_field() bool TABLE::vers_update_user_field(MEM_ROOT *_mem_root)
{ {
DBUG_ASSERT(versioned()); DBUG_ASSERT(versioned());
Field **dst= (Field **) alloc_root(&mem_root, Field **dst= (Field **) alloc_root(_mem_root ? _mem_root : &mem_root,
(s->fields - VERSIONING_FIELDS + 1) * (s->fields - VERSIONING_FIELDS + 1) *
sizeof(Field*)); sizeof(Field*));
if (!dst) if (!dst)

View File

@ -1488,7 +1488,7 @@ public:
Field **field_to_fill(); Field **field_to_fill();
Field **vers_user_field_to_fill(); Field **vers_user_field_to_fill();
bool vers_update_user_field(); bool vers_update_user_field(MEM_ROOT *mem_root= NULL);
bool validate_default_values_of_unset_fields(THD *thd) const; bool validate_default_values_of_unset_fields(THD *thd) const;
bool insert_all_rows_into_tmp_table(THD *thd, bool insert_all_rows_into_tmp_table(THD *thd,