1
0
mirror of https://github.com/MariaDB/server.git synced 2025-06-12 01:53:02 +03:00

BUG#31168: @@hostname does not replicate

Problem: in mixed and statement mode, a query that refers to a
system variable will use the slave's value when replayed on
slave. So if the value of a system variable is inserted into a
table, the slave will differ from the master.
Fix: mark statements that refer to a system variable as "unsafe",
meaning they will be replicated by row in mixed mode and produce a warning
in statement mode. There are some exceptions: some variables are actually
replicated. Those should *not* be marked as unsafe.
BUG#34732: mysqlbinlog does not print default values for auto_increment variables
Problem: mysqlbinlog does not print default values for some variables,
including auto_increment_increment and others. So if a client executing
the output of mysqlbinlog has different default values, replication will
be wrong.
Fix: Always print default values for all variables that are replicated.
I need to fix the two bugs at the same time, because the test cases would
fail if I only fixed one of them.
This commit is contained in:
sven@riska.(none)
2008-03-07 13:59:36 +01:00
parent 9c2ef8377f
commit 81b1d712bf
27 changed files with 3576 additions and 265 deletions

View File

@ -341,6 +341,14 @@ drop function if exists f1;
drop procedure if exists p_verify_status_increment;
--enable_warnings
# Save binlog_format in a user variable. References to system
# variables are "unsafe", meaning they are written as rows instead of
# as statements to the binlog, if the loggging mode is 'mixed'. But
# we don't want p_verify_status_increment to affect the logging mode.
# Hence, we save binlog_format in a user variable (which is not
# unsafe) and use that inside p_verify_status_increment.
set @binlog_format=@@global.binlog_format;
set sql_mode=no_engine_substitution;
create table t1 (a int unique);
create table t2 (a int) engine=myisam;
@ -367,7 +375,7 @@ begin
where variable_name='Handler_commit' or variable_name='Handler_prepare'
order by variable_name;
if @@global.binlog_format = 'ROW' then
if @binlog_format = 'ROW' then
set commit_inc= commit_inc_row;
set prepare_inc= prepare_inc_row;
else