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

Method decide_logging_format

sql/sql_class.cc:6894–7455  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6892*/
6893
6894int THD::decide_logging_format(TABLE_LIST *tables)
6895{
6896 DBUG_ENTER("THD::decide_logging_format");
6897 DBUG_PRINT("info", ("Query: %.*s", (uint) query_length(), query()));
6898 DBUG_PRINT("info", ("binlog_format: %lu", (ulong) variables.binlog_format));
6899 DBUG_PRINT("info", ("current_stmt_binlog_format: %lu",
6900 (ulong) current_stmt_binlog_format));
6901 DBUG_PRINT("info", ("lex->get_stmt_unsafe_flags(): 0x%x",
6902 lex->get_stmt_unsafe_flags()));
6903
6904 reset_binlog_local_stmt_filter();
6905
6906 // Used binlog format
6907 ulong binlog_format= wsrep_binlog_format(variables.binlog_format);
6908 /*
6909 We should not decide logging format if the binlog is closed or
6910 binlogging is off, or if the statement is filtered out from the
6911 binlog by filtering rules.
6912 */
6913
6914#ifdef WITH_WSREP
6915 if (WSREP_CLIENT_NNULL(this) &&
6916 wsrep_thd_is_local(this) &&
6917 wsrep_is_active(this) &&
6918 variables.wsrep_trx_fragment_size > 0)
6919 {
6920 if (!is_current_stmt_binlog_disabled() &&
6921 !is_current_stmt_binlog_format_row())
6922 {
6923 my_message(ER_NOT_SUPPORTED_YET,
6924 "Streaming replication not supported with "
6925 "binlog_format=STATEMENT", MYF(0));
6926 DBUG_RETURN(-1);
6927 }
6928 }
6929
6930 /*
6931 If user has configured wsrep_forced_binlog_format to
6932 STMT OR MIXED and used binlog_format would be same
6933 and this is CREATE TABLE AS SELECT we will fall back
6934 to ROW.
6935 */
6936 if (wsrep_forced_binlog_format < BINLOG_FORMAT_ROW &&
6937 wsrep_ctas)
6938 {
6939 if (!get_stmt_da()->has_sql_condition(ER_UNKNOWN_ERROR))
6940 {
6941 push_warning_printf(this, Sql_condition::WARN_LEVEL_WARN,
6942 ER_UNKNOWN_ERROR,
6943 "Galera does not support wsrep_forced_binlog_format = %s "
6944 "in CREATE TABLE AS SELECT",
6945 wsrep_forced_binlog_format == BINLOG_FORMAT_STMT ?
6946 "STMT" : "MIXED");
6947 }
6948 set_current_stmt_binlog_format_row();
6949 }
6950
6951 /* If user has requested binlog_format STMT OR MIXED

Callers 2

postlockMethod · 0.80
lock_tablesFunction · 0.80

Calls 15

queryClass · 0.85
wsrep_is_activeFunction · 0.85
my_messageFunction · 0.85
push_warning_printfFunction · 0.85
my_errorFunction · 0.85
get_stmt_unsafe_flagsMethod · 0.80
placeholderMethod · 0.80
ha_table_flagsMethod · 0.80
using_binlogMethod · 0.80
set_stmt_unsafeMethod · 0.80

Tested by

no test coverage detected