mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
bug#7761 - ndb does not autocommit during alter table
sql/sql_table.cc: Turn off transactions before locking (as locking will need to know)
This commit is contained in:
@ -3447,6 +3447,19 @@ copy_data_between_tables(TABLE *from,TABLE *to,
|
|||||||
if (!(copy= new Copy_field[to->fields]))
|
if (!(copy= new Copy_field[to->fields]))
|
||||||
DBUG_RETURN(-1); /* purecov: inspected */
|
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))
|
if (to->file->external_lock(thd, F_WRLCK))
|
||||||
DBUG_RETURN(-1);
|
DBUG_RETURN(-1);
|
||||||
from->file->info(HA_STATUS_VARIABLE);
|
from->file->info(HA_STATUS_VARIABLE);
|
||||||
@ -3502,17 +3515,6 @@ copy_data_between_tables(TABLE *from,TABLE *to,
|
|||||||
goto err;
|
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
|
/* Handler must be told explicitly to retrieve all columns, because
|
||||||
this function does not set field->query_id in the columns to the
|
this function does not set field->query_id in the columns to the
|
||||||
current query id */
|
current query id */
|
||||||
|
Reference in New Issue
Block a user