mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
Merging revision 3839..3932 from codership-mysql/5.5.
This commit is contained in:
@@ -848,9 +848,9 @@ extern "C" const char *wsrep_thd_conflict_state_str(THD *thd)
|
||||
(thd->wsrep_conflict_state == CERT_FAILURE) ? "cert failure" : "void";
|
||||
}
|
||||
|
||||
extern "C" wsrep_trx_handle_t* wsrep_thd_trx_handle(THD *thd)
|
||||
extern "C" wsrep_ws_handle_t* wsrep_thd_ws_handle(THD *thd)
|
||||
{
|
||||
return &thd->wsrep_trx_handle;
|
||||
return &thd->wsrep_ws_handle;
|
||||
}
|
||||
|
||||
extern "C"void wsrep_thd_LOCK(THD *thd)
|
||||
@@ -875,7 +875,7 @@ extern "C" my_thread_id wsrep_thd_thread_id(THD *thd)
|
||||
}
|
||||
extern "C" wsrep_seqno_t wsrep_thd_trx_seqno(THD *thd)
|
||||
{
|
||||
return (thd) ? thd->wsrep_trx_seqno : WSREP_SEQNO_UNDEFINED;
|
||||
return (thd) ? thd->wsrep_trx_meta.gtid.seqno : WSREP_SEQNO_UNDEFINED;
|
||||
}
|
||||
extern "C" query_id_t wsrep_thd_query_id(THD *thd)
|
||||
{
|
||||
@@ -913,16 +913,16 @@ extern "C" void wsrep_thd_awake(THD* bf_thd, THD *thd, my_bool signal)
|
||||
extern "C" int
|
||||
wsrep_trx_order_before(void *thd1, void *thd2)
|
||||
{
|
||||
if (((THD*)thd1)->wsrep_trx_seqno < ((THD*)thd2)->wsrep_trx_seqno) {
|
||||
WSREP_DEBUG("BF conflict, order: %lld %lld\n",
|
||||
(long long)((THD*)thd1)->wsrep_trx_seqno,
|
||||
(long long)((THD*)thd2)->wsrep_trx_seqno);
|
||||
return 1;
|
||||
}
|
||||
WSREP_DEBUG("waiting for BF, trx order: %lld %lld\n",
|
||||
(long long)((THD*)thd1)->wsrep_trx_seqno,
|
||||
(long long)((THD*)thd2)->wsrep_trx_seqno);
|
||||
return 0;
|
||||
if (wsrep_thd_trx_seqno((THD*)thd1) < wsrep_thd_trx_seqno((THD*)thd2)) {
|
||||
WSREP_DEBUG("BF conflict, order: %lld %lld\n",
|
||||
(long long)wsrep_thd_trx_seqno((THD*)thd1),
|
||||
(long long)wsrep_thd_trx_seqno((THD*)thd2));
|
||||
return 1;
|
||||
}
|
||||
WSREP_DEBUG("waiting for BF, trx order: %lld %lld\n",
|
||||
(long long)wsrep_thd_trx_seqno((THD*)thd1),
|
||||
(long long)wsrep_thd_trx_seqno((THD*)thd2));
|
||||
return 0;
|
||||
}
|
||||
extern "C" int
|
||||
wsrep_trx_is_aborting(void *thd_ptr)
|
||||
@@ -1000,7 +1000,7 @@ THD::THD()
|
||||
wsrep_applier(is_applier),
|
||||
wsrep_applier_closing(FALSE),
|
||||
wsrep_client_thread(0),
|
||||
wsrep_trx_seqno(WSREP_SEQNO_UNDEFINED),
|
||||
wsrep_apply_toi(false),
|
||||
#endif
|
||||
m_parser_state(NULL),
|
||||
#if defined(ENABLED_DEBUG_SYNC)
|
||||
@@ -1104,9 +1104,8 @@ THD::THD()
|
||||
#ifdef WITH_WSREP
|
||||
mysql_mutex_init(key_LOCK_wsrep_thd, &LOCK_wsrep_thd, MY_MUTEX_INIT_FAST);
|
||||
mysql_cond_init(key_COND_wsrep_thd, &COND_wsrep_thd, NULL);
|
||||
wsrep_trx_handle.trx_id = WSREP_UNDEFINED_TRX_ID;
|
||||
wsrep_trx_handle.opaque = NULL;
|
||||
//wsrep_retry_autocommit= ::wsrep_retry_autocommit;
|
||||
wsrep_ws_handle.trx_id = WSREP_UNDEFINED_TRX_ID;
|
||||
wsrep_ws_handle.opaque = NULL;
|
||||
wsrep_retry_counter = 0;
|
||||
wsrep_PA_safe = true;
|
||||
wsrep_retry_query = NULL;
|
||||
@@ -1471,7 +1470,10 @@ void THD::init(void)
|
||||
wsrep_conflict_state= NO_CONFLICT;
|
||||
wsrep_query_state= QUERY_IDLE;
|
||||
wsrep_last_query_id= 0;
|
||||
wsrep_trx_meta.gtid= WSREP_GTID_UNDEFINED;
|
||||
wsrep_trx_meta.depends_on= WSREP_SEQNO_UNDEFINED;
|
||||
wsrep_converted_lock_session= false;
|
||||
//wsrep_retry_autocommit= ::wsrep_retry_autocommit;
|
||||
wsrep_retry_counter= 0;
|
||||
wsrep_rli= NULL;
|
||||
wsrep_PA_safe= true;
|
||||
@@ -2116,6 +2118,7 @@ void THD::cleanup_after_query()
|
||||
/* reset table map for multi-table update */
|
||||
table_map_for_update= 0;
|
||||
m_binlog_invoker= FALSE;
|
||||
/* reset replication info structure */
|
||||
|
||||
#ifndef EMBEDDED_LIBRARY
|
||||
if (rli_slave)
|
||||
@@ -4279,7 +4282,7 @@ extern "C" int thd_binlog_format(const MYSQL_THD thd)
|
||||
#else
|
||||
if (mysql_bin_log.is_open() && (thd->variables.option_bits & OPTION_BIN_LOG))
|
||||
#endif
|
||||
return (int) WSREP_FORMAT(thd->variables.binlog_format);
|
||||
return (int) WSREP_BINLOG_FORMAT(thd->variables.binlog_format);
|
||||
else
|
||||
return BINLOG_FORMAT_UNSPEC;
|
||||
}
|
||||
@@ -4839,7 +4842,7 @@ int THD::decide_logging_format(TABLE_LIST *tables)
|
||||
binlog by filtering rules.
|
||||
*/
|
||||
if (mysql_bin_log.is_open() && (variables.option_bits & OPTION_BIN_LOG) &&
|
||||
!(WSREP_FORMAT(variables.binlog_format) == BINLOG_FORMAT_STMT &&
|
||||
!(WSREP_BINLOG_FORMAT(variables.binlog_format) == BINLOG_FORMAT_STMT &&
|
||||
!binlog_filter->db_ok(db)))
|
||||
{
|
||||
/*
|
||||
@@ -5003,7 +5006,7 @@ int THD::decide_logging_format(TABLE_LIST *tables)
|
||||
*/
|
||||
my_error((error= ER_BINLOG_ROW_INJECTION_AND_STMT_ENGINE), MYF(0));
|
||||
}
|
||||
else if (WSREP_FORMAT(variables.binlog_format) == BINLOG_FORMAT_ROW &&
|
||||
else if (WSREP_BINLOG_FORMAT(variables.binlog_format) == BINLOG_FORMAT_ROW &&
|
||||
sqlcom_can_generate_row_events(this))
|
||||
{
|
||||
/*
|
||||
@@ -5032,7 +5035,7 @@ int THD::decide_logging_format(TABLE_LIST *tables)
|
||||
else
|
||||
{
|
||||
/* binlog_format = STATEMENT */
|
||||
if (WSREP_FORMAT(variables.binlog_format) == BINLOG_FORMAT_STMT)
|
||||
if (WSREP_BINLOG_FORMAT(variables.binlog_format) == BINLOG_FORMAT_STMT)
|
||||
{
|
||||
if (lex->is_stmt_row_injection())
|
||||
{
|
||||
@@ -5144,7 +5147,7 @@ int THD::decide_logging_format(TABLE_LIST *tables)
|
||||
"and binlog_filter->db_ok(db) = %d",
|
||||
mysql_bin_log.is_open(),
|
||||
(variables.option_bits & OPTION_BIN_LOG),
|
||||
WSREP_FORMAT(variables.binlog_format),
|
||||
WSREP_BINLOG_FORMAT(variables.binlog_format),
|
||||
binlog_filter->db_ok(db)));
|
||||
#endif
|
||||
|
||||
|
Reference in New Issue
Block a user