mirror of
https://github.com/MariaDB/server.git
synced 2025-08-05 13:16:09 +03:00
Merge tag '11.1' into 11.2
MariaDB 11.1.3 release
This commit is contained in:
@@ -710,6 +710,7 @@ THD::THD(my_thread_id id, bool is_wsrep_applier)
|
||||
wsrep_ignore_table(false),
|
||||
wsrep_aborter(0),
|
||||
wsrep_delayed_BF_abort(false),
|
||||
wsrep_ctas(false),
|
||||
|
||||
/* wsrep-lib */
|
||||
m_wsrep_next_trx_id(WSREP_UNDEFINED_TRX_ID),
|
||||
@@ -1228,6 +1229,7 @@ const Type_handler *THD::type_handler_for_datetime() const
|
||||
void THD::init()
|
||||
{
|
||||
DBUG_ENTER("thd::init");
|
||||
mdl_context.reset();
|
||||
mysql_mutex_lock(&LOCK_global_system_variables);
|
||||
plugin_thdvar_init(this);
|
||||
/*
|
||||
@@ -4708,7 +4710,7 @@ extern "C" enum thd_kill_levels thd_kill_level(const MYSQL_THD thd)
|
||||
if (unlikely(apc_target->have_apc_requests()))
|
||||
{
|
||||
if (thd == current_thd)
|
||||
apc_target->process_apc_requests();
|
||||
apc_target->process_apc_requests(false);
|
||||
}
|
||||
return THD_IS_NOT_KILLED;
|
||||
}
|
||||
@@ -5560,7 +5562,7 @@ extern "C" int thd_binlog_format(const MYSQL_THD thd)
|
||||
if (WSREP(thd))
|
||||
{
|
||||
/* for wsrep binlog format is meaningful also when binlogging is off */
|
||||
return (int) WSREP_BINLOG_FORMAT(thd->variables.binlog_format);
|
||||
return (int) thd->wsrep_binlog_format(thd->variables.binlog_format);
|
||||
}
|
||||
|
||||
if (mysql_bin_log.is_open() && (thd->variables.option_bits & OPTION_BIN_LOG))
|
||||
@@ -6338,11 +6340,14 @@ int THD::decide_logging_format(TABLE_LIST *tables)
|
||||
|
||||
reset_binlog_local_stmt_filter();
|
||||
|
||||
// Used binlog format
|
||||
ulong binlog_format= wsrep_binlog_format(variables.binlog_format);
|
||||
/*
|
||||
We should not decide logging format if the binlog is closed or
|
||||
binlogging is off, or if the statement is filtered out from the
|
||||
binlog by filtering rules.
|
||||
*/
|
||||
|
||||
#ifdef WITH_WSREP
|
||||
if (WSREP_CLIENT_NNULL(this) &&
|
||||
wsrep_thd_is_local(this) &&
|
||||
@@ -6357,6 +6362,27 @@ int THD::decide_logging_format(TABLE_LIST *tables)
|
||||
DBUG_RETURN(-1);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
If user has configured wsrep_forced_binlog_format to
|
||||
STMT OR MIXED and used binlog_format would be same
|
||||
and this is CREATE TABLE AS SELECT we will fall back
|
||||
to ROW.
|
||||
*/
|
||||
if (wsrep_forced_binlog_format < BINLOG_FORMAT_ROW &&
|
||||
wsrep_ctas)
|
||||
{
|
||||
if (!get_stmt_da()->has_sql_condition(ER_UNKNOWN_ERROR))
|
||||
{
|
||||
push_warning_printf(this, Sql_condition::WARN_LEVEL_WARN,
|
||||
ER_UNKNOWN_ERROR,
|
||||
"Galera does not support wsrep_forced_binlog_format = %s "
|
||||
"in CREATE TABLE AS SELECT",
|
||||
wsrep_forced_binlog_format == BINLOG_FORMAT_STMT ?
|
||||
"STMT" : "MIXED");
|
||||
}
|
||||
set_current_stmt_binlog_format_row();
|
||||
}
|
||||
#endif /* WITH_WSREP */
|
||||
|
||||
if (WSREP_EMULATE_BINLOG_NNULL(this) ||
|
||||
@@ -6364,7 +6390,7 @@ int THD::decide_logging_format(TABLE_LIST *tables)
|
||||
{
|
||||
if (is_bulk_op())
|
||||
{
|
||||
if (wsrep_binlog_format() == BINLOG_FORMAT_STMT)
|
||||
if (binlog_format == BINLOG_FORMAT_STMT)
|
||||
{
|
||||
my_error(ER_BINLOG_NON_SUPPORTED_BULK, MYF(0));
|
||||
DBUG_PRINT("info",
|
||||
@@ -6582,7 +6608,7 @@ int THD::decide_logging_format(TABLE_LIST *tables)
|
||||
prev_access_table= table;
|
||||
}
|
||||
|
||||
if (wsrep_binlog_format() != BINLOG_FORMAT_ROW)
|
||||
if (binlog_format != BINLOG_FORMAT_ROW)
|
||||
{
|
||||
/*
|
||||
DML statements that modify a table with an auto_increment
|
||||
@@ -6666,7 +6692,7 @@ int THD::decide_logging_format(TABLE_LIST *tables)
|
||||
*/
|
||||
my_error((error= ER_BINLOG_ROW_INJECTION_AND_STMT_ENGINE), MYF(0));
|
||||
}
|
||||
else if ((wsrep_binlog_format() == BINLOG_FORMAT_ROW || is_bulk_op()) &&
|
||||
else if ((binlog_format == BINLOG_FORMAT_ROW || is_bulk_op()) &&
|
||||
sqlcom_can_generate_row_events(this))
|
||||
{
|
||||
/*
|
||||
@@ -6696,7 +6722,7 @@ int THD::decide_logging_format(TABLE_LIST *tables)
|
||||
else
|
||||
{
|
||||
/* binlog_format = STATEMENT */
|
||||
if (wsrep_binlog_format() == BINLOG_FORMAT_STMT)
|
||||
if (binlog_format == BINLOG_FORMAT_STMT)
|
||||
{
|
||||
if (lex->is_stmt_row_injection())
|
||||
{
|
||||
@@ -6840,7 +6866,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),
|
||||
(uint) wsrep_binlog_format(),
|
||||
(uint) binlog_format,
|
||||
binlog_filter->db_ok(db.str)));
|
||||
if (WSREP_NNULL(this) && is_current_stmt_binlog_format_row())
|
||||
binlog_prepare_for_row_logging();
|
||||
@@ -6877,7 +6903,7 @@ int THD::decide_logging_format(TABLE_LIST *tables)
|
||||
void THD::reconsider_logging_format_for_iodup(TABLE *table)
|
||||
{
|
||||
DBUG_ENTER("reconsider_logging_format_for_iodup");
|
||||
enum_binlog_format bf= (enum_binlog_format) wsrep_binlog_format();
|
||||
enum_binlog_format bf= (enum_binlog_format) wsrep_binlog_format(variables.binlog_format);
|
||||
|
||||
DBUG_ASSERT(lex->duplicates == DUP_UPDATE);
|
||||
|
||||
@@ -6942,7 +6968,7 @@ bool THD::binlog_table_should_be_logged(const LEX_CSTRING *db)
|
||||
{
|
||||
return (mysql_bin_log.is_open() &&
|
||||
(variables.option_bits & OPTION_BIN_LOG) &&
|
||||
(wsrep_binlog_format() != BINLOG_FORMAT_STMT ||
|
||||
(wsrep_binlog_format(variables.binlog_format) != BINLOG_FORMAT_STMT ||
|
||||
binlog_filter->db_ok(db->str)));
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user