Bug #67564 [NEW]: mysqli::ping mysqlnd_ms return Out of sync error
| From: | accounts at dotmanila dot com | Date: | Fri, 04 Jul 2014 03:38:11 +0000 |
| Subject: | Bug #67564 [NEW]: mysqli::ping mysqlnd_ms return Out of sync error | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-186458@lists.php.net to get a copy of this message | ||
From: accounts at dotmanila dot com
Operating system: CentOS 6.5
PHP version: 5.4.30
Package: MySQLi related
Bug Type: Bug
Bug description:mysqli::ping mysqlnd_ms return Out of sync error
Description:
------------
When using mysqlnd_ms after creating a new mysqli object and executing a
ping, an error is returned like:
Connection to host 'primary' failed: [0] Commands out of sync; you can't
run this command now
If mysqlnd_ms is disabled, this works well without errors.
mysqlnd => enabled
Version => mysqlnd 5.0.10 - 20111026 - $Id:
c85105d7c6f7d70d609bb4c000257868a40840ab $
Compression => supported
SSL => supported
Command buffer size => 4096
Read buffer size => 32768
Read timeout => 31536000
Collecting statistics => Yes
Collecting memory statistics => No
Tracing => n/a
Loaded plugins =>
mysqlnd,example,debug_trace,auth_plugin_mysql_native_password,auth_plugin_mysql_clear_password
API Extensions => mysql,mysqli,pdo_mysql
Test script:
---------------
When using mysqlnd_ms:
----------------------
-- INI file:
mysqlnd_ms.enable=1
mysqlnd_ms.force_config_usage = 1
mysqlnd_ms.config_file=mysqlnd_ms_ms.ini
-- mysqlnd_ms_ms.ini
{
"primary": {
"master": {
"master_1": {
"host": "127.0.0.1",
"port": "33001"
}
},
"slave": {
"slave_0": {
"host": "127.0.0.1",
"port": "33002"
}
}
}
}
<?php
$mysql_host = 'primary';
$mysqli = new mysqli($mysql_host, "msandbox", "msandbox", "test");
$t = $mysqli->ping();
if(!$t) {
printf("Connection to host '{$mysql_host}' failed: [%d] %s, retrying
($retries of 10) in 3 seconds\n",
$mysqli->connect_errno, $mysqli->error
);
}
?>
When using mysqlnd only:
----------------------
<?php
$mysql_host = '127.0.0.1:33001';
$mysqli = new mysqli($mysql_host, "msandbox", "msandbox", "test");
$t = $mysqli->ping();
if(!$t) {
printf("Connection to host '{$mysql_host}' failed: [%d] %s, retrying
($retries of 10) in 3 seconds\n",
$mysqli->connect_errno, $mysqli->error
);
}
?>
--
Edit bug report at https://bugs.php.net/bug.php?id=67564&edit=1
--