Skip to content

mysql set_opt should be called before connecting #34

Closed
@zsxsoft

Description

@zsxsoft

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(....);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions