Added MYSQL_ATTR_USE_BUFFERED_QUERY driver option with value true for mysql/maria connections

This commit is contained in:
Alejandro Celaya 2020-04-18 13:21:46 +02:00
parent 078c8ea011
commit 7c6827ea9f
4 changed files with 5 additions and 1 deletions

View File

@ -51,7 +51,7 @@
"shlinkio/shlink-common": "dev-master#e659cf9d9b5b3b131419e2f55f2e595f562baafc as 3.1.0",
"shlinkio/shlink-config": "^1.0",
"shlinkio/shlink-event-dispatcher": "^1.4",
"shlinkio/shlink-installer": "dev-master#487227bfc03233b44e8a113af0bc5bd0c6d67d5d as 5.0.0",
"shlinkio/shlink-installer": "dev-master#508652c895fb88512b8685198be1e2cfca59f4ce as 5.0.0",
"shlinkio/shlink-ip-geolocation": "^1.4",
"symfony/console": "^5.0",
"symfony/filesystem": "^5.0",

View File

@ -12,6 +12,7 @@ return [
'host' => 'shlink_db',
'driverOptions' => [
PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8',
PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => true,
],
],
],

View File

@ -35,6 +35,7 @@ $buildDbConnection = function (): array {
'charset' => 'utf8',
'driverOptions' => [
PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8',
PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => true,
],
],
'postgres' => [

View File

@ -41,6 +41,8 @@ $helper = new class {
$driverOptions = ! contains(['maria', 'mysql'], $driver) ? [] : [
// 1002 -> PDO::MYSQL_ATTR_INIT_COMMAND
1002 => 'SET NAMES utf8',
// 1000 -> PDO::MYSQL_ATTR_USE_BUFFERED_QUERY
1000 => true,
];
return [
'driver' => self::DB_DRIVERS_MAP[$driver],