summaryrefslogtreecommitdiff
path: root/sql/sql_table.cc
diff options
context:
space:
mode:
authormonty@mysql.com <>2004-10-06 01:25:55 +0300
committermonty@mysql.com <>2004-10-06 01:25:55 +0300
commit992b04d3d8073a933b3c0e1ab229edaf52ab5df6 (patch)
treed64d190d42d20c08e4499ef9df31759451dcfe13 /sql/sql_table.cc
parent7ce60487d9b21c5e7ea6a87be2896b8510d2fcc6 (diff)
parentc27d22b44e3ced4156da003fc23d8f5720ab2515 (diff)
downloadmariadb-git-992b04d3d8073a933b3c0e1ab229edaf52ab5df6.tar.gz
Merge bk-internal.mysql.com:/home/bk/mysql-4.0
into mysql.com:/home/my/mysql-4.0
Diffstat (limited to 'sql/sql_table.cc')
-rw-r--r--sql/sql_table.cc6
1 files changed, 1 insertions, 5 deletions
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index a15f8b65006..520cce23797 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -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);