Oracle 5.0 Reference Manual page 1433

Table of Contents

Advertisement

proxy.response.type
to a string with the error message. To send the completed result set or error message, you should
return the
proxy.PROXY_SEND_RESULT
An example of this can be seen in the
package:
if string.lower(command) == "show" and string.lower(option) == "querycounter" then
---
-- proxy.PROXY_SEND_RESULT requires
--
-- proxy.response.type to be either
-- * proxy.MYSQLD_PACKET_OK or
-- * proxy.MYSQLD_PACKET_ERR
--
-- for proxy.MYSQLD_PACKET_OK you need a resultset
-- * fields
-- * rows
--
-- for proxy.MYSQLD_PACKET_ERR
-- * errmsg
proxy.response.type = proxy.MYSQLD_PACKET_OK
proxy.response.resultset = {
fields = {
},
rows = {
}
}
-- we have our result, send it back
return proxy.PROXY_SEND_RESULT
elseif string.lower(command) == "show" and string.lower(option) == "myerror" then
proxy.response.type = proxy.MYSQLD_PACKET_ERR
proxy.response.errmsg = "my first error"
return proxy.PROXY_SEND_RESULT
proxy.response.resultset
The
proxy.response.resultset
to return. The structure contains the information about the entire result set, with the individual elements
of the data shown in the following table.
The following table describes the attributes of the
Attribute
fields
flags
rows
warning_count
affected_rows
MySQL Proxy Scripting
to
proxy.MYSQLD_PACKET_ERR
to trigger the return of the packet information.
tutorial-resultset.lua
{ type = proxy.MYSQL_TYPE_LONG, name = "global_query_counter", },
{ type = proxy.MYSQL_TYPE_LONG, name = "query_counter", },
{ proxy.global.query_counter, query_counter }
structure should be populated with the rows and columns of data
Description
The definition of the columns being returned. This should be a
dictionary structure with the
the
specifying the column name. Columns should be listed in the
name
order of the column data that will be returned.
A number of flags related to the result set. Valid flags include
(whether an automatic commit was triggered),
auto_commit
no_good_index_used
appropriate index), and
using any index).
The actual row data. The information should be returned as an array of
arrays. Each inner array should contain the column data, with the outer
array making up the entire result set.
The number of warnings for this result set.
The number of rows affected by the original statement.
1413
and set the
proxy.response.errmsg
script within the MySQL Proxy
proxy.response.resultset
specifying the MySQL data type, and
type
(the query executed without using an
no_index_used
structure.
(the query executed without

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mysql 5.0

Table of Contents