Oracle 5.0 Reference Manual page 1430

Table of Contents

Advertisement

SELECT * FROM City;
EXPLAIN SELECT * FROM City;
In both of these examples, the client would have received more result sets than expected. Regardless
of how you manipulate the incoming query and the returned result, the number of queries returned by
the proxy must match the number of original queries sent by the client.
You could adjust the client to handle the multiple result sets sent by the proxy, but in most cases you
will want the existence of the proxy to remain transparent. To ensure that the number of queries and
result sets match, you can use the MySQL Proxy
result set information and return only the result set the client originally requested back to the client.
You can achieve this by giving each query that you add to the query queue a unique ID, then filter out
queries that do not match the original query ID when processing them with read_query_result().
15.7.4.2. Internal Structures
There are a number of internal structures within the scripting element of MySQL Proxy. The primary
structure is
script, such as connection lists and configured backend servers. Other structures, such as the incoming
packet from the client and result sets are only available within the context of one of the scriptable
functions.
The following table describes common attributes of the MySQL
Attribute
connection
servers
queries
PROXY_VERSION
proxy.connection
The
proxy.connection
and is split into a
incoming client connections to the proxy (client), and to the backend servers (server).
The following table describes the client and server attributes of the
Attribute
client.default_db
client.username
client.scrambled_password
client.dst.name
client.dst.address
client.dst.port
client.src.name
and this provides an interface to the many common structures used throughout the
proxy
Description
A structure containing the active client connections. For a list of
attributes, see
A structure containing the list of configured backend servers. For a list
of attributes, see
A structure containing the queue of queries that will be sent to
the server during a single client query. For a list of attributes, see
proxy.queries
The version number of MySQL Proxy, encoded in hex. You can use
this to check that the version number supports a particular option from
within the Lua script. Note that the value is encoded as a hex value, so
to check the version is at least 0.5.1 you compare against 0x00501.
object is read only, and provides information about the current connection,
and
client
server
Description
Default database requested by the client
User name used to authenticate
The scrambled version of the password used to authenticate
The combined
client (should match the
parameter)
The IP address of the of the Proxy port used by this client
The port number of the of the Proxy port used by this client
The combined
endpoint
MySQL Proxy Scripting
read_query_result()
proxy.connection
proxy.global.backends
[1411].
tables. This enables you to examine information about both the
address:port
--proxy-address
address:port
1410
to extract the additional
scripting element.
proxy
[1410].
[1411].
proxy.connection
of the Proxy port used by this
[1403]
configuration
of the client (originating) TCP/IP
object.

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mysql 5.0

Table of Contents