mirror of
https://github.com/MariaDB/server.git
synced 2025-09-02 09:41:40 +03:00
Reverted patch for new usage of open_count as it caused more problems than it solved
Cleaned up patch for checking locks for multi-table updates
This commit is contained in:
@@ -2209,11 +2209,7 @@ copy_data_between_tables(TABLE *from,TABLE *to,
|
||||
DBUG_RETURN(-1); /* purecov: inspected */
|
||||
|
||||
if (to->file->external_lock(thd, F_WRLCK))
|
||||
{
|
||||
/* We must always unlock, even when lock failed. */
|
||||
(void) to->file->external_lock(thd, F_UNLCK);
|
||||
DBUG_RETURN(-1);
|
||||
}
|
||||
to->file->extra(HA_EXTRA_WRITE_CACHE);
|
||||
from->file->info(HA_STATUS_VARIABLE);
|
||||
to->file->deactivate_non_unique_index(from->file->records);
|
||||
@@ -2313,11 +2309,11 @@ copy_data_between_tables(TABLE *from,TABLE *to,
|
||||
error=1;
|
||||
if (ha_commit(thd))
|
||||
error=1;
|
||||
|
||||
err:
|
||||
free_io_cache(from);
|
||||
*copied= found_count;
|
||||
*deleted=delete_count;
|
||||
/* we must always unlock the table on return. */
|
||||
if (to->file->external_lock(thd,F_UNLCK))
|
||||
error=1;
|
||||
DBUG_RETURN(error > 0 ? -1 : 0);
|
||||
|
Reference in New Issue
Block a user