diff options
author | Andrei Elkin <aelkin@mysql.com> | 2009-02-20 13:55:43 +0200 |
---|---|---|
committer | Andrei Elkin <aelkin@mysql.com> | 2009-02-20 13:55:43 +0200 |
commit | 4712e6b9b8e61e468ee94ec65105e61881f77421 (patch) | |
tree | 82705f064568d44c461c15ebdcda8cb1e3da0d27 /mysql-test/t/mysqlbinlog.test | |
parent | c1ddc60c695e49a44555049768cb8557676840aa (diff) | |
download | mariadb-git-4712e6b9b8e61e468ee94ec65105e61881f77421.tar.gz |
Bug #37313 BINLOG Contains Incorrect server id
Signed integer format specifier forced to print the binlog header with server_id
negative if the unsigned value sets the sign-bit ON.
Fixed with correcting the specifier to correspond to typeof(server_id) == ulong.
mysql-test/r/mysqlbinlog.result:
results changed.
mysql-test/t/mysqlbinlog.test:
displaying the expected unsignedly formatted server_id value, bug#37313.
sql/log_event.cc:
Format specifier is corrected to correspond to typeof(server_id).
Diffstat (limited to 'mysql-test/t/mysqlbinlog.test')
-rw-r--r-- | mysql-test/t/mysqlbinlog.test | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/mysql-test/t/mysqlbinlog.test b/mysql-test/t/mysqlbinlog.test index 5b4a43c8fe8..cf4bc1523df 100644 --- a/mysql-test/t/mysqlbinlog.test +++ b/mysql-test/t/mysqlbinlog.test @@ -253,4 +253,24 @@ echo shell> mysqlbinlog std_data/corrupt-relay-bin.000624 > var/tmp/bug31793.sql error 1; exec $MYSQL_BINLOG $MYSQL_TEST_DIR/std_data/corrupt-relay-bin.000624 > $MYSQLTEST_VARDIR/tmp/bug31793.sql; +# +# Bug #37313 BINLOG Contains Incorrect server id +# + +let $save_server_id= `select @@global.server_id`; +let $s_id_max=`select (1 << 32) - 1`; +eval set @@global.server_id= $s_id_max; + +reset master; +--exec $MYSQL_BINLOG $MYSQLTEST_VARDIR/log/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/mysqlbinlog_bug37313.binlog +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +eval select +(@a:=load_file("$MYSQLTEST_VARDIR/tmp/mysqlbinlog_bug37313.binlog")) +is not null; +let $s_id_unsigned= `select @a like "%server id $s_id_max%" /* must return 1 */`; +echo *** Unsigned server_id $s_id_max is found: $s_id_unsigned ***; + +eval set @@global.server_id= $save_server_id; +--remove_file $MYSQLTEST_VARDIR/tmp/mysqlbinlog_bug37313.binlog + --echo End of 5.0 tests |