@ -1721,41 +1721,6 @@ innobase_reset_background_thd(MYSQL_THD thd)
}
#if 0
/**
Check if the transaction can be rolled back
@ param [ in ] requestor Session requesting the lock
@ param [ in ] holder Session that holds the lock
@ return the session that will be rolled back , null don ' t care */
THD *
thd_trx_arbitrate ( THD * requestor , THD * holder )
{
/* Non-user (thd==0) transactions by default can't rollback, in
practice DDL transactions should never rollback and that ' s because
they should never wait on table / record locks either */
ut_a ( holder ! = NULL ) ;
ut_a ( holder ! = requestor ) ;
THD * victim = thd_tx_arbitrate ( requestor , holder ) ;
ut_a ( victim = = NULL | | victim = = requestor | | victim = = holder ) ;
return ( victim ) ;
}
/**
@ param [ in ] thd Session to check
@ return the priority */
int
thd_trx_priority ( THD * thd )
{
return ( thd = = NULL ? 0 : thd_tx_priority ( thd ) ) ;
}
# endif
/******************************************************************/ /**
Check if the transaction is an auto - commit transaction . TRUE also
implies that it is a SELECT ( read - only ) transaction .
@ -2057,7 +2022,6 @@ convert_error_code_to_mysql(
case DB_RECORD_NOT_FOUND :
return ( HA_ERR_NO_ACTIVE_RECORD ) ;
case DB_FORCED_ABORT :
case DB_DEADLOCK :
/* Since we rolled back the whole transaction, we must
tell it also to MySQL so that MySQL knows to empty the
@ -2879,10 +2843,6 @@ check_trx_exists(
return trx ;
} else {
trx = innobase_trx_allocate ( thd ) ;
/* User trx can be forced to rollback,
so we unset the disable flag . */
ut_ad ( trx - > in_innodb & TRX_FORCE_ROLLBACK_DISABLE ) ;
trx - > in_innodb & = TRX_FORCE_ROLLBACK_MASK ;
thd_set_ha_data ( thd , innodb_hton_ptr , trx ) ;
return trx ;
}
@ -3094,11 +3054,8 @@ ha_innobase::update_thd(
trx_t * trx = check_trx_exists ( thd ) ;
TrxInInnoDB trx_in_innodb ( trx ) ;
ut_ad ( trx_in_innodb . is_aborted ( )
| | ( trx - > dict_operation_lock_mode = = 0
& & trx - > dict_operation = = TRX_DICT_OP_NONE ) ) ;
ut_ad ( trx - > dict_operation_lock_mode = = 0 ) ;
ut_ad ( trx - > dict_operation = = TRX_DICT_OP_NONE ) ;
if ( m_prebuilt - > trx ! = trx ) {
@ -3564,8 +3521,6 @@ ha_innobase::init_table_handle_for_HANDLER(void)
trx_start_if_not_started_xa ( m_prebuilt - > trx , false ) ;
TrxInInnoDB trx_in_innodb ( m_prebuilt - > trx ) ;
/* Assign a read view if the transaction does not have it yet */
trx_assign_read_view ( m_prebuilt - > trx ) ;
@ -4549,8 +4504,6 @@ innobase_start_trx_and_assign_read_view(
trx_t * trx = check_trx_exists ( thd ) ;
TrxInInnoDB trx_in_innodb ( trx ) ;
innobase_srv_conc_force_exit_innodb ( trx ) ;
/* The transaction should not be active yet, start it */
@ -4687,7 +4640,6 @@ innobase_commit_ordered(
DBUG_ASSERT ( hton = = innodb_hton_ptr ) ;
trx = check_trx_exists ( thd ) ;
TrxInInnoDB trx_in_innodb ( trx ) ;
if ( ! trx_is_registered_for_2pc ( trx ) & & trx_is_started ( trx ) ) {
/* We cannot throw error here; instead we will catch this error
@ -4731,16 +4683,6 @@ innobase_commit(
trx_t * trx = check_trx_exists ( thd ) ;
TrxInInnoDB trx_in_innodb ( trx ) ;
if ( trx_in_innodb . is_aborted ( ) ) {
innobase_rollback ( hton , thd , commit_trx ) ;
DBUG_RETURN ( convert_error_code_to_mysql (
DB_FORCED_ABORT , 0 , thd ) ) ;
}
ut_ad ( trx - > dict_operation_lock_mode = = 0 ) ;
ut_ad ( trx - > dict_operation = = TRX_DICT_OP_NONE ) ;
@ -4832,11 +4774,8 @@ innobase_rollback(
trx_t * trx = check_trx_exists ( thd ) ;
TrxInInnoDB trx_in_innodb ( trx ) ;
ut_ad ( trx_in_innodb . is_aborted ( )
| | ( trx - > dict_operation_lock_mode = = 0
& & trx - > dict_operation = = TRX_DICT_OP_NONE ) ) ;
ut_ad ( trx - > dict_operation_lock_mode = = 0 ) ;
ut_ad ( trx - > dict_operation = = TRX_DICT_OP_NONE ) ;
innobase_srv_conc_force_exit_innodb ( trx ) ;
@ -4847,10 +4786,7 @@ innobase_rollback(
/* If we had reserved the auto-inc lock for some table (if
we come here to roll back the latest SQL statement ) we
release it now before a possibly lengthy rollback */
if ( ! trx_in_innodb . is_aborted ( ) ) {
lock_unlock_table_autoinc ( trx ) ;
}
lock_unlock_table_autoinc ( trx ) ;
/* This is a statement level variable. */
@ -4863,18 +4799,6 @@ innobase_rollback(
error = trx_rollback_for_mysql ( trx ) ;
if ( trx - > state = = TRX_STATE_FORCED_ROLLBACK ) {
# ifndef DBUG_OFF
char buffer [ 1024 ] ;
DBUG_LOG ( " trx " , " Forced rollback: "
< < thd_get_error_context_description (
thd , buffer , sizeof buffer , 512 ) ) ;
# endif /* !DBUG_OFF */
trx - > state = TRX_STATE_NOT_STARTED ;
}
trx_deregister_from_2pc ( trx ) ;
} else {
@ -4901,9 +4825,7 @@ innobase_rollback_trx(
/* If we had reserved the auto-inc lock for some table (if
we come here to roll back the latest SQL statement ) we
release it now before a possibly lengthy rollback */
if ( ! TrxInInnoDB : : is_aborted ( trx ) ) {
lock_unlock_table_autoinc ( trx ) ;
}
lock_unlock_table_autoinc ( trx ) ;
if ( ! trx - > has_logged ( ) ) {
trx - > will_lock = 0 ;
@ -5075,8 +4997,6 @@ innobase_rollback_to_savepoint(
trx_t * trx = check_trx_exists ( thd ) ;
TrxInInnoDB trx_in_innodb ( trx ) ;
innobase_srv_conc_force_exit_innodb ( trx ) ;
/* TODO: use provided savepoint data area to store savepoint data */
@ -5117,8 +5037,6 @@ innobase_rollback_to_savepoint_can_release_mdl(
trx_t * trx = check_trx_exists ( thd ) ;
TrxInInnoDB trx_in_innodb ( trx ) ;
/* If transaction has not acquired any locks then it is safe
to release MDL after rollback to savepoint */
if ( UT_LIST_GET_LEN ( trx - > lock . trx_locks ) = = 0 ) {
@ -5152,8 +5070,6 @@ innobase_release_savepoint(
trx = check_trx_exists ( thd ) ;
TrxInInnoDB trx_in_innodb ( trx ) ;
/* TODO: use provided savepoint data area to store savepoint data */
longlong2str ( ( ulint ) savepoint , name , 36 ) ;
@ -5187,8 +5103,6 @@ innobase_savepoint(
trx_t * trx = check_trx_exists ( thd ) ;
TrxInInnoDB trx_in_innodb ( trx ) ;
innobase_srv_conc_force_exit_innodb ( trx ) ;
/* Cannot happen outside of transaction */
@ -5224,7 +5138,6 @@ innobase_close_connection(
DBUG_ASSERT ( hton = = innodb_hton_ptr ) ;
trx_t * trx = thd_to_trx ( thd ) ;
bool free_trx = false ;
/* During server initialization MySQL layer will try to open
some of the master - slave tables those residing in InnoDB .
@ -5241,16 +5154,6 @@ innobase_close_connection(
if ( trx ) {
TrxInInnoDB trx_in_innodb ( trx ) ;
if ( trx_in_innodb . is_aborted ( ) ) {
while ( trx_is_started ( trx ) ) {
os_thread_sleep ( 20 ) ;
}
}
if ( ! trx_is_registered_for_2pc ( trx ) & & trx_is_started ( trx ) ) {
sql_print_error ( " Transaction not registered for MariaDB 2PC, "
@ -5268,9 +5171,8 @@ innobase_close_connection(
if ( trx - > has_logged_persistent ( ) ) {
trx_disconnect_prepared ( trx ) ;
} else {
trx_rollback_for_mysql ( trx ) ;
trx_deregister_from_2pc ( trx ) ;
free_trx = tru e;
goto rollback_and_fre e;
}
} else {
sql_print_warning (
@ -5278,24 +5180,15 @@ innobase_close_connection(
" InnoDB transaction. " TRX_ID_FMT " row modifications "
" will roll back. " ,
trx - > undo_no ) ;
ut_d ( ib : : warn ( )
< < " trx: " < < trx < < " started on: "
< < innobase_basename ( trx - > start_file )
< < " : " < < trx - > start_line ) ;
innobase_rollback_trx ( trx ) ;
free_trx = true ;
goto rollback_and_free ;
}
} else {
rollback_and_free :
innobase_rollback_trx ( trx ) ;
free_trx = true ;
trx_free_for_mysql ( trx ) ;
}
}
/* Free trx only after TrxInInnoDB is deleted. */
if ( free_trx ) {
trx_free_for_mysql ( trx ) ;
}
DBUG_RETURN ( 0 ) ;
}
@ -8320,15 +8213,6 @@ ha_innobase::write_row(
DBUG_ENTER ( " ha_innobase::write_row " ) ;
trx_t * trx = thd_to_trx ( m_user_thd ) ;
TrxInInnoDB trx_in_innodb ( trx ) ;
if ( trx_in_innodb . is_aborted ( ) ) {
innobase_rollback ( ht , m_user_thd , false ) ;
DBUG_RETURN ( convert_error_code_to_mysql (
DB_FORCED_ABORT , 0 , m_user_thd ) ) ;
}
/* Validation checks before we commence write_row operation. */
if ( high_level_read_only ) {
@ -9161,14 +9045,6 @@ ha_innobase::update_row(
goto func_exit ;
}
if ( TrxInInnoDB : : is_aborted ( trx ) ) {
innobase_rollback ( ht , m_user_thd , false ) ;
DBUG_RETURN ( convert_error_code_to_mysql (
DB_FORCED_ABORT , 0 , m_user_thd ) ) ;
}
/* This is not a delete */
m_prebuilt - > upd_node - > is_delete = FALSE ;
@ -9258,18 +9134,9 @@ ha_innobase::delete_row(
{
dberr_t error ;
trx_t * trx = thd_to_trx ( m_user_thd ) ;
TrxInInnoDB trx_in_innodb ( trx ) ;
DBUG_ENTER ( " ha_innobase::delete_row " ) ;
if ( trx_in_innodb . is_aborted ( ) ) {
innobase_rollback ( ht , m_user_thd , false ) ;
DBUG_RETURN ( convert_error_code_to_mysql (
DB_FORCED_ABORT , 0 , m_user_thd ) ) ;
}
ut_a ( m_prebuilt - > trx = = trx ) ;
if ( high_level_read_only ) {
@ -9340,19 +9207,7 @@ ha_innobase::unlock_row(void)
DBUG_VOID_RETURN ;
}
TrxInInnoDB trx_in_innodb ( m_prebuilt - > trx ) ;
if ( trx_in_innodb . is_aborted ( ) ) {
DBUG_VOID_RETURN ;
}
/* Ideally, this assert must be in the beginning of the function.
But there are some calls to this function from the SQL layer when the
transaction is in state TRX_STATE_NOT_STARTED . The check on
m_prebuilt - > select_lock_type above gets around this issue . */
ut_ad ( trx_state_eq ( m_prebuilt - > trx , TRX_STATE_ACTIVE , true )
| | trx_state_eq ( m_prebuilt - > trx , TRX_STATE_FORCED_ROLLBACK , true ) ) ;
ut_ad ( trx_state_eq ( m_prebuilt - > trx , TRX_STATE_ACTIVE , true ) ) ;
switch ( m_prebuilt - > row_read_type ) {
case ROW_READ_WITH_LOCKS :
@ -9634,14 +9489,6 @@ ha_innobase::index_read(
innobase_srv_conc_enter_innodb ( m_prebuilt ) ;
if ( TrxInInnoDB : : is_aborted ( m_prebuilt - > trx ) ) {
innobase_rollback ( ht , m_user_thd , false ) ;
DBUG_RETURN ( convert_error_code_to_mysql (
DB_FORCED_ABORT , 0 , m_user_thd ) ) ;
}
ret = row_search_mvcc (
buf , mode , m_prebuilt , match_mode , 0 ) ;
@ -9822,16 +9669,6 @@ ha_innobase::change_active_index(
ut_ad ( m_user_thd = = ha_thd ( ) ) ;
ut_a ( m_prebuilt - > trx = = thd_to_trx ( m_user_thd ) ) ;
TrxInInnoDB trx_in_innodb ( m_prebuilt - > trx ) ;
if ( trx_in_innodb . is_aborted ( ) ) {
innobase_rollback ( ht , m_user_thd , false ) ;
DBUG_RETURN ( convert_error_code_to_mysql (
DB_FORCED_ABORT , 0 , m_user_thd ) ) ;
}
active_index = keynr ;
m_prebuilt - > index = innobase_get_index ( keynr ) ;
@ -9950,14 +9787,6 @@ ha_innobase::general_fetch(
ut_ad ( trx = = thd_to_trx ( m_user_thd ) ) ;
if ( TrxInInnoDB : : is_aborted ( trx ) ) {
innobase_rollback ( ht , m_user_thd , false ) ;
DBUG_RETURN ( convert_error_code_to_mysql (
DB_FORCED_ABORT , 0 , m_user_thd ) ) ;
}
if ( m_prebuilt - > table - > is_readable ( ) ) {
} else if ( m_prebuilt - > table - > corrupted ) {
DBUG_RETURN ( HA_ERR_CRASHED ) ;
@ -10124,7 +9953,6 @@ ha_innobase::rnd_init(
/*==================*/
bool scan ) /*!< in: true if table/index scan FALSE otherwise */
{
TrxInInnoDB trx_in_innodb ( m_prebuilt - > trx ) ;
int err ;
/* Store the active index value so that we can restore the original
@ -10174,8 +10002,6 @@ ha_innobase::rnd_next(
DBUG_ENTER ( " rnd_next " ) ;
TrxInInnoDB trx_in_innodb ( m_prebuilt - > trx ) ;
if ( m_start_of_scan ) {
error = index_first ( buf ) ;
@ -10299,21 +10125,6 @@ ha_innobase::ft_init_ext(
trx_t * trx = m_prebuilt - > trx ;
TrxInInnoDB trx_in_innodb ( trx ) ;
if ( trx_in_innodb . is_aborted ( ) ) {
innobase_rollback ( ht , m_user_thd , false ) ;
int err ;
err = convert_error_code_to_mysql (
DB_FORCED_ABORT , 0 , m_user_thd ) ;
my_error ( err , MYF ( 0 ) ) ;
return ( NULL ) ;
}
/* FTS queries are not treated as autocommit non-locking selects.
This is because the FTS implementation can acquire locks behind
the scenes . This has not been verified but it is safer to treat
@ -10455,16 +10266,6 @@ ha_innobase::ft_read(
/*=================*/
uchar * buf ) /*!< in/out: buf contain result row */
{
TrxInInnoDB trx_in_innodb ( m_prebuilt - > trx ) ;
if ( trx_in_innodb . is_aborted ( ) ) {
innobase_rollback ( ht , m_user_thd , false ) ;
return ( convert_error_code_to_mysql (
DB_FORCED_ABORT , 0 , m_user_thd ) ) ;
}
row_prebuilt_t * ft_prebuilt ;
ft_prebuilt = reinterpret_cast < NEW_FT_INFO * > ( ft_handler ) - > ft_prebuilt ;
@ -13268,15 +13069,6 @@ ha_innobase::discard_or_import_tablespace(
DBUG_RETURN ( HA_ERR_TABLE_NEEDS_UPGRADE ) ;
}
TrxInInnoDB trx_in_innodb ( m_prebuilt - > trx ) ;
if ( trx_in_innodb . is_aborted ( ) ) {
innobase_rollback ( ht , m_user_thd , false ) ;
DBUG_RETURN ( convert_error_code_to_mysql (
DB_FORCED_ABORT , 0 , m_user_thd ) ) ;
}
trx_start_if_not_started ( m_prebuilt - > trx , true ) ;
/* Obtain an exclusive lock on the table. */
@ -13376,8 +13168,6 @@ ha_innobase::truncate()
update_thd ( ha_thd ( ) ) ;
TrxInInnoDB trx_in_innodb ( m_prebuilt - > trx ) ;
if ( ! trx_is_started ( m_prebuilt - > trx ) ) {
+ + m_prebuilt - > trx - > will_lock ;
}
@ -13452,8 +13242,6 @@ ha_innobase::delete_table(
trx_t * parent_trx = check_trx_exists ( thd ) ;
TrxInInnoDB trx_in_innodb ( parent_trx ) ;
/* Remove the to-be-dropped table from the list of modified tables
by parent_trx . Otherwise we may end up with an orphaned pointer to
the table object from parent_trx : : mod_tables . This could happen in :
@ -13697,8 +13485,6 @@ innobase_rename_table(
DEBUG_SYNC_C ( " innodb_rename_table_ready " ) ;
TrxInInnoDB trx_in_innodb ( trx ) ;
trx_start_if_not_started ( trx , true ) ;
/* Serialize data dictionary operations with dictionary mutex:
@ -13790,13 +13576,6 @@ ha_innobase::rename_table(
DBUG_RETURN ( HA_ERR_TABLE_READONLY ) ;
}
/* Get the transaction associated with the current thd, or create one
if not yet created */
trx_t * parent_trx = check_trx_exists ( thd ) ;
TrxInInnoDB trx_in_innodb ( parent_trx ) ;
trx_t * trx = innobase_trx_allocate ( thd ) ;
/* We are doing a DDL operation. */
@ -13880,8 +13659,6 @@ ha_innobase::records_in_range(
m_prebuilt - > trx - > op_info = " estimating records in index range " ;
TrxInInnoDB trx_in_innodb ( m_prebuilt - > trx ) ;
active_index = keynr ;
key = table - > key_info + active_index ;
@ -14013,8 +13790,6 @@ ha_innobase::estimate_rows_upper_bound()
update_thd ( ha_thd ( ) ) ;
TrxInInnoDB trx_in_innodb ( m_prebuilt - > trx ) ;
m_prebuilt - > trx - > op_info = " calculating upper bound for table rows " ;
index = dict_table_get_first_index ( m_prebuilt - > table ) ;
@ -14856,8 +14631,6 @@ ha_innobase::optimize(
HA_CHECK_OPT * check_opt ) /*!< in: currently ignored */
{
TrxInInnoDB trx_in_innodb ( m_prebuilt - > trx ) ;
/* FTS-FIXME: Since MySQL doesn't support engine-specific commands,
we have to hijack some existing command in order to be able to test
the new admin commands added in InnoDB ' s FTS support . For now , we
@ -14926,8 +14699,6 @@ ha_innobase::check(
ut_a ( m_prebuilt - > trx - > magic_n = = TRX_MAGIC_N ) ;
ut_a ( m_prebuilt - > trx = = thd_to_trx ( thd ) ) ;
TrxInInnoDB trx_in_innodb ( m_prebuilt - > trx ) ;
if ( m_prebuilt - > mysql_template = = NULL ) {
/* Build the template; we will use a dummy template
in index scans done in checking */
@ -15418,8 +15189,6 @@ ha_innobase::get_foreign_key_list(
{
update_thd ( ha_thd ( ) ) ;
TrxInInnoDB trx_in_innodb ( m_prebuilt - > trx ) ;
m_prebuilt - > trx - > op_info = " getting list of foreign keys " ;
mutex_enter ( & dict_sys - > mutex ) ;
@ -15458,8 +15227,6 @@ ha_innobase::get_parent_foreign_key_list(
{
update_thd ( ha_thd ( ) ) ;
TrxInInnoDB trx_in_innodb ( m_prebuilt - > trx ) ;
m_prebuilt - > trx - > op_info = " getting list of referencing foreign keys " ;
mutex_enter ( & dict_sys - > mutex ) ;
@ -15556,8 +15323,6 @@ ha_innobase::get_cascade_foreign_key_table_list(
THD * thd ,
List < st_handler_tablename > * fk_table_list )
{
TrxInInnoDB trx_in_innodb ( m_prebuilt - > trx ) ;
m_prebuilt - > trx - > op_info = " getting cascading foreign keys " ;
std : : list < table_list_item , ut_allocator < table_list_item > > table_list ;
@ -15807,15 +15572,6 @@ ha_innobase::end_stmt()
/* This is a statement level counter. */
m_prebuilt - > autoinc_last_value = 0 ;
/* This transaction had called ha_innobase::start_stmt() */
trx_t * trx = m_prebuilt - > trx ;
if ( trx - > lock . start_stmt ) {
TrxInInnoDB : : end_stmt ( trx ) ;
trx - > lock . start_stmt = false ;
}
return ( 0 ) ;
}
@ -15855,8 +15611,6 @@ ha_innobase::start_stmt(
ut_ad ( m_prebuilt - > table ! = NULL ) ;
TrxInInnoDB trx_in_innodb ( trx ) ;
trx = m_prebuilt - > trx ;
innobase_srv_conc_force_exit_innodb ( trx ) ;
@ -15929,14 +15683,6 @@ ha_innobase::start_stmt(
+ + trx - > will_lock ;
}
/* Only do it once per transaction. */
if ( ! trx - > lock . start_stmt & & lock_type ! = TL_UNLOCK ) {
TrxInInnoDB : : begin_stmt ( trx ) ;
trx - > lock . start_stmt = true ;
}
DBUG_RETURN ( 0 ) ;
}
@ -16167,13 +15913,8 @@ ha_innobase::external_lock(
+ + trx - > will_lock ;
}
TrxInInnoDB : : begin_stmt ( trx ) ;
DBUG_RETURN ( 0 ) ;
} else {
TrxInInnoDB : : end_stmt ( trx ) ;
DEBUG_SYNC_C ( " ha_innobase_end_statement " ) ;
}
@ -16268,8 +16009,6 @@ innodb_show_status(
innobase_srv_conc_force_exit_innodb ( trx ) ;
TrxInInnoDB trx_in_innodb ( trx ) ;
/* We let the InnoDB Monitor to output at most MAX_STATUS_SIZE
bytes of text . */
@ -16854,8 +16593,6 @@ ha_innobase::store_lock(
trx_t * trx = check_trx_exists ( thd ) ;
TrxInInnoDB trx_in_innodb ( trx ) ;
/* NOTE: MySQL can call this function with lock 'type' TL_IGNORE!
Be careful to ignore TL_IGNORE if we are going to do something with
only ' real ' locks ! */
@ -17176,8 +16913,6 @@ ha_innobase::get_auto_increment(
trx = m_prebuilt - > trx ;
TrxInInnoDB trx_in_innodb ( trx ) ;
/* Note: We can't rely on *first_value since some MySQL engines,
in particular the partition engine , don ' t initialize it to 0 when
invoking this method . So we are not sure if it ' s guaranteed to
@ -17578,16 +17313,6 @@ innobase_xa_prepare(
innobase_srv_conc_force_exit_innodb ( trx ) ;
TrxInInnoDB trx_in_innodb ( trx ) ;
if ( trx_in_innodb . is_aborted ( ) ) {
innobase_rollback ( hton , thd , prepare_trx ) ;
return ( convert_error_code_to_mysql (
DB_FORCED_ABORT , 0 , thd ) ) ;
}
if ( ! trx_is_registered_for_2pc ( trx ) & & trx_is_started ( trx ) ) {
sql_print_error ( " Transaction not registered for MariaDB 2PC, "
@ -17602,18 +17327,7 @@ innobase_xa_prepare(
ut_ad ( trx_is_registered_for_2pc ( trx ) ) ;
dberr_t err = trx_prepare_for_mysql ( trx ) ;
ut_ad ( err = = DB_SUCCESS | | err = = DB_FORCED_ABORT ) ;
if ( err = = DB_FORCED_ABORT ) {
innobase_rollback ( hton , thd , prepare_trx ) ;
return ( convert_error_code_to_mysql (
DB_FORCED_ABORT , 0 , thd ) ) ;
}
trx_prepare_for_mysql ( trx ) ;
} else {
/* We just mark the SQL statement ended and do not do a
transaction prepare */
@ -17690,14 +17404,10 @@ innobase_commit_by_xid(
}
if ( trx_t * trx = trx_get_trx_by_xid ( xid ) ) {
ut_ad ( trx - > in_innodb & TRX_FORCE_ROLLBACK_DISABLE ) ;
/* use cases are: disconnected xa, slave xa, recovery */
{
TrxInInnoDB trx_in_innodb ( trx ) ;
innobase_commit_low ( trx ) ;
ut_ad ( trx - > mysql_thd = = NULL ) ;
trx_deregister_from_2pc ( trx ) ;
}
innobase_commit_low ( trx ) ;
ut_ad ( trx - > mysql_thd = = NULL ) ;
trx_deregister_from_2pc ( trx ) ;
ut_ad ( ! trx - > will_lock ) ; /* trx cache requirement */
trx_free_for_background ( trx ) ;
@ -17726,14 +17436,9 @@ innobase_rollback_by_xid(
}
if ( trx_t * trx = trx_get_trx_by_xid ( xid ) ) {
int ret ;
ut_ad ( trx - > in_innodb & TRX_FORCE_ROLLBACK_DISABLE ) ;
{
TrxInInnoDB trx_in_innodb ( trx ) ;
ret = innobase_rollback_trx ( trx ) ;
trx_deregister_from_2pc ( trx ) ;
ut_ad ( ! trx - > will_lock ) ;
}
int ret = innobase_rollback_trx ( trx ) ;
trx_deregister_from_2pc ( trx ) ;
ut_ad ( ! trx - > will_lock ) ;
trx_free_for_background ( trx ) ;
return ( ret ) ;