~jan-kneschke/mysql-proxy/packet-tracking-assertions

« back to all changes in this revision

Viewing changes to tags/mysql-proxy-0.6.1/tests/suite/base/t/chain1a.lua

  • Committer: Kay Roepke
  • Author(s): Jan Kneschke
  • Date: 2008-01-23 22:00:28 UTC
  • Revision ID: kay@mysql.com-20080123220028-hq2xqb69apa75fnx
first round on mysql-shell based on the proxy code

this is mostly a verification if the proxy-code is flexible enough to handle 
all three scenarios of: client, server and forwarding (proxy)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
function read_query(packet)
 
3
    if packet:byte() ~= proxy.COM_QUERY then
 
4
        return
 
5
    end
 
6
    local query = packet:sub(2) 
 
7
    if query == 'SELECT 1, "ADDITION"' then
 
8
        proxy.queries:append(1, string.char(proxy.COM_QUERY) .. 'SELECT 1, "ADDITION", "SECOND ADDITION"')
 
9
        return proxy.PROXY_SEND_QUERY
 
10
    end
 
11
end
 
12
 
 
13
function read_query_result(inj)
 
14
 
 
15
end
 
16
 
 
17
 
 
18