Commit 122fefc5 authored by aelkin/andrei@mysql1000.(none)'s avatar aelkin/andrei@mysql1000.(none)
Browse files

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.
parent 57f6c4b3
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -16,3 +16,9 @@ select master_pos_wait('master-bin.999999',0);
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
+11 −0
Original line number Diff line number Diff line
@@ -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
+1 −1
Original line number Diff line number Diff line
@@ -2685,7 +2685,7 @@ int st_relay_log_info::wait_for_pos(THD* thd, String* log_name,
                                    longlong timeout)
{
  if (!inited)
    return -1;
    return -2;
  int event_count = 0;
  ulong init_abort_pos_wait;
  int error=0;