Mysqlnd replication and load balancing plugin (
mysqlnd_ms
)
2615
}
}
}
}
The callback is supposed to return a host to run the query on. The
host URI is to be taken from the master and slave connection lists
passed to the callback function. If callback returns a value neither
found in the master nor in the slave connection lists the plugin
will emit an error of the type
E_RECOVERABLE_ERROR
The error
may read like
(mysqlnd_ms) User filter callback has
returned an unknown server. The server 'server
that is not in master or slave list' can neither
be found in the master list nor in the slave list
.
If the application catches the error to ignore it, follow up errors may
be set on the connection handle, for example,
(mysqlnd_ms) No
connection selected by the last filter
with the error
code
2000
and the sqlstate
HY000
. Furthermore a warning may be
emitted.
Referencing a non-existing function as a callback will result in
any error of the type
E_RECOVERABLE_ERROR
whenever the
plugin tries to callback function. The error message may reads
like:
(mysqlnd_ms) Specified callback (pick_server)
is not a valid callback
. If the application catches the
error to ignore it, follow up errors may be set on the connection
handle, for example,
(mysqlnd_ms) Specified callback
(pick_server) is not a valid callback
with the error
code
2000
and the sqlstate
HY000
. Furthermore a warning may be
emitted.
The following parameters are passed from the plugin to the callback.
Parameter
Description
Version
connected_host
URI of the currently connected database
server.
Since 1.1.0.
query
Query string of the statement for which a
server needs to be picked.
Since 1.1.0.
masters
List of master servers to choose from. Note,
that the list of master servers may not be
identical to the list of configured master
servers if the filter is not the first in the filter
chain. Previously run filters may have reduced
the master list already.
Since 1.1.0.
slaves
List of slave servers to choose from. Note, that
the list of master servers may not be identical
to the list of configured master servers if
the filter is not the first in the filter chain.
Previously run filters may have reduced the
master list already.
Since 1.1.0.
last_used_connection
URI of the server of the connection used to
execute the previous statement on.
Since 1.1.0.
in_transaction
Boolean flag indicating whether the statement
is part of an open transaction. If autocommit
Since 1.1.0.
Summary of Contents for 5.0
Page 1: ...MySQL 5 0 Reference Manual ...
Page 18: ...xviii ...
Page 60: ...40 ...
Page 396: ...376 ...
Page 578: ...558 ...
Page 636: ...616 ...
Page 844: ...824 ...
Page 1234: ...1214 ...
Page 1427: ...MySQL Proxy Scripting 1407 ...
Page 1734: ...1714 ...
Page 1752: ...1732 ...
Page 1783: ...Configuring Connector ODBC 1763 ...
Page 1793: ...Connector ODBC Examples 1773 ...
Page 1839: ...Connector Net Installation 1819 2 You must choose the type of installation to perform ...
Page 2850: ...2830 ...
Page 2854: ...2834 ...
Page 2928: ...2908 ...
Page 3000: ...2980 ...
Page 3122: ...3102 ...
Page 3126: ...3106 ...
Page 3174: ...3154 ...
Page 3232: ...3212 ...