mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
MDEV-8075: DROP TEMPORARY TABLE not marked as ddl, causing optimistic parallel replication to fail
CREATE/DROP TEMPORARY TABLE are not safe to optimistically replicate in parallel with other transactions, so they need to be marked as "ddl" in the binlog. This was already done for stand-alone CREATE/DROP TEMPORARY. But temporary tables can also be created and dropped inside a BEGIN...END transaction, and such transactions were not marked as ddl. Nor was the DROP TEMPORARY TABLE statement emitted implicitly when a client connection is closed. So this patch adds such ddl mark for the missing cases. The difference to Kristian's original patch is mainly a fix in mysql_trans_commit_alter_copy_data() to remember the unsafe_rollback_flags over the temporary commit.
This commit is contained in:
@ -4360,6 +4360,15 @@ void select_create::store_values(List<Item> &values)
|
||||
bool select_create::send_eof()
|
||||
{
|
||||
DBUG_ENTER("select_create::send_eof");
|
||||
|
||||
/*
|
||||
The routine that writes the statement in the binary log
|
||||
is in select_insert::prepare_eof(). For that reason, we
|
||||
mark the flag at this point.
|
||||
*/
|
||||
if (table->s->tmp_table)
|
||||
thd->transaction.stmt.mark_created_temp_table();
|
||||
|
||||
if (prepare_eof())
|
||||
{
|
||||
abort_result_set();
|
||||
|
Reference in New Issue
Block a user