summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorjoreland@mysql.com <>2005-01-10 11:20:01 +0100
committerjoreland@mysql.com <>2005-01-10 11:20:01 +0100
commit6331241cb3d6f8c05a2616676bca7c10da5bdca8 (patch)
treef1254feb11d2d58f94216457961f7998471cb777 /sql
parent7585b5cb6147d7f570f5480d1d57e97f24b4c05b (diff)
parentc9f7f0ffcf5f117f0f65fc9e375e13f394b0f87b (diff)
downloadmariadb-git-6331241cb3d6f8c05a2616676bca7c10da5bdca8.tar.gz
Merge joreland@bk-internal.mysql.com:/home/bk/mysql-4.1
into mysql.com:/home/jonas/src/mysql-4.1
Diffstat (limited to 'sql')
-rw-r--r--sql/sql_table.cc24
1 files changed, 13 insertions, 11 deletions
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index 43f466282b1..52f178946c4 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -3447,6 +3447,19 @@ copy_data_between_tables(TABLE *from,TABLE *to,
if (!(copy= new Copy_field[to->fields]))
DBUG_RETURN(-1); /* purecov: inspected */
+ /*
+ Turn off recovery logging since rollback of an alter table is to
+ delete the new table so there is no need to log the changes to it.
+
+ This needs to be done before external_lock
+ */
+ error= ha_enable_transaction(thd,FALSE);
+ if (error)
+ {
+ DBUG_RETURN(-1);
+ }
+
+
if (to->file->external_lock(thd, F_WRLCK))
DBUG_RETURN(-1);
from->file->info(HA_STATUS_VARIABLE);
@@ -3502,17 +3515,6 @@ copy_data_between_tables(TABLE *from,TABLE *to,
goto err;
};
- /*
- Turn off recovery logging since rollback of an alter table is to
- delete the new table so there is no need to log the changes to it.
- */
- error= ha_enable_transaction(thd,FALSE);
- if (error)
- {
- error= 1;
- goto err;
- }
-
/* Handler must be told explicitly to retrieve all columns, because
this function does not set field->query_id in the columns to the
current query id */