Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
24.02.4
-
None
-
MXS-SPRINT-230, MXS-SPRINT-231
Description
A customer is seeing an issue when attempting to bind/prepare statements using PHP's mysqli connector. This works when connecting directly to the Columnstore instance, and also works when connecting through Maxscale's readconnroute router, but it fails when using the schemarouter.
Here's a snippet of the code they provided to replicate the problem:
$dbs = [ |
['dbserver'=>'10.30.180.131', 'user'=> 'qpoint', 'pass'=>'redacted', 'table' => 'dmw_dg_daily_4520', 'viid' => 8140013], |
['dbserver'=>'10.30.180.173:4010', 'user'=> 'qpoint', 'pass'=>'redacted', 'table' => 'dmw_dg_daily_4520', 'viid' => 8140013], |
['dbserver'=>'10.30.180.173:4011', 'user'=> 'qpoint', 'pass'=>'redacted', 'table' => 'dmw_dg_daily_4520', 'viid' => 8140013], |
];
|
 |
foreach($dbs as $db) { |
var_dump($db['dbserver']); |
$mysqli = new mysqli($db['dbserver'], $db['user'], $db['pass'], "temp"); |
$stmt = $mysqli->prepare("SELECT vi_data,vi_pv_id FROM {$db['table']}.visita WHERE vi_id=?"); |
$stmt->bind_param("i", $db['viid']); |
$stmt->execute(); |
$result = $stmt->get_result(); |
var_dump($result->fetch_all(MYSQLI_ASSOC)); |
}
|
The first $db connects directly to the Columnstore instance. The second $db connects through the readconnroute router over port 4010. Both return the correct results.
The third $db connects over the schemarouter on port 4011, and fails with this error:
string(18) "10.30.180.173:4011" |
PHP Fatal error: Uncaught mysqli_sql_exception: Unknown prepared statement handler (1) given to MaxScale for COM_STMT_EXECUTE by 'qpoint'@'10.30.180.100' in /tmp/testPreparaeBind.php:18 |
Stack trace:
|
#0 /tmp/testPreparaeBind.php(18): mysqli_stmt->execute()
|
#1 {main}
|
thrown in /tmp/testPreparaeBind.php on line 18
|
Maxscale log output:
2025-03-04 15:14:11 warning: (1408525) (fw-dbmcs3); MaxScale has encountered an unexpected situation: Unknown prepared statement handler (2) given to MaxScale for COM_STMT_EXECUTE by 'qpoint'@'10.30.180.1'. Add 'session_trace=200' under the [maxscale] section to enable session level tracing to make the debugging of this problem easier. |
2025-03-04 15:14:11 warning: (1408525) (fw-dbmcs3); Unknown prepared statement handler (2) given to MaxScale for COM_STMT_EXECUTE by 'qpoint'@'10.30.180.1' |
Please let me know if there's anything else I need to provide. Thanks!