3
Copyright (C) 2007 MySQL AB
5
This program is free software; you can redistribute it and/or modify
6
it under the terms of the GNU General Public License as published by
7
the Free Software Foundation; version 2 of the License.
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22
function read_handshake( auth )
23
print("<-- let's send him some information about us")
24
print(" server-addr : " .. auth.server_addr)
25
print(" client-addr : " .. auth.client_addr)
28
function read_auth( auth )
29
print("--> there, look, the client is responding to the server auth packet")
30
print(" username : " .. auth.username)
35
function read_auth_result( auth )
36
local state = auth.packet:byte()
38
if state == proxy.MYSQLD_PACKET_OK then
40
elseif state == proxy.MYSQLD_PACKET_ERR then
41
print("<-- auth failed");
43
print("<-- auth ... don't know: " .. string.format("%q", auth.packet));
47
function read_query( packet )
48
print("--> '".. user .."' sent us a query")
49
if packet:byte() == proxy.COM_QUERY then
50
print(" query: " .. packet:sub(2))