I would like to have access to Seconds_Behind_Master (as returned by SHOW SLAVE STATUS) from inside a stored procedure, but can't figure out how to get its value inside a variable. None of the usual SET/SELECT syntax seems to work. Is there a way to do that?
+1
A:
From what I see in the recent docs and MySQL Bug#37187 there does not seem to be any way but SHOW SLAVE STATUS
to get to this information.
Daniel Schneller
2009-10-15 22:38:36
The problem is that SHOW SLAVE STATUS can be used from the outside (e.g. from a perl script), but how can I parse it from a stored procedure?
azerole
2009-10-16 12:36:28
+1
A:
Just for the record: it has turned out to be possible to open a cursor for SHOW statements. This allows to parse the output and work with it inside a stored procedure.
azerole
2009-10-27 16:07:24