MCPcopy Create free account
hub / github.com/MariaDB/server / mysql_trans_commit_alter_copy_data

Function mysql_trans_commit_alter_copy_data

sql/sql_table.cc:12450–12477  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

12448*/
12449
12450bool mysql_trans_commit_alter_copy_data(THD *thd)
12451{
12452 bool error= FALSE;
12453 uint save_unsafe_rollback_flags;
12454 DBUG_ENTER("mysql_trans_commit_alter_copy_data");
12455
12456 /* Save flags as trans_commit_implicit are deleting them */
12457 save_unsafe_rollback_flags= thd->transaction->stmt.m_unsafe_rollback_flags;
12458
12459 DEBUG_SYNC(thd, "alter_table_copy_trans_commit");
12460
12461 if (ha_enable_transaction(thd, TRUE))
12462 DBUG_RETURN(TRUE);
12463
12464 /*
12465 Ensure that the new table is saved properly to disk before installing
12466 the new .frm.
12467 And that InnoDB's internal latches are released, to avoid deadlock
12468 when waiting on other instances of the table before rename (Bug#54747).
12469 */
12470 if (trans_commit_stmt(thd))
12471 error= TRUE;
12472 if (trans_commit_implicit(thd))
12473 error= TRUE;
12474
12475 thd->transaction->stmt.m_unsafe_rollback_flags= save_unsafe_rollback_flags;
12476 DBUG_RETURN(error);
12477}
12478
12479#ifdef HAVE_REPLICATION
12480/*

Callers 2

mysql_change_partitionsFunction · 0.85
copy_data_between_tablesFunction · 0.85

Calls 3

ha_enable_transactionFunction · 0.85
trans_commit_stmtFunction · 0.85
trans_commit_implicitFunction · 0.85

Tested by

no test coverage detected