SELECT MASTER_POS_WAIT('master_log_file
',master_log_pos
[,timeout
])
This is actually a function, not a statement. It is used to ensure that the slave has read and executed events up to a given position in the master's binary log. See Section 11.10.4, “Miscellaneous Functions”, for a full description.
The following table shows the maximum allowable length for the string-valued options.
Option | Maximum Length |
MASTER_HOST |
60 |
MASTER_USER |
16 |
MASTER_PASSWORD |
32 |
MASTER_LOG_FILE |
255 |
RELAY_LOG_FILE |
255 |
MASTER_SSL_CA |
255 |
MASTER_SSL_CAPATH |
255 |
MASTER_SSL_CERT |
255 |
MASTER_SSL_KEY |
255 |
MASTER_SSL_CIPHER |
511 |
User Comments
NOTE: If you have a cyclical replication setup (ie. more then two servers in a replication chain) do *NOT* rely on 'SHOW MASTER STATUS' on the slave's MASTER for values to use in the master_pos_wait function. This is because if the slave had just finished executing a binlog event that didn't originally come from its own MASTER, the master_log_pos value to be used in this function won't work. I feel this is a bug, but it is apparently designed to work this way. Don't ask me why.
WARNING: does not block if slave errors.
If show slave status is reporting an error, function returns instantly.
Add your own comment.