Skip to content

Commit

Permalink
Set collation on connection, closes #182
Browse files Browse the repository at this point in the history
  • Loading branch information
g105b committed Jan 29, 2020
1 parent ec42643 commit 3d498ea
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/Connection/Driver.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,13 @@ protected function connect() {
Connection::ATTR_ERRMODE => Connection::ERRMODE_EXCEPTION,
];

if($this->settings->getSchema() === Settings::DRIVER_MYSQL) {
$options[Connection::MYSQL_ATTR_INIT_COMMAND]
= "SET SESSION collation_connection='"
. $this->settings->getCollation()
. "'";
}

$this->connection = new Connection(
$this->settings->getConnectionString(),
$this->settings->getUsername(),
Expand Down

0 comments on commit 3d498ea

Please sign in to comment.