From: Date: March 6 2008 1:50pm Subject: bk commit into 5.0 tree (aelkin:1.2595) BUG#26622 List-Archive: http://lists.mysql.com/commits/43517 X-Bug: 26622 Message-Id: <200803061250.m26CoOV0002732@mysql1000> Below is the list of changes that have just been committed into a local 5.0 repository of aelkin. When aelkin does a push these changes will be propagated to the main repository and, within 24 hours after the push, to the public repository. For information on how to access the public repository see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html ChangeSet@stripped, 2008-03-06 14:49:21+02:00, aelkin@mysql1000.(none) +3 -0 Bug#26622 MASTER_POS_WAIT does not work as documented MASTER_POS_WAIT return values are different than expected when the server is not a slave. It returns -1 instead of NULL. Fixed with correcting st_relay_log_info::wait_for_pos() to return the proper value in the case of rli info is not inited. mysql-test/r/rpl_master_pos_wait.result@stripped, 2008-03-06 14:49:18+02:00, aelkin@mysql1000.(none) +6 -0 results changed mysql-test/t/rpl_master_pos_wait.test@stripped, 2008-03-06 14:49:19+02:00, aelkin@mysql1000.(none) +11 -0 the new test to check that select master_pos_wait() to a server does not have master info returns NULL as specified. sql/slave.cc@stripped, 2008-03-06 14:49:19+02:00, aelkin@mysql1000.(none) +1 -1 changing the return value to correspond the specification. diff -Nrup a/mysql-test/r/rpl_master_pos_wait.result b/mysql-test/r/rpl_master_pos_wait.result --- a/mysql-test/r/rpl_master_pos_wait.result 2006-10-03 17:02:39 +03:00 +++ b/mysql-test/r/rpl_master_pos_wait.result 2008-03-06 14:49:18 +02:00 @@ -16,3 +16,9 @@ select master_pos_wait('master-bin.99999 stop slave sql_thread; master_pos_wait('master-bin.999999',0) NULL +"*** must be empty ***" +show slave status; +"*** must be NULL ***" +select master_pos_wait('foo', 98); +master_pos_wait('foo', 98) +NULL diff -Nrup a/mysql-test/t/rpl_master_pos_wait.test b/mysql-test/t/rpl_master_pos_wait.test --- a/mysql-test/t/rpl_master_pos_wait.test 2005-09-15 17:17:19 +03:00 +++ b/mysql-test/t/rpl_master_pos_wait.test 2008-03-06 14:49:19 +02:00 @@ -15,4 +15,15 @@ stop slave sql_thread; connection slave; reap; +# +# bug#26622 MASTER_POS_WAIT does not work as documented +# + +connection master; +echo "*** must be empty ***"; +query_vertical show slave status; + +echo "*** must be NULL ***"; +select master_pos_wait('foo', 98); + # End of 4.1 tests diff -Nrup a/sql/slave.cc b/sql/slave.cc --- a/sql/slave.cc 2008-02-14 13:55:09 +02:00 +++ b/sql/slave.cc 2008-03-06 14:49:19 +02:00 @@ -2685,7 +2685,7 @@ int st_relay_log_info::wait_for_pos(THD* longlong timeout) { if (!inited) - return -1; + return -2; int event_count = 0; ulong init_abort_pos_wait; int error=0;