Re-add check for stringToBinary on $column, since it was causing a fatal error in...
authorChuck Hagenbuch <chuck@horde.org>
Mon, 31 May 2010 01:21:05 +0000 (21:21 -0400)
committerChuck Hagenbuch <chuck@horde.org>
Mon, 31 May 2010 01:30:32 +0000 (21:30 -0400)
framework/Db/lib/Horde/Db/Adapter/Base/Schema.php
framework/Db/lib/Horde/Db/Adapter/Postgresql/Schema.php

index 482e78d..e85c96b 100644 (file)
@@ -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';
         }
index a1f3492..a4d0ca2 100644 (file)
@@ -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) . "'";