Commit 42ed7740 authored by Konstantin Osipov's avatar Konstantin Osipov

Partial backport of:

-----------------------------------------------------------
2497.392.1 Michael Widenius	2008-08-19
Fixes for Bug #38016 Maria: trying to access freed memory when
committing a transaction.
Don't write out states if they haven't changed.


sql/sql_table.cc:
  Call extra(HA_EXTRA_PREPARE_FOR_RENAME) before renaming a table.
parent 1a122dc2
......@@ -7645,7 +7645,7 @@ copy_data_between_tables(TABLE *from,TABLE *to,
if (to->file->ha_end_bulk_insert() && error <= 0)
{
to->file->print_error(my_errno,MYF(0));
error=1;
error= 1;
}
to->file->extra(HA_EXTRA_NO_IGNORE_DUP_KEY);
......@@ -7673,6 +7673,8 @@ copy_data_between_tables(TABLE *from,TABLE *to,
to->file->ha_release_auto_increment();
if (to->file->ha_external_lock(thd,F_UNLCK))
error=1;
if (error < 0 && to->file->extra(HA_EXTRA_PREPARE_FOR_RENAME))
error= 1;
DBUG_RETURN(error > 0 ? -1 : 0);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment