Simple backend change in read_query
Hello,
according to changes it should be possible now to change backend at the read_query() stage right? Looking at rw-splitting.lua code sample also looks like it.
I wanted to make a simplified script (for now without connection pooling) which just redirects queries to right backend based on some substrings in the SQL (for example specific table names).
In the end I have just stopped at:
function read_query( packet )
proxy.connection.backend_ndx = 3
return proxy.PROXY_SEND_QUERY
end
Still although the variable is changed (by printing it later out) the connection is still handled in a load balanced (SQF) way.
It can be simply tested by letting a script connect to mysql-proxy and execute something like SHOW VARIABLES LIKE 'hostname'. I always get different server.
What I'm doing wrong?
I didn't saw anything in the commands, tokenizer, lb or auto_config scripts which are loaded in the rw-splitting script.
Subject
Views
Written By
Posted
Simple backend change in read_query
4874
September 21, 2007 11:55AM
3006
October 22, 2007 05:04AM
2544
March 19, 2008 12:06AM
2602
March 28, 2008 12:04AM
2783
May 14, 2008 04:46AM
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.