mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
BUG#39934: Slave stops for engine that only support row-based logging
Post-push fix. Problem: After the original bugfix, if a statement is unsafe, binlog_format=mixed, and engine is statement-only, a warning was generated and the statement executed. However, it is a fundamental principle of binlogging that binlog_format=mixed should guarantee correct logging, no compromise. So correct behavior is to generate an error and don't execute the statement. Fix: Generate error instead of warning. Since issue_unsafe_warnings can only generate one error message, this allows us to simplify the code a bit too: decide_logging_format does not have to save the error code for issue_unsafe_warnings
This commit is contained in:
@@ -1449,42 +1449,21 @@ private:
|
||||
*/
|
||||
enum_binlog_format current_stmt_binlog_format;
|
||||
|
||||
/**
|
||||
Enumeration listing binlog-related warnings that a statement can
|
||||
cause.
|
||||
*/
|
||||
enum enum_binlog_stmt_warning {
|
||||
|
||||
/* ER_BINLOG_UNSAFE_AND_STMT_ENGINE affects current stmt */
|
||||
BINLOG_STMT_WARNING_UNSAFE_AND_STMT_ENGINE= 0,
|
||||
|
||||
/* ER_BINLOG_UNSAFE_STATEMENT affects current stmt */
|
||||
BINLOG_STMT_WARNING_UNSAFE_AND_STMT_MODE,
|
||||
|
||||
/** The last element of this enumeration type. */
|
||||
BINLOG_STMT_WARNING_COUNT
|
||||
};
|
||||
|
||||
/**
|
||||
Bit field for the state of binlog warnings.
|
||||
|
||||
There are three groups of bits:
|
||||
There are two groups of bits:
|
||||
|
||||
- The low BINLOG_STMT_WARNING_COUNT bits indicate the type of
|
||||
warning that the current (top-level) statement will issue. At
|
||||
most one of these bits should be set (this is ensured by the
|
||||
logic in decide_logging_format).
|
||||
|
||||
- The following Lex::BINLOG_STMT_UNSAFE_COUNT bits list all types
|
||||
of unsafeness that the current statement has.
|
||||
- The first Lex::BINLOG_STMT_UNSAFE_COUNT bits list all types of
|
||||
unsafeness that the current statement has.
|
||||
|
||||
- The following Lex::BINLOG_STMT_UNSAFE_COUNT bits list all types
|
||||
of unsafeness that the current statement has issued warnings
|
||||
for.
|
||||
|
||||
Hence, this variable must be big enough to hold
|
||||
BINLOG_STMT_WARNING_COUNT + 2 * Lex::BINLOG_STMT_UNSAFE_COUNT
|
||||
bits. This is asserted in @c issue_unsafe_warnings().
|
||||
2*Lex::BINLOG_STMT_UNSAFE_COUNT bits. This is asserted in @c
|
||||
issue_unsafe_warnings().
|
||||
|
||||
The first and second groups of bits are set by @c
|
||||
decide_logging_format() when it detects that a warning should be
|
||||
|
Reference in New Issue
Block a user