summaryrefslogtreecommitdiff
path: root/includes/database/pgsql/database.inc
diff options
context:
space:
mode:
authorAngie Byron <webchick@24967.no-reply.drupal.org>2009-05-27 01:50:36 +0000
committerAngie Byron <webchick@24967.no-reply.drupal.org>2009-05-27 01:50:36 +0000
commit9eeec33415ac04ac78431eae9e902aed385650b6 (patch)
tree8455d709b77178dc2a02d9477cce9d23395a7ed0 /includes/database/pgsql/database.inc
parentbdf23cd13513e860f892f28f984f3425a3c87a39 (diff)
downloadbrdo-9eeec33415ac04ac78431eae9e902aed385650b6.tar.gz
brdo-9eeec33415ac04ac78431eae9e902aed385650b6.tar.bz2
#467474 by Josh Waihi: Type-cast booleans to work around PostgreSQL PDO bug.
Diffstat (limited to 'includes/database/pgsql/database.inc')
-rw-r--r--includes/database/pgsql/database.inc11
1 files changed, 11 insertions, 0 deletions
diff --git a/includes/database/pgsql/database.inc b/includes/database/pgsql/database.inc
index c27e8203c..ba82aa0b0 100644
--- a/includes/database/pgsql/database.inc
+++ b/includes/database/pgsql/database.inc
@@ -42,6 +42,17 @@ class DatabaseConnection_pgsql extends DatabaseConnection {
$options += $this->defaultOptions();
+ // The PDO PostgreSQL driver has a bug which
+ // doesn't type cast booleans correctly when
+ // parameters are bound using associative
+ // arrays.
+ // See http://bugs.php.net/bug.php?id=48383
+ foreach ($args as &$value) {
+ if (is_bool($value)) {
+ $value = (int) $value;
+ }
+ }
+
try {
if ($query instanceof DatabaseStatementInterface) {
$stmt = $query;