From: Chuck Hagenbuch Date: Mon, 31 May 2010 01:21:05 +0000 (-0400) Subject: Re-add check for stringToBinary on $column, since it was causing a fatal error in... X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=a191e1b6cc60cf9a270d66131f398e51fc487719;p=horde.git Re-add check for stringToBinary on $column, since it was causing a fatal error in the unit tests. --- 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) . "'";