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

« back to all changes in this revision

Viewing changes to tests/suite/base/t/bug_55459-test.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
 
--
3
 
function read_query( packet )
4
 
        if packet:byte() == proxy.COM_QUERY then
5
 
                proxy.queries:append(1, packet, { resultset_is_needed = true } )
6
 
        end
7
 
 
8
 
        -- forward the incoming query AS IS
9
 
end
10
 
 
11
 
---
12
 
function read_query_result(inj)
13
 
        local res = assert(inj.resultset)
14
 
 
15
 
        if res.query_status == proxy.MYSQLD_PACKET_ERR then
16
 
                print(("received error-code: %d"):format(
17
 
                        res.raw:byte(2)+(res.raw:byte(3)*256)
18
 
                ))
19
 
        end
20
 
end