Always use emulate_prepares
parent
4f857a1cd5
commit
be74f89d55
|
@ -3,7 +3,7 @@
|
||||||
/**
|
/**
|
||||||
* PDO/PostgreSQL wrapper with (mostly) DatabaseMySQL interface :)
|
* PDO/PostgreSQL wrapper with (mostly) DatabaseMySQL interface :)
|
||||||
* Select builder is inspired by MediaWiki's one.
|
* Select builder is inspired by MediaWiki's one.
|
||||||
* Version: 2018-08-12
|
* Version: 2018-09-18
|
||||||
* (c) Vitaliy Filippov, 2015-2018
|
* (c) Vitaliy Filippov, 2015-2018
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -38,7 +38,7 @@ if (!interface_exists('Database'))
|
||||||
|
|
||||||
class DatabasePdoPgsql implements Database
|
class DatabasePdoPgsql implements Database
|
||||||
{
|
{
|
||||||
var $host, $port, $socket, $username, $password, $dbname, $pgbouncer;
|
var $host, $port, $socket, $username, $password, $dbname;
|
||||||
|
|
||||||
var $tableNames = array();
|
var $tableNames = array();
|
||||||
var $init = array();
|
var $init = array();
|
||||||
|
@ -84,7 +84,6 @@ class DatabasePdoPgsql implements Database
|
||||||
'queryLogFile' => '',
|
'queryLogFile' => '',
|
||||||
'autoBegin' => false,
|
'autoBegin' => false,
|
||||||
'ondestroy' => 'commit',
|
'ondestroy' => 'commit',
|
||||||
'pgbouncer' => false,
|
|
||||||
'init' => array(),
|
'init' => array(),
|
||||||
);
|
);
|
||||||
$options += $defOpts;
|
$options += $defOpts;
|
||||||
|
@ -117,7 +116,7 @@ class DatabasePdoPgsql implements Database
|
||||||
$this->link = new PDO($str, $this->username, $this->password, array(
|
$this->link = new PDO($str, $this->username, $this->password, array(
|
||||||
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
|
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
|
||||||
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
|
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
|
||||||
PDO::ATTR_EMULATE_PREPARES => !empty($this->pgbouncer),
|
PDO::ATTR_EMULATE_PREPARES => true,
|
||||||
));
|
));
|
||||||
foreach ($this->init as $q)
|
foreach ($this->init as $q)
|
||||||
$this->link->query($q);
|
$this->link->query($q);
|
||||||
|
|
Loading…
Reference in New Issue