From a191e1b6cc60cf9a270d66131f398e51fc487719 Mon Sep 17 00:00:00 2001 From: Chuck Hagenbuch Date: Sun, 30 May 2010 21:21:05 -0400 Subject: [PATCH] Re-add check for stringToBinary on $column, since it was causing a fatal error in the unit tests. --- framework/Db/lib/Horde/Db/Adapter/Base/Schema.php | 3 ++- framework/Db/lib/Horde/Db/Adapter/Postgresql/Schema.php | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/framework/Db/lib/Horde/Db/Adapter/Base/Schema.php b/framework/Db/lib/Horde/Db/Adapter/Base/Schema.php index 482e78d43..e85c96b49 100644 --- a/framework/Db/lib/Horde/Db/Adapter/Base/Schema.php +++ b/framework/Db/lib/Horde/Db/Adapter/Base/Schema.php @@ -753,7 +753,8 @@ abstract class Horde_Db_Adapter_Base_Schema public function addColumnOptions($sql, $options) { /* 'autoincrement' is not handled here - it varies too much between - * DBs. Do autoincrement specific handling in the driver. */ + * DBs. Do autoincrement-specific handling in the driver. */ + if (isset($options['null']) && $options['null'] === false) { $sql .= ' NOT NULL'; } diff --git a/framework/Db/lib/Horde/Db/Adapter/Postgresql/Schema.php b/framework/Db/lib/Horde/Db/Adapter/Postgresql/Schema.php index a1f349252..a4d0ca286 100644 --- a/framework/Db/lib/Horde/Db/Adapter/Postgresql/Schema.php +++ b/framework/Db/lib/Horde/Db/Adapter/Postgresql/Schema.php @@ -74,7 +74,7 @@ class Horde_Db_Adapter_Postgresql_Schema extends Horde_Db_Adapter_Base_Schema if (!$column) return parent::quote($value, $column); - if (is_string($value) && ($column->getType() == 'binary')) { + if (is_string($value) && ($column->getType() == 'binary') && method_exists($column, 'stringToBinary')) { /*@TODO test blobs/bytea fields with postgres/pdo and figure out how this should work */ return $this->quotedStringPrefix() . "'" . $column->stringToBinary($value) . "'"; -- 2.11.0