One of the most frequently needed functionality in the MySQL Proxy is the need to know which server you are on. This is not given, on purpose, by the proxy, because the proxy is supposed to be transparent. It is not supposed to matter which back-end server you are on.
However, for testing purposes we often want to know which
back-end server we’re on. Thus I developed functionality for
SHOW PROXY BACKEND [INDEX ADDRESS OTHER]
.
SHOW PROXY BACKEND INDEX
— gives the index of the
server you’re on (backend_ndx, ie 1)
SHOW PROXY BACKEND ADDRESS
— gives the address of
the server you’re on (ie, foo.bar.com:3306)
SHOW PROXY BACKEND OTHER
— gives the address of all
the other servers except those you’re not on, in multiline
format.
Note that I was pretty lazy and the commands are case-sensitive. But I figured that since this is supposed to be used …
[Read more]