MySQL Forums
Forum List  »  Router & Proxy

Bind Variables and MySQL Proxy
Posted by: Cameron Guill
Date: January 30, 2008 07:52AM

It appears that MySQL Proxy does not handle prepared statements the same as it handles regular statements (duh, right?). The problem is I can't find reference to how to handle them in the documentations. This lead me to doing some serious code reading. I discovered that I need to look for COM_STMT_PREPARE not COM_QUERY. This will let me look at the prepared statement's sql.

Now, my problem is how do I get the values of those bound variables out of the Proxy. I have tried printing out every packet with no success and I can't seem to find anything in the code that provides access to those values.

I also can't figure out how to make the prepared statements go through the read_query_results.

Any help would be appreciated.

Ex:

if packet:byte() == proxy.COM_QUERY then
print("we got a normal query: " .. packet:sub(2))
proxy.queries:append(1, packet )
return proxy.PROXY_SEND_QUERY
elseif packet:byte() == proxy.COM_STMT_PREPARE then
print("we got a prepared statement: " .. packet:sub(2))
return proxy.PROXY_SEND_QUERY
end

Options: ReplyQuote


Subject
Views
Written By
Posted
Bind Variables and MySQL Proxy
9317
January 30, 2008 07:52AM
2977
January 30, 2008 11:16AM
3515
January 30, 2008 03:39PM
2716
January 31, 2008 05:13AM
2968
January 31, 2008 01:37PM
2520
February 19, 2008 06:33PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.