Skip to content

Commit

Permalink
Remove MYSQL_REPLACE_TRX_IN_THD
Browse files Browse the repository at this point in the history
The method handlerton::replace_native_transaction_in_thd was added
into MySQL 5.7 in WL#6860, Binlogging XA-prepared transaction.
In MariaDB we do not have that change yet.
  • Loading branch information
dr-m committed Oct 2, 2017
1 parent cc3057f commit 387bdf0
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 48 deletions.
47 changes: 0 additions & 47 deletions storage/innobase/handler/ha_innodb.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2896,48 +2896,6 @@ check_trx_exists(
return(trx);
}

#ifdef MYSQL_REPLACE_TRX_IN_THD
/** InnoDB transaction object that is currently associated with THD is
replaced with that of the 2nd argument. The previous value is
returned through the 3rd argument's buffer, unless it's NULL. When
the buffer is not provided (value NULL) that should mean the caller
restores previously saved association so the current trx has to be
additionally freed from all association with MYSQL.

@param[in,out] thd MySQL thread handle
@param[in] new_trx_arg replacement trx_t
@param[in,out] ptr_trx_arg pointer to a buffer to store old trx_t */
static
void
innodb_replace_trx_in_thd(
THD* thd,
void* new_trx_arg,
void** ptr_trx_arg)
{
trx_t*& trx = thd_to_trx(thd);

ut_ad(new_trx_arg == NULL
|| (((trx_t*) new_trx_arg)->mysql_thd == thd
&& !((trx_t*) new_trx_arg)->is_recovered));

if (ptr_trx_arg) {
*ptr_trx_arg = trx;

ut_ad(trx == NULL
|| (trx->mysql_thd == thd && !trx->is_recovered));

} else if (trx->state == TRX_STATE_NOT_STARTED) {
ut_ad(thd == trx->mysql_thd);
trx_free_for_mysql(trx);
} else {
ut_ad(thd == trx->mysql_thd);
ut_ad(trx_state_eq(trx, TRX_STATE_PREPARED));
trx_disconnect_prepared(trx);
}
trx = static_cast<trx_t*>(new_trx_arg);
}
#endif /* MYSQL_REPLACE_TRX_IN_THD */

/*************************************************************************
Gets current trx. */
trx_t*
Expand Down Expand Up @@ -3839,11 +3797,6 @@ innobase_init(
innobase_hton->flags =
HTON_SUPPORTS_EXTENDED_KEYS | HTON_SUPPORTS_FOREIGN_KEYS;

#ifdef MYSQL_REPLACE_TRX_IN_THD
innobase_hton->replace_native_transaction_in_thd =
innodb_replace_trx_in_thd;
#endif

#ifdef WITH_WSREP
innobase_hton->abort_transaction=wsrep_abort_transaction;
innobase_hton->set_checkpoint=innobase_wsrep_set_checkpoint;
Expand Down
1 change: 0 additions & 1 deletion storage/innobase/include/ha_prototypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ class THD;
#undef MYSQL_FT_INIT_EXT
#undef MYSQL_PFS
#undef MYSQL_RENAME_INDEX
#undef MYSQL_REPLACE_TRX_IN_THD
#undef MYSQL_STORE_FTS_DOC_ID

/*******************************************************************//**
Expand Down

0 comments on commit 387bdf0

Please sign in to comment.