From 4381f7ed90f54be0be0c569e38d17aefe98b7d0b Mon Sep 17 00:00:00 2001 From: He Zhenxing Date: Fri, 2 Oct 2009 16:40:06 +0800 Subject: [PATCH] Backport post fix compiler warnings and test failures for BUG#25192 BUG#12190 --- mysql-test/include/setup_fake_relay_log.inc | 16 +++++++++++++++- .../t/binlog_auto_increment_bug33029.test | 19 ++++++++++++++++--- mysys/default.c | 4 ++-- sql/log.cc | 2 +- 4 files changed, 34 insertions(+), 7 deletions(-) diff --git a/mysql-test/include/setup_fake_relay_log.inc b/mysql-test/include/setup_fake_relay_log.inc index b3df7abba76..b11e6afbeca 100644 --- a/mysql-test/include/setup_fake_relay_log.inc +++ b/mysql-test/include/setup_fake_relay_log.inc @@ -69,7 +69,21 @@ let $_fake_relay_log_purge= `SELECT @@global.relay_log_purge`; # Create relay log file. copy_file $fake_relay_log $_fake_relay_log; # Create relay log index. ---exec echo ./$_fake_filename-fake.000001 > $_fake_relay_index + +# After patch for BUG#12190, the filename used in CHANGE MASTER +# RELAY_LOG_FILE will be automatically added the directory of the +# relay log before comparison, thus we need to added the directory +# part (./ on unix .\ on windows) when faking the relay-log-bin.index. + +if (`select convert(@@version_compile_os using latin1) IN ("Win32","Win64","Windows") = 0`) +{ + eval select './$_fake_filename-fake.000001\n' into dumpfile '$_fake_relay_index'; +} + +if (`select convert(@@version_compile_os using latin1) IN ("Win32","Win64","Windows") != 0`) +{ + eval select '.\\\\$_fake_filename-fake.000001\n' into dumpfile '$_fake_relay_index'; +} # Setup replication from existing relay log. eval CHANGE MASTER TO MASTER_HOST='dummy.localdomain', RELAY_LOG_FILE='$_fake_filename-fake.000001', RELAY_LOG_POS=4; diff --git a/mysql-test/suite/binlog/t/binlog_auto_increment_bug33029.test b/mysql-test/suite/binlog/t/binlog_auto_increment_bug33029.test index 1277f6e7ccb..19137066429 100644 --- a/mysql-test/suite/binlog/t/binlog_auto_increment_bug33029.test +++ b/mysql-test/suite/binlog/t/binlog_auto_increment_bug33029.test @@ -25,9 +25,22 @@ let $MYSQLD_DATADIR= `select @@datadir`; copy_file $MYSQL_TEST_DIR/std_data/bug33029-slave-relay-bin.000001 $MYSQLD_DATADIR/slave-relay-bin.000001; -write_file $MYSQLD_DATADIR/slave-relay-bin.index; -./slave-relay-bin.000001 -EOF + +# After patch for BUG#12190, the filename used in CHANGE MASTER +# RELAY_LOG_FILE will be automatically added the directory of the +# relay log before comparison, thus we need to added the directory +# part (./ on unix .\ on windows) when faking the relay-log-bin.index. +disable_query_log; +if (`select convert(@@version_compile_os using latin1) IN ("Win32","Win64","Windows") = 0`) +{ + eval select './slave-relay-bin.000001\n' into dumpfile '$MYSQLD_DATADIR/slave-relay-bin.index'; +} + +if (`select convert(@@version_compile_os using latin1) IN ("Win32","Win64","Windows") != 0`) +{ + eval select '.\\\\slave-relay-bin.000001\n' into dumpfile '$MYSQLD_DATADIR/slave-relay-bin.index'; +} +enable_query_log; change master to MASTER_HOST='dummy.localdomain', diff --git a/mysys/default.c b/mysys/default.c index c610b57c6d1..6468cf2b35d 100644 --- a/mysys/default.c +++ b/mysys/default.c @@ -478,7 +478,7 @@ int my_load_defaults(const char *conf_file, const char **groups, res= (char**) (ptr+sizeof(alloc)); res[0]= **argv; /* Copy program name */ /* set arguments separator */ - res[1]= args_separator; + res[1]= (char *)args_separator; for (i=2 ; i < (uint) *argc ; i++) res[i]=argv[0][i]; res[i]=0; /* End pointer */ @@ -534,7 +534,7 @@ int my_load_defaults(const char *conf_file, const char **groups, /* set arguments separator for arguments from config file and command line */ - res[args.elements+1]= args_separator; + res[args.elements+1]= (char *)args_separator; if (*argc) memcpy((uchar*) (res+1+args.elements+1), (char*) ((*argv)+1), diff --git a/sql/log.cc b/sql/log.cc index 16f54649d2d..a523c111e87 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -1901,7 +1901,7 @@ updating the index files.", max_found); */ if (((strlen(ext_buf) + (end - name)) >= FN_REFLEN)) { - sql_print_error("Log filename too large: %s%s (%d). \ + sql_print_error("Log filename too large: %s%s (%lu). \ Please fix this by archiving old logs and updating the \ index files.", name, ext_buf, (strlen(ext_buf) + (end - name))); error= 1;