Commit 950d6961 authored by Nirbhay Choubey's avatar Nirbhay Choubey

MDEV-7322: Option to allow setting the binlog_format with Galera

At session scope, allow binlog_format to be changed to
values other than ROW with a warning.
parent 7cda4bee
call mtr.add_suppression("WSREP: cannot get fake InnoDB transaction ID");
call mtr.add_suppression("WSREP: Could not open saved state file for reading:.*");
call mtr.add_suppression("WSREP: MariaDB Galera does not support binlog format.*");
call mtr.add_suppression("WSREP: cannot get fake InnoDB transaction ID");
#
# MDEV-4227: Galera server should stop crashing on setting binlog_format STATEMENT
#
SHOW VARIABLES LIKE 'binlog_format';
Variable_name Value
binlog_format ROW
SET binlog_format=STATEMENT;
ERROR 42000: Variable 'binlog_format' can't be set to the value of 'STATEMENT'
Warnings:
Warning 1105 MariaDB Galera does not support binlog format: STATEMENT
SHOW WARNINGS;
Level Code Message
Warning 1105 MariaDB Galera does not support binlog format: STATEMENT
Error 1231 Variable 'binlog_format' can't be set to the value of 'STATEMENT'
SHOW VARIABLES LIKE 'binlog_format';
Variable_name Value
binlog_format ROW
binlog_format STATEMENT
CREATE TABLE IF NOT EXISTS test.t1 AS SELECT * FROM information_schema.routines WHERE 1 = 0;
SET binlog_format=MIXED;
ERROR 42000: Variable 'binlog_format' can't be set to the value of 'MIXED'
Warnings:
Warning 1105 MariaDB Galera does not support binlog format: MIXED
SHOW WARNINGS;
Level Code Message
Warning 1105 MariaDB Galera does not support binlog format: MIXED
Error 1231 Variable 'binlog_format' can't be set to the value of 'MIXED'
SHOW VARIABLES LIKE 'binlog_format';
Variable_name Value
binlog_format ROW
binlog_format MIXED
CREATE TABLE IF NOT EXISTS test.t2 AS SELECT * FROM information_schema.routines WHERE 1 = 0;
SET binlog_format=ROW;
SHOW WARNINGS;
......@@ -34,6 +36,9 @@ CREATE TABLE IF NOT EXISTS test.t3 AS SELECT * FROM information_schema.routines
DROP TABLE IF EXISTS test.t1;
DROP TABLE IF EXISTS test.t2;
DROP TABLE IF EXISTS test.t3;
#
# MDEV-7322: Option to allow setting the binlog_format with Galera
#
SET @@GLOBAL.binlog_format=STATEMENT;
ERROR 42000: Variable 'binlog_format' can't be set to the value of 'STATEMENT'
SHOW GLOBAL VARIABLES LIKE 'binlog_format';
......@@ -44,6 +49,11 @@ ERROR 42000: Variable 'binlog_format' can't be set to the value of 'MIXED'
SHOW GLOBAL VARIABLES LIKE 'binlog_format';
Variable_name Value
binlog_format ROW
SET @@GLOBAL.binlog_format=DEFAULT;
ERROR 42000: Variable 'binlog_format' can't be set to the value of 'DEFAULT'
SHOW GLOBAL VARIABLES LIKE 'binlog_format';
Variable_name Value
binlog_format ROW
SET @@GLOBAL.binlog_format=ROW;
SHOW GLOBAL VARIABLES LIKE 'binlog_format';
Variable_name Value
......
--source include/have_wsrep_provider.inc
--source include/have_binlog_format_row.inc
#
# MDEV-4227: Galera server should stop crashing on setting binlog_format STATEMENT
#
call mtr.add_suppression("WSREP: cannot get fake InnoDB transaction ID");
call mtr.add_suppression("WSREP: Could not open saved state file for reading:.*");
call mtr.add_suppression("WSREP: MariaDB Galera does not support binlog format.*");
call mtr.add_suppression("WSREP: cannot get fake InnoDB transaction ID");
--echo #
--echo # MDEV-4227: Galera server should stop crashing on setting binlog_format STATEMENT
--echo #
SHOW VARIABLES LIKE 'binlog_format';
-- error ER_WRONG_VALUE_FOR_VAR
SET binlog_format=STATEMENT;
SHOW WARNINGS;
SHOW VARIABLES LIKE 'binlog_format';
CREATE TABLE IF NOT EXISTS test.t1 AS SELECT * FROM information_schema.routines WHERE 1 = 0;
-- error ER_WRONG_VALUE_FOR_VAR
SET binlog_format=MIXED;
SHOW WARNINGS;
SHOW VARIABLES LIKE 'binlog_format';
......@@ -26,6 +25,10 @@ DROP TABLE IF EXISTS test.t1;
DROP TABLE IF EXISTS test.t2;
DROP TABLE IF EXISTS test.t3;
--echo #
--echo # MDEV-7322: Option to allow setting the binlog_format with Galera
--echo #
-- error ER_WRONG_VALUE_FOR_VAR
SET @@GLOBAL.binlog_format=STATEMENT;
SHOW GLOBAL VARIABLES LIKE 'binlog_format';
......@@ -34,6 +37,10 @@ SHOW GLOBAL VARIABLES LIKE 'binlog_format';
SET @@GLOBAL.binlog_format=MIXED;
SHOW GLOBAL VARIABLES LIKE 'binlog_format';
-- error ER_WRONG_VALUE_FOR_VAR
SET @@GLOBAL.binlog_format=DEFAULT;
SHOW GLOBAL VARIABLES LIKE 'binlog_format';
SET @@GLOBAL.binlog_format=ROW;
SHOW GLOBAL VARIABLES LIKE 'binlog_format';
......
......@@ -444,14 +444,17 @@ static bool binlog_format_check(sys_var *self, THD *thd, set_var *var)
if (WSREP(thd) &&
var->save_result.ulonglong_value != BINLOG_FORMAT_ROW)
{
WSREP_ERROR("MariaDB Galera does not support binlog format: %s",
binlog_format_names[var->save_result.ulonglong_value]);
// Also push a warning because error message is general.
// Push a warning to the error log.
push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN, ER_UNKNOWN_ERROR,
"MariaDB Galera does not support binlog format: %s",
binlog_format_names[var->save_result.ulonglong_value]);
return true;
if (var->type == OPT_GLOBAL)
{
WSREP_ERROR("MariaDB Galera does not support binlog format: %s",
binlog_format_names[var->save_result.ulonglong_value]);
return true;
}
}
#endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment