2
Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
4
This program is free software; you can redistribute it and/or
5
modify it under the terms of the GNU General Public License as
6
published by the Free Software Foundation; version 2 of the
9
This program is distributed in the hope that it will be useful,
10
but WITHOUT ANY WARRANTY; without even the implied warranty of
11
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
GNU General Public License for more details.
14
You should have received a copy of the GNU General Public License
15
along with this program; if not, write to the Free Software
16
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20
local proto = require("mysql.proto")
26
function read_query(packet)
27
-- pass on everything that is not on the initial connection
29
if packet:byte() ~= proxy.COM_QUERY then
31
type = proxy.MYSQLD_PACKET_OK
33
return proxy.PROXY_SEND_RESULT
36
if packet:sub(2) == "SELECT 1" then
37
proxy.queries:prepend(1, packet, { resultset_is_needed = true })
39
return proxy.PROXY_SEND_QUERY
42
type = proxy.MYSQLD_PACKET_ERR,
43
errmsg = "(bug_41991-test) >" .. packet:sub(2) .. "<"
45
return proxy.PROXY_SEND_RESULT
49
function read_query_result(inj)
52
type = proxy.MYSQLD_PACKET_OK,
55
{ name = "1", type = proxy.MYSQL_TYPE_STRING },
62
return proxy.PROXY_SEND_RESULT