MySQueaL Resources

resources for mysql admins and developers who are squealing for help

More Resources

Main Doc Pages
Comments
MySQL columns: everywhere I look are tables and columns; life is filled with databases of information to be ordered and grouped. (Ca'Grande, Milan, Italy)

MASTER_POS_WAIT( ) Statement

This function is useful to synchronize MySQL master and slave server logging.

hits past month: 8 ;  last updated: may 4, 2009 - 2:34am ;  parent: MySQL Replication

Syntax

MASTER_POS_WAIT(log_filename, log_position[, timeout])

Explanation

This function is useful to synchronize MySQL master and slave server logging. The function causes the master to wait until the slave server has read and applied all updates to the position (given in the second argument) in the master log (named in the first argument). You can specify a third argument to set the number of seconds the master will wait. A value of 0 or a negative amount is given to instruct the function not to time out and to keep trying.

The function returns the number of log entries that were made by the slave while the master was waiting. If all is set properly, you should receive these results rapidly. However, if there is an error, NULL is returned. NULL is also returned if the slave SQL thread is not started, if the slave's master options are not set, or if the parameters given with this function are not correct. If you give the timeout parameter and the amount of time is exceeded, -1 is returned.

There are no examples for this page of our documentation. Return to MySQL Replication page of our MySQL Documentation