Skip to content

Commit

Permalink
set_charset() should be called if DB connection succeeds
Browse files Browse the repository at this point in the history
reported by @timaelliott
close #164
  • Loading branch information
deminy committed Dec 9, 2023
1 parent d19ae0d commit f3d97d5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/core/Database/MysqliPool.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ public function __construct(MysqliConfig $config, int $size = self::DEFAULT_SIZE
$this->config->getPort(),
$this->config->getUnixSocket()
);
$mysqli->set_charset($this->config->getCharset());
if ($mysqli->connect_errno) {
throw new MysqliException($mysqli->connect_error, $mysqli->connect_errno);
}
$mysqli->set_charset($this->config->getCharset());
return $mysqli;
}, $size, MysqliProxy::class);
}
Expand Down

0 comments on commit f3d97d5

Please sign in to comment.