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

« back to all changes in this revision

Viewing changes to tests/suite/base/t/resultset-mock.lua

  • Committer: Kay Roepke
  • Date: 2008-11-12 14:10:22 UTC
  • Revision ID: kay@mysql.com-20081112141022-ccx7xglj8nxd32m9
merge head

Show diffs side-by-side

added added

removed removed

Lines of Context:
100
100
                        sqlstate = "42000",
101
101
                        errcode = 1064
102
102
                }
 
103
        elseif query == 'SELECT 5.0' then
 
104
                -- return a empty row
 
105
                --
 
106
                -- HINT: lua uses \ddd (3 decimal digits) instead of octals
 
107
                proxy.response.type = proxy.MYSQLD_PACKET_RAW
 
108
                proxy.response.packets = {
 
109
                        "\001",  -- one field
 
110
                        "\003def" ..   -- catalog
 
111
                          "\0" ..    -- db 
 
112
                          "\0" ..    -- table
 
113
                          "\0" ..    -- orig-table
 
114
                          "\0011" .. -- name
 
115
                          "\0" ..    -- orig-name
 
116
                          "\f" ..    -- filler
 
117
                          "\008\0" .. -- charset
 
118
                          " \0\0\0" .. -- length
 
119
                          "\003" ..    -- type
 
120
                          "\002\0" ..  -- flags 
 
121
                          "\0" ..    -- decimals
 
122
                          "\0\0",    -- filler
 
123
 
 
124
                        "\254\0\0\002\0", -- EOF
 
125
                        "\0011",
 
126
                        "\254\0\0\002\0"  -- no data EOF
 
127
                }
 
128
                
 
129
                return proxy.PROXY_SEND_RESULT
 
130
        elseif query == 'SELECT 4.1' then
 
131
                -- return a empty row
 
132
                --
 
133
                -- HINT: lua uses \ddd (3 decimal digits) instead of octals
 
134
                proxy.response.type = proxy.MYSQLD_PACKET_RAW
 
135
                proxy.response.packets = {
 
136
                        "\001",  -- one field
 
137
                        "\003def" ..   -- catalog
 
138
                          "\0" ..    -- db 
 
139
                          "\0" ..    -- table
 
140
                          "\0" ..    -- orig-table
 
141
                          "\0011" .. -- name
 
142
                          "\0" ..    -- orig-name
 
143
                          "\f" ..    -- filler
 
144
                          "\008\0" .. -- charset
 
145
                          " \0\0\0" .. -- length
 
146
                          "\003" ..    -- type
 
147
                          "\002\0" ..  -- flags 
 
148
                          "\0" ..    -- decimals
 
149
                          "\0\0",    -- filler
 
150
 
 
151
                        "\254", -- EOF
 
152
                        "\0011",
 
153
                        "\254\0\0\002\0"  -- no data EOF
 
154
                }
 
155
                
 
156
                return proxy.PROXY_SEND_RESULT
 
157
 
103
158
        else
104
159
                proxy.response = {
105
160
                        type = proxy.MYSQLD_PACKET_ERR,