MySQL Forums
Forum List  »  Router & Proxy

Re: On mysql-proxy handling of prepared statements
Posted by: Giuseppe Lavagetto
Date: April 15, 2009 08:42AM

Answering to myself: my file had a typo: it's COM_STMT and not COM_STMNT...

Other than that, my basic question remains.

By now, I'm trying to send all prepared statements to the master. But I still get a NULL answer to my query.

in rw-splitting.lua, function read_query, I added at the end of the
big if statement starting with
        if not is_in_transaction and
           cmd.type == proxy.COM_QUERY then
I added
        -- addition
        elseif cmd.type == proxy.COM_STMT_PREPARE or
                cmd.type == proxy.COM_STMT_EXECUTE or
                cmd.type == proxy.COM_STMT_CLOSE then
                -- let's pick a master as a good default
                --
                print( "["..os.date("%c", os.time()).."]" .. " I'm in a prepared statement, using master by default")
                proxy.connection.backend_ndx = lb.idle_failsafe_rw()
        end
        -- end addition

Still, I don't get the correct answer. How is it possible?

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: On mysql-proxy handling of prepared statements
3091
April 15, 2009 08:42AM


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.