Skip to content

Commit

Permalink
SQL: vers_update_user_fields() mem_root fix [#365 bug 12]
Browse files Browse the repository at this point in the history
Related to #365 bug 3.
  • Loading branch information
midenok committed Dec 8, 2017
1 parent ad51d77 commit 37adb4c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion sql/sql_insert.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2615,7 +2615,7 @@ TABLE *Delayed_insert::get_local_table(THD* client_thd)
}
*field=0;

if (copy->versioned() && copy->vers_update_user_field())
if (copy->versioned() && copy->vers_update_user_field(client_thd->mem_root))
goto error;

if (share->virtual_fields || share->default_expressions ||
Expand Down
4 changes: 2 additions & 2 deletions sql/table.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Field **dst= (Field **) alloc_root(&mem_root,
Field **dst= (Field **) alloc_root(_mem_root ? _mem_root : &mem_root,
(s->fields - VERSIONING_FIELDS + 1) *
sizeof(Field*));
if (!dst)
Expand Down
2 changes: 1 addition & 1 deletion sql/table.h
Original file line number Diff line number Diff line change
Expand Up @@ -1488,7 +1488,7 @@ struct TABLE

Field **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 insert_all_rows_into_tmp_table(THD *thd,
Expand Down

0 comments on commit 37adb4c

Please sign in to comment.