diff options
author | Angie Byron <webchick@24967.no-reply.drupal.org> | 2009-05-27 01:50:36 +0000 |
---|---|---|
committer | Angie Byron <webchick@24967.no-reply.drupal.org> | 2009-05-27 01:50:36 +0000 |
commit | 9eeec33415ac04ac78431eae9e902aed385650b6 (patch) | |
tree | 8455d709b77178dc2a02d9477cce9d23395a7ed0 /includes/database/pgsql/database.inc | |
parent | bdf23cd13513e860f892f28f984f3425a3c87a39 (diff) | |
download | brdo-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.inc | 11 |
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; |