MySQL Proxy 0.6 to 0.7
Contents |
In 0.7 we introduced several small tweaks to make the API more consistent
[edit] .address is now table
In several places we had a address-string like "127.0.0.1:3306" and you had to parse it to extract the IP and the port. Instead all those are now tables holding the split out information:
.address -> .src.name (or .src.address and .src.port)
In proxy.connection.client.* and proxy.connection.server.* you have a .src and a .dst address as each socket has two end-points.
proxy.connection.client.address is proxy.connection.client.src.name proxy.connection.server.address is proxy.connection.server.dst.name
[edit] proxy.global.backends
proxy.backends is now in proxy.global.backends
We moved it have only _one_ global namespace. The .address field of each backend is a address-object as described above:
proxy.backends[1].address is proxy.global.backends[1].dst.name
[edit] read_auth() and read_handshake()
read_auth() and read_handshake() don't receive a paramater anymore. Instead all the data is available in the connection tables.
In read_handshake() it is:
0.6 | 0.7 |
---|---|
auth.thread_id | proxy.connection.server.thread_id |
auth.mysqld_version | proxy.connection.server.mysqld_version |
auth.server_addr | proxy.connection.server.dst.name |
auth.client_addr | proxy.connection.client.src.name |
auth.scramble | proxy.connection.server.scramble_buffer |
In read_auth() it is the client side of the connection:
0.6 | 0.7 |
---|---|
auth.username | proxy.connection.client.username |
auth.password | proxy.connection.client.scrambled_password |
auth.default_db | proxy.connection.client.default_db |
auth.server_addr | proxy.connection.server.dst.name |
auth.client_addr | proxy.connection.client.src.name |
[edit] resultset_is_needed
in proxy.queries:append() a 3rd parameter is a (optional) table with options specific to the this packet.
If we want to have access to the resultset in the read_query_result() hook, you have to set resultset_is_needed:
proxy.queries:append( 1, ..., { resultset_is_needed = true } )
If that flag is false (default) it will:
- send the resultset to the client when it is received
- less memory usage
- lower latency
- good for passing on data unaltered
You have to set it to true if you want to:
- read the resultset alter
- change the resultset before it is sent to the client
- want to discard the resultset
[edit] proxy.global.backends
proxy.backends is now in proxy.global.backends
We moved it have only _one_ global namespace. Otherwise it is unchanged.