I am playing with scripting for mysql-proxy. What I am trying to accomplish is irrelevant. What I am finding, however, is that there appears to be elements of the lua interface that are undocumented. The big "smoking gun" I have is the disconnect_client()
hook. I cannot find it documented anywhere in the official documentation, though it s used in an example on the explanation of the admin interface. It s also used extensively in the example docs. A quick grep shows its use in the following scripts included in the 5.5.8 distribution:
active-queries.lua
active-transactions.lua
load-multi.lua
ro-pooling.lua
rw-splitting.lua
tutorial-keepalive.lua
My other example that has caught my eye is the list of attributes for entries in the proxy.global.backends
table. The documentation lists the following attributes:
dst.name
dst.address
dst.port
connected_clients
state
type
However, several of the example scripts reference a fairly complex element called pool. Take for instance tutorial-keepalive.lua
:
local s = proxy.global.backends[i]
local pool = s.pool
local cur_idle = pool.users[proxy.connection.client.username].cur_idle_connections
At first I thought it was being added somewhere else in the lua, but I ve looked and I can t find any code assigning into proxy.global.backends[i].pool.
So, two questions I suppose:
- Am I nuts? Please feel free to demonstrate how I ve overlooked the obvious and the documentation is really quite clear.
- Assuming I am correct, is there anywhere to find the complete documentation? A nice link would be great (though I couldn t google one up), but even "take a look at this .c file from the mysql-proxy distro that defines the interface". At least that would give me something to poke at.
Thanks