From 36c7cfd71ea4645597cd0ca6d9279e0b14140a4e Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 28 Nov 2006 16:26:15 +0400 Subject: Bug#20396 Bin Log does not get DELIMETER cmd - Recover StoredProc fails Problem: when loading mysqlbinlog dumps, CREATE PROCEDURE having semicolons in their bodies failed. Fix: Using safe delimiter "/*!*/;" to dump log entries. client/mysqlbinlog.cc: - Adding PRINT_EVENT_INFO argument to dump_xxx_log_entries() - Setting delimiter to "/*!*/;" before calling dump functions mysql-test/r/ctype_ucs_binlog.result: Fixing test results mysql-test/r/mix_innodb_myisam_binlog.result: Fixing test results mysql-test/r/mysqlbinlog.result: Fixing test results Adding test case mysql-test/r/mysqlbinlog2.result: Fixing test results mysql-test/r/rpl_charset.result: Fixing test results mysql-test/r/rpl_timezone.result: Fixing test results mysql-test/r/user_var-binlog.result: Fixing test results mysql-test/t/mix_innodb_myisam_binlog.test: Fixing LIKE expression mysql-test/t/mysqlbinlog.test: Adding test case sql/log_event.cc: Using print_event_info->delimiter instead of hard-coded semicolon as a query end marker. sql/log_event.h: Adding new member to store delimiter. --- mysql-test/t/mysqlbinlog.test | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'mysql-test/t/mysqlbinlog.test') diff --git a/mysql-test/t/mysqlbinlog.test b/mysql-test/t/mysqlbinlog.test index 0691cb7c76b..a0cd21acec1 100644 --- a/mysql-test/t/mysqlbinlog.test +++ b/mysql-test/t/mysqlbinlog.test @@ -134,6 +134,30 @@ flush logs; --exec $MYSQL_BINLOG --short-form $MYSQLTEST_VARDIR/log/master-bin.000006 | $MYSQL select * from t5 /* must be (1),(1) */; +# +# Bug#20396 Bin Log does not get DELIMETER cmd - Recover StoredProc fails +# +--disable_warnings +drop procedure if exists p1; +--enable_warnings +flush logs; +delimiter //; +create procedure p1() +begin +select 1; +end; +// +delimiter ;// +flush logs; +call p1(); +drop procedure p1; +--error 1305 +call p1(); +--exec $MYSQL_BINLOG --short-form $MYSQLTEST_VARDIR/log/master-bin.000007 +--exec $MYSQL_BINLOG --short-form $MYSQLTEST_VARDIR/log/master-bin.000007 | $MYSQL +call p1(); +drop procedure p1; + # clean up drop table t1, t2, t03, t04, t3, t4, t5; -- cgit v1.2.1 From c423ecc0a755646fd3ed4a2fc03450dbc49c528e Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 7 Dec 2006 09:31:53 +0400 Subject: Bug#22645 LC_TIME_NAMES: Statement not replicated Implementing event based replication of LC_TIME_NAMES for 5.0 (as a replacement of previously made ONE_SHOT replication) mysql-test/r/mysqlbinlog.result: Fixing results mysql-test/r/rpl_locale.result: Fixing results mysql-test/t/disabled.def: Enabling rpl_locale mysql-test/t/mysqlbinlog.test: Check "mysqlbinlog | mysql" reproduces lc_time_names correctly. mysql-test/t/rpl_locale.test: Adding new test: that setting lc_time_names back to en_US works fine. sql/log_event.cc: Implementing event based replication of LC_TIME_NAMES for 5.0 (as a replacement of previously made ONE_SHOT replication) sql/log_event.h: Adding new Q_*_CODE Adding "lc_time_names_number" members into Query_log_event and PRINT_EVENT_INFO --- mysql-test/t/mysqlbinlog.test | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'mysql-test/t/mysqlbinlog.test') diff --git a/mysql-test/t/mysqlbinlog.test b/mysql-test/t/mysqlbinlog.test index 0691cb7c76b..c2fe0e3e8e0 100644 --- a/mysql-test/t/mysqlbinlog.test +++ b/mysql-test/t/mysqlbinlog.test @@ -134,6 +134,25 @@ flush logs; --exec $MYSQL_BINLOG --short-form $MYSQLTEST_VARDIR/log/master-bin.000006 | $MYSQL select * from t5 /* must be (1),(1) */; +# +# Bug#22645 LC_TIME_NAMES: Statement not replicated +# Check that a dump created by mysqlbinlog reproduces +# lc_time_names dependent values correctly +# +flush logs; +drop table if exists t5; +create table t5 (c1 int, c2 varchar(128) character set latin1 not null); +insert into t5 values (1, date_format('2001-01-01','%W')); +set lc_time_names=de_DE; +insert into t5 values (2, date_format('2001-01-01','%W')); +set lc_time_names=en_US; +insert into t5 values (3, date_format('2001-01-01','%W')); +select * from t5 order by c1; +flush logs; +drop table t5; +--exec $MYSQL_BINLOG --short-form $MYSQLTEST_VARDIR/log/master-bin.000007 | $MYSQL +select * from t5 order by c1; + # clean up drop table t1, t2, t03, t04, t3, t4, t5; -- cgit v1.2.1 From e653222d3051095da3c1c7ff4777ba2dbe12cf32 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 14 Dec 2006 14:05:25 +0400 Subject: Bug#17642 mysqlbinlog: Restore from row-based binlog fails Problem: mysqlbinlog_base64 failed sporadically. Reason: Missing "flush logs" before running $MYSQL_BINLOG, which could start dumping the log file before server has finished writting into it. Fix: - implementing --force-if-open option to "mysqlbinlog" - adding --disable-force-if-open to make $MYSQL_BINLOG fail on non-closed log files, to garantee that nobody will forget "flush logs" in the future. - adding "flush logs" into all affected tests. client/mysqlbinlog.cc: Implementing --force-if-open option with TRUE by default mysql-test/mysql-test-run.pl: Using --disable-force-if-open for all tests to avoid sporadic test failures because of running "mysqlbinlog" on a non-flushed binlog files. mysql-test/r/binlog_row_mix_innodb_myisam.result: FLush log before running dumping. mysql-test/r/binlog_stm_mix_innodb_myisam.result: FLush log before running dumping. mysql-test/r/mysqlbinlog.result: FLush log before running dumping. mysql-test/r/mysqlbinlog2.result: FLush log before running dumping. mysql-test/r/mysqlbinlog_base64.result: FLush log before running dumping. mysql-test/r/user_var-binlog.result: FLush log before running dumping. mysql-test/t/binlog_row_mix_innodb_myisam.test: FLush log before running dumping. mysql-test/t/binlog_stm_mix_innodb_myisam.test: FLush log before running dumping. mysql-test/t/mysqlbinlog.test: FLush log before running dumping. Adding new tests: - checking that $MYSQL_BINLOG returns an error on a non-closed binlog file because of --disable-force-if-open - checking that it does not return an error with --force-if-open mysql-test/t/mysqlbinlog2.test: FLush log before running dumping. mysql-test/t/mysqlbinlog_base64.test: FLush log before running dumping. mysql-test/t/user_var-binlog.test: FLush log before running dumping. --- mysql-test/t/mysqlbinlog.test | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'mysql-test/t/mysqlbinlog.test') diff --git a/mysql-test/t/mysqlbinlog.test b/mysql-test/t/mysqlbinlog.test index a76bb9a2757..dc9a58c222d 100644 --- a/mysql-test/t/mysqlbinlog.test +++ b/mysql-test/t/mysqlbinlog.test @@ -133,6 +133,7 @@ flush logs; # resulted binlog, parly consisting of multi-byte utf8 chars, # must be digestable for both client and server. In 4.1 the client # should use default-character-set same as the server. +flush logs; --exec $MYSQL_BINLOG --short-form $MYSQLTEST_VARDIR/log/master-bin.000006 | $MYSQL select * from t5 /* must be (1),(1) */; @@ -155,8 +156,8 @@ call p1(); drop procedure p1; --error 1305 call p1(); ---exec $MYSQL_BINLOG --short-form $MYSQLTEST_VARDIR/log/master-bin.000007 ---exec $MYSQL_BINLOG --short-form $MYSQLTEST_VARDIR/log/master-bin.000007 | $MYSQL +--exec $MYSQL_BINLOG --short-form $MYSQLTEST_VARDIR/log/master-bin.000008 +--exec $MYSQL_BINLOG --short-form $MYSQLTEST_VARDIR/log/master-bin.000008 | $MYSQL call p1(); drop procedure p1; @@ -164,3 +165,13 @@ drop procedure p1; drop table t1, t2, t03, t04, t3, t4, t5; # End of 5.0 tests + +# +# Test --disable-force-if-open and --force-if-open +# +flush logs; +--error 1 +--exec $MYSQL_BINLOG $MYSQLTEST_VARDIR/log/master-bin.000010 >/dev/null 2>/dev/null +--exec $MYSQL_BINLOG --force-if-open $MYSQLTEST_VARDIR/log/master-bin.000010 >/dev/null 2>/dev/null + +# End of 5.1 tests -- cgit v1.2.1 From 76bd00a9932713aaf33de8915051c47e7af2aa61 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 14 Dec 2006 16:31:23 +0400 Subject: After merge fix for bug N22645 mysql-test/t/mysqlbinlog.test: After merge fix sql/log_event.cc: Fixing comment, thanks to Andrei for suggestion --- mysql-test/t/mysqlbinlog.test | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'mysql-test/t/mysqlbinlog.test') diff --git a/mysql-test/t/mysqlbinlog.test b/mysql-test/t/mysqlbinlog.test index eeed508f474..b2bda247cd7 100644 --- a/mysql-test/t/mysqlbinlog.test +++ b/mysql-test/t/mysqlbinlog.test @@ -171,8 +171,8 @@ call p1(); drop procedure p1; --error 1305 call p1(); ---exec $MYSQL_BINLOG --short-form $MYSQLTEST_VARDIR/log/master-bin.000007 ---exec $MYSQL_BINLOG --short-form $MYSQLTEST_VARDIR/log/master-bin.000007 | $MYSQL +--exec $MYSQL_BINLOG --short-form $MYSQLTEST_VARDIR/log/master-bin.000009 +--exec $MYSQL_BINLOG --short-form $MYSQLTEST_VARDIR/log/master-bin.000009 | $MYSQL call p1(); drop procedure p1; -- cgit v1.2.1 From 61c7864ced276d8ac49860d9560cfb4d13120f59 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 22 Dec 2006 11:43:04 +0400 Subject: After merge fix --- mysql-test/t/mysqlbinlog.test | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'mysql-test/t/mysqlbinlog.test') diff --git a/mysql-test/t/mysqlbinlog.test b/mysql-test/t/mysqlbinlog.test index db5c4efe8ad..ad6a16810c5 100644 --- a/mysql-test/t/mysqlbinlog.test +++ b/mysql-test/t/mysqlbinlog.test @@ -153,7 +153,7 @@ insert into t5 values (3, date_format('2001-01-01','%W')); select * from t5 order by c1; flush logs; drop table t5; ---exec $MYSQL_BINLOG --short-form $MYSQLTEST_VARDIR/log/master-bin.000007 | $MYSQL +--exec $MYSQL_BINLOG --short-form $MYSQLTEST_VARDIR/log/master-bin.000008 | $MYSQL select * from t5 order by c1; # # Bug#20396 Bin Log does not get DELIMETER cmd - Recover StoredProc fails @@ -174,8 +174,8 @@ call p1(); drop procedure p1; --error 1305 call p1(); ---exec $MYSQL_BINLOG --short-form $MYSQLTEST_VARDIR/log/master-bin.000009 ---exec $MYSQL_BINLOG --short-form $MYSQLTEST_VARDIR/log/master-bin.000009 | $MYSQL +--exec $MYSQL_BINLOG --short-form $MYSQLTEST_VARDIR/log/master-bin.000010 +--exec $MYSQL_BINLOG --short-form $MYSQLTEST_VARDIR/log/master-bin.000010 | $MYSQL call p1(); drop procedure p1; @@ -189,7 +189,7 @@ drop table t1, t2, t03, t04, t3, t4, t5; # flush logs; --error 1 ---exec $MYSQL_BINLOG $MYSQLTEST_VARDIR/log/master-bin.000010 >/dev/null 2>/dev/null ---exec $MYSQL_BINLOG --force-if-open $MYSQLTEST_VARDIR/log/master-bin.000010 >/dev/null 2>/dev/null +--exec $MYSQL_BINLOG $MYSQLTEST_VARDIR/log/master-bin.000012 >/dev/null 2>/dev/null +--exec $MYSQL_BINLOG --force-if-open $MYSQLTEST_VARDIR/log/master-bin.000012 >/dev/null 2>/dev/null # End of 5.1 tests -- cgit v1.2.1