swoole/library

mysql set_opt should be called before connecting

Closed this issue · 0 comments

https://github.com/swoole/library/blob/0f250bc7e7451992e0de103f07b284996feba07f/src/core/Database/MysqliPool.php

In current version, set_opt called after connect so none of these options work. This should be replaced with:

$mysqli = new mysqli();
foreach ($this->config->getOptions() as $option => $value) {
    $mysqli->set_opt($option, $value);
}
$mysqli->real_connect(....);