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

« back to all changes in this revision

Viewing changes to tests/suite/base/t/resultset-test.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:
81
81
                                }
82
82
                        }
83
83
                        return proxy.PROXY_SEND_RESULT
 
84
                elseif inj.query == string.char(proxy.COM_QUERY) .. "SELECT 5.0" then
 
85
                        -- test if we decode a 5.0 resultset nicely
 
86
                        assert(res.affected_rows == nil)
 
87
                        proxy.response = {
 
88
                                type = proxy.MYSQLD_PACKET_OK,
 
89
                                resultset = {
 
90
                                        fields = { 
 
91
                                                { name = "row_count",
 
92
                                                  type = proxy.MYSQL_TYPE_LONG },
 
93
                                                { name = "bytes",
 
94
                                                  type = proxy.MYSQL_TYPE_LONG },
 
95
                                        },
 
96
                                        rows = {
 
97
                                                { res.row_count, res.bytes }
 
98
                                        }
 
99
                                }
 
100
                        }
 
101
                        return proxy.PROXY_SEND_RESULT
 
102
                elseif inj.query == string.char(proxy.COM_QUERY) .. "SELECT 4.1" then
 
103
                        -- test if we decode a 4.1 resultset too (shorter EOF packets)
 
104
                        assert(res.affected_rows == nil)
 
105
                        proxy.response = {
 
106
                                type = proxy.MYSQLD_PACKET_OK,
 
107
                                resultset = {
 
108
                                        fields = { 
 
109
                                                { name = "row_count",
 
110
                                                  type = proxy.MYSQL_TYPE_LONG },
 
111
                                                { name = "bytes",
 
112
                                                  type = proxy.MYSQL_TYPE_LONG },
 
113
                                        },
 
114
                                        rows = {
 
115
                                                { res.row_count, res.bytes }
 
116
                                        }
 
117
                                }
 
118
                        }
 
119
                        return proxy.PROXY_SEND_RESULT
84
120
                end
85
121
        elseif status == proxy.MYSQLD_PACKET_ERR then
86
122
                if inj.query == string.char(proxy.COM_QUERY) .. "SELECT error_msg()" then