MySQL Forums
Forum List  »  Router & Proxy

How to dispatch select to a certain backend?
Posted by: xu ning
Date: August 28, 2009 01:26AM

by using inherited function read_query below, I just print the received select query. But how to dispatch the query to a certain backend, say backend 1?

function read_query( packet )
local cmd = commands.parse(packet)
local tokens

tokens = tokens or assert(tokenizer.tokenize(cmd.query))
local stmt = tokenizer.first_stmt_token(tokens)

if stmt.token_name == "TK_SQL_SELECT" then
local query = string.sub(packet, 2)
print ("received " .. query)
return proxy.PROXY_SEND_QUERY
end
end

Options: ReplyQuote


Subject
Views
Written By
Posted
How to dispatch select to a certain backend?
5105
August 28, 2009 01:26AM


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.