in reply to DBI/MySQL Proxy

The normal way to do this would be to write a server with which your clients would communicate using the protocol of your choice (could even be HTTP or something), and then call out to MySQL or whatever else based on the query.

But if I'm understanding you, you have existing clients you cannot change that expect to be talking to a MySQL server. Well, I suppose that you could bust out the MySQL Server source code, decode the internal protocol, and write a Perl program that implements that protocol in such a way that it passes all requests except the specific kind it is trying to trap on to the real MySQL server and handles that kind on its own, generating a response which, again, has to conform to the MySQL communication protocol. Surely there is some way you can get out of doing that.

Update: If in fact your clients are Perl programs and they call into MySQL using the DBI, then DBI::Proxy may indeed be of use after all. I have used it only in a sort of minimal test case myself, but from what I've seen, you could run the DBI proxyserver on your server system, let the clients use DBD::Proxy on their side to connect with your server, and use the dbiproxy to forward all the requests on to MySQL except the ones you want to trap. Should be a heck of a lot easier than writing a custom MySQL protocol handler.