Oracle 5.0 Reference Manual page 2645

Table of Contents

Advertisement

Mysqlnd replication and load balancing plugin (mysqlnd_ms)
An application using lazy connections may attempt to escape
a string before sending a statement. In fact, this should be a
common case as the statement string may contain the string that
is to be escaped. However, due to the lazy connection feature no
connection has been opened yet and escaping fails. The plugin
may report an error of the type
(mysqlnd_ms) string escaping doesn't work without
established connection. Possible solution is to
add server_charset to your configuration
of the pitfall.
Setting
for string escaping done on lazy connection handles before
establishing a network connection to MySQL. Furthermore, the
plugin will enforce the use of the charset when the connection is
established.
Enforcing the use of the configured charset used for escaping is
done to prevent tapping into the pitfall of using a different charset for
escaping than used later for the connection. This has the additional
benefit of removing the need to align the charset configuration of
all servers used. No matter what the default charset on any of the
servers is, the plugin will set the configured one as a default.
The plugin does not stop the user from changing the charset at
any time using the
statements. Please, note that the use of SQL is not recommended
as it cannot be monitored by the plugin. The user can, for example,
change the charset on a lazy connection handle after escaping
a string and before the actual connection is opened. The charset
set by the user will be used for any subsequent escaping before
the connection is established. The connection will be established
using the configured charset, no matter what the server charset is or
what the user has set before. Once a connection has been opened,
set_charset
Example 20.288. String escaping on a lazy connection handle
{
"myapp": {
}
}
<?php
$mysqli = new mysqli("myapp", "username", "password", "database");
$mysqli->real_escape("this will be escaped using the server_charset set
E_WARNING
makes the plugin use the given charset
server_charset
set_charset
is of no meaning anymore.
"master": {
"master_0": {
"host": "localhost"
}
},
"slave": {
"slave_0": {
"host": "192.168.78.136",
"port": "3306"
}
},
"lazy_connections": 1,
"server_charset" : "utf8"
2625
and a message like
to inform you
call or corresponding SQL

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mysql 5.0

Table of Contents