Skip to content

Commit 10f41d7

Browse files
author
joreland@mysql.com
committed
merge
2 parents b4c2511 + 4ddd79f commit 10f41d7

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

sql/sql_table.cc

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3588,6 +3588,16 @@ copy_data_between_tables(TABLE *from,TABLE *to,
35883588
ulong save_sql_mode;
35893589
DBUG_ENTER("copy_data_between_tables");
35903590

3591+
/*
3592+
Turn off recovery logging since rollback of an alter table is to
3593+
delete the new table so there is no need to log the changes to it.
3594+
3595+
This needs to be done before external_lock
3596+
*/
3597+
error= ha_enable_transaction(thd, FALSE);
3598+
if (error)
3599+
DBUG_RETURN(-1);
3600+
35913601
if (!(copy= new Copy_field[to->s->fields]))
35923602
DBUG_RETURN(-1); /* purecov: inspected */
35933603

@@ -3646,17 +3656,6 @@ copy_data_between_tables(TABLE *from,TABLE *to,
36463656
goto err;
36473657
};
36483658

3649-
/*
3650-
Turn off recovery logging since rollback of an alter table is to
3651-
delete the new table so there is no need to log the changes to it.
3652-
*/
3653-
error= ha_enable_transaction(thd,FALSE);
3654-
if (error)
3655-
{
3656-
error= 1;
3657-
goto err;
3658-
}
3659-
36603659
/* Handler must be told explicitly to retrieve all columns, because
36613660
this function does not set field->query_id in the columns to the
36623661
current query id */

0 commit comments

Comments
 (0)