mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
bug#8151 - truncate leaves a transaction open
deadlock in MYSQL_LOG::new_file() style fixes
This commit is contained in:
@ -1606,7 +1606,12 @@ int handler::rename_table(const char * from, const char * to)
|
||||
}
|
||||
|
||||
/*
|
||||
Tell the handler to turn on or off transaction in the handler
|
||||
Tell the storage engine that it is allowed to "disable transaction" in the
|
||||
handler. It is a hint that ACID is not required - it is used in NDB for
|
||||
ALTER TABLE, for example, when data are copied to temporary table.
|
||||
A storage engine may treat this hint any way it likes. NDB for example
|
||||
starts to commit every now and then automatically.
|
||||
This hint can be safely ignored.
|
||||
*/
|
||||
|
||||
int ha_enable_transaction(THD *thd, bool on)
|
||||
@ -1616,7 +1621,15 @@ int ha_enable_transaction(THD *thd, bool on)
|
||||
DBUG_ENTER("ha_enable_transaction");
|
||||
thd->transaction.on= on;
|
||||
if (on)
|
||||
ha_commit(thd);
|
||||
{
|
||||
/*
|
||||
Now all storage engines should have transaction handling enabled.
|
||||
But some may have it enabled all the time - "disabling" transactions
|
||||
is an optimization hint that storage engine is free to ignore.
|
||||
So, let's commit an open transaction (if any) now.
|
||||
*/
|
||||
error= end_trans(thd, COMMIT);
|
||||
}
|
||||
DBUG_RETURN(error);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user