[Jaws-commits] r13188 - in branches/0.8/html/libraries/pear/MDB2/Driver: . Datatype Function Manager Reverse

afz at jaws-project.com afz at jaws-project.com
Wed Aug 1 18:06:02 UTC 2012


Author: afz
Date: 2012-08-01 18:06:02 +0000 (Wed, 01 Aug 2012)
New Revision: 13188

Modified:
   branches/0.8/html/libraries/pear/MDB2/Driver/Datatype/Common.php
   branches/0.8/html/libraries/pear/MDB2/Driver/Datatype/ibase.php
   branches/0.8/html/libraries/pear/MDB2/Driver/Datatype/mssql.php
   branches/0.8/html/libraries/pear/MDB2/Driver/Datatype/pgsql.php
   branches/0.8/html/libraries/pear/MDB2/Driver/Datatype/sqlite.php
   branches/0.8/html/libraries/pear/MDB2/Driver/Datatype/sqlsrv.php
   branches/0.8/html/libraries/pear/MDB2/Driver/Function/Common.php
   branches/0.8/html/libraries/pear/MDB2/Driver/Function/ibase.php
   branches/0.8/html/libraries/pear/MDB2/Driver/Function/mssql.php
   branches/0.8/html/libraries/pear/MDB2/Driver/Function/mysql.php
   branches/0.8/html/libraries/pear/MDB2/Driver/Function/mysqli.php
   branches/0.8/html/libraries/pear/MDB2/Driver/Function/oci8.php
   branches/0.8/html/libraries/pear/MDB2/Driver/Function/pgsql.php
   branches/0.8/html/libraries/pear/MDB2/Driver/Function/sqlite.php
   branches/0.8/html/libraries/pear/MDB2/Driver/Manager/Common.php
   branches/0.8/html/libraries/pear/MDB2/Driver/Manager/fbsql.php
   branches/0.8/html/libraries/pear/MDB2/Driver/Manager/ibase.php
   branches/0.8/html/libraries/pear/MDB2/Driver/Manager/mssql.php
   branches/0.8/html/libraries/pear/MDB2/Driver/Manager/mysql.php
   branches/0.8/html/libraries/pear/MDB2/Driver/Manager/mysqli.php
   branches/0.8/html/libraries/pear/MDB2/Driver/Manager/oci8.php
   branches/0.8/html/libraries/pear/MDB2/Driver/Manager/pgsql.php
   branches/0.8/html/libraries/pear/MDB2/Driver/Manager/sqlite.php
   branches/0.8/html/libraries/pear/MDB2/Driver/Manager/sqlsrv.php
   branches/0.8/html/libraries/pear/MDB2/Driver/Reverse/sqlite.php
   branches/0.8/html/libraries/pear/MDB2/Driver/fbsql.php
   branches/0.8/html/libraries/pear/MDB2/Driver/ibase.php
   branches/0.8/html/libraries/pear/MDB2/Driver/mssql.php
   branches/0.8/html/libraries/pear/MDB2/Driver/mysql.php
   branches/0.8/html/libraries/pear/MDB2/Driver/mysqli.php
   branches/0.8/html/libraries/pear/MDB2/Driver/oci8.php
   branches/0.8/html/libraries/pear/MDB2/Driver/pgsql.php
   branches/0.8/html/libraries/pear/MDB2/Driver/sqlite.php
   branches/0.8/html/libraries/pear/MDB2/Driver/sqlsrv.php
Log:
Update PEAR::MDB2

Modified: branches/0.8/html/libraries/pear/MDB2/Driver/Datatype/Common.php
===================================================================
--- branches/0.8/html/libraries/pear/MDB2/Driver/Datatype/Common.php	2012-08-01 12:50:42 UTC (rev 13187)
+++ branches/0.8/html/libraries/pear/MDB2/Driver/Datatype/Common.php	2012-08-01 18:06:02 UTC (rev 13188)
@@ -263,7 +263,11 @@
      */
     function convertResultRow($types, $row, $rtrim = true)
     {
-        $types = $this->_sortResultFieldTypes(array_keys($row), $types);
+        //$types = $this->_sortResultFieldTypes(array_keys($row), $types);
+        $keys = array_keys($row);
+        if (is_int($keys[0])) {
+            $types = $this->_sortResultFieldTypes($keys, $types);
+        }
         foreach ($row as $key => $value) {
             if (empty($types[$key])) {
                 continue;
@@ -524,7 +528,7 @@
 
     // }}}
     // {{{ _getCharsetFieldDeclaration()
-    
+
     /**
      * Obtain DBMS specific SQL code portion needed to set the CHARACTER SET
      * of a field declaration to be used in statements like CREATE TABLE.
@@ -1381,7 +1385,7 @@
             if (PEAR::isError($db)) {
                 return $db;
             }
-            if (isset($db->function) && is_a($db->function, 'MDB2_Driver_Function_Common')) {
+            if (isset($db->function) && is_object($this->function) && is_a($db->function, 'MDB2_Driver_Function_Common')) {
                 return $db->function->now('date');
             }
             return 'CURRENT_DATE';
@@ -1410,7 +1414,7 @@
             if (PEAR::isError($db)) {
                 return $db;
             }
-            if (isset($db->function) && is_a($db->function, 'MDB2_Driver_Function_Common')) {
+            if (isset($db->function) && is_object($this->function) && is_a($db->function, 'MDB2_Driver_Function_Common')) {
                 return $db->function->now('timestamp');
             }
             return 'CURRENT_TIMESTAMP';
@@ -1439,7 +1443,7 @@
             if (PEAR::isError($db)) {
                 return $db;
             }
-            if (isset($db->function) && is_a($db->function, 'MDB2_Driver_Function_Common')) {
+            if (isset($db->function) && is_object($this->function) && is_a($db->function, 'MDB2_Driver_Function_Common')) {
                 return $db->function->now('time');
             }
             return 'CURRENT_TIME';

Modified: branches/0.8/html/libraries/pear/MDB2/Driver/Datatype/ibase.php
===================================================================
--- branches/0.8/html/libraries/pear/MDB2/Driver/Datatype/ibase.php	2012-08-01 12:50:42 UTC (rev 13187)
+++ branches/0.8/html/libraries/pear/MDB2/Driver/Datatype/ibase.php	2012-08-01 18:06:02 UTC (rev 13188)
@@ -78,10 +78,14 @@
         if (PEAR::isError($db)) {
             return $db;
         }
+        $connection = $db->getConnection();
+        if (PEAR::isError($connection)) {
+            return $connection;
+        }
 
         switch ($type) {
         case 'text':
-            $blob_info = @ibase_blob_info($value);
+            $blob_info = @ibase_blob_info($connection, $value);
             if (is_array($blob_info) && $blob_info['length'] > 0) {
                 //LOB => fetch into variable
                 $clob = $this->_baseConvertResult($value, 'clob', $rtrim);
@@ -260,7 +264,15 @@
     function _retrieveLOB(&$lob)
     {
         if (empty($lob['handle'])) {
-            $lob['handle'] = @ibase_blob_open($lob['resource']);
+            $db =& $this->getDBInstance();
+            if (PEAR::isError($db)) {
+                return $db;
+            }
+            $connection = $db->getConnection();
+            if (PEAR::isError($connection)) {
+                return $connection;
+            }
+            $lob['handle'] = @ibase_blob_open($connection, $lob['resource']);
             if (!$lob['handle']) {
                 $db =& $this->getDBInstance();
                 if (PEAR::isError($db)) {

Modified: branches/0.8/html/libraries/pear/MDB2/Driver/Datatype/mssql.php
===================================================================
--- branches/0.8/html/libraries/pear/MDB2/Driver/Datatype/mssql.php	2012-08-01 12:50:42 UTC (rev 13187)
+++ branches/0.8/html/libraries/pear/MDB2/Driver/Datatype/mssql.php	2012-08-01 18:06:02 UTC (rev 13188)
@@ -76,7 +76,7 @@
         }
         switch ($type) {
         case 'boolean':
-            return $value == '1';
+            return ($value === 0)? false : !empty($value);
         case 'date':
             if (strlen($value) > 10) {
                 $value = substr($value,0,10);
@@ -483,6 +483,7 @@
             break;
         case 'image':
         case 'varbinary':
+        case 'timestamp':
             $type[] = 'blob';
             $length = null;
             break;

Modified: branches/0.8/html/libraries/pear/MDB2/Driver/Datatype/pgsql.php
===================================================================
--- branches/0.8/html/libraries/pear/MDB2/Driver/Datatype/pgsql.php	2012-08-01 12:50:42 UTC (rev 13187)
+++ branches/0.8/html/libraries/pear/MDB2/Driver/Datatype/pgsql.php	2012-08-01 18:06:02 UTC (rev 13188)
@@ -73,7 +73,7 @@
         }
         switch ($type) {
         case 'boolean':
-            return $value == 't';
+            return ($value == 'f')? false : !empty($value);
         case 'float':
             return doubleval($value);
         case 'date':

Modified: branches/0.8/html/libraries/pear/MDB2/Driver/Datatype/sqlite.php
===================================================================
--- branches/0.8/html/libraries/pear/MDB2/Driver/Datatype/sqlite.php	2012-08-01 12:50:42 UTC (rev 13187)
+++ branches/0.8/html/libraries/pear/MDB2/Driver/Datatype/sqlite.php	2012-08-01 18:06:02 UTC (rev 13188)
@@ -216,6 +216,9 @@
 
         $notnull = empty($field['notnull']) ? '' : ' NOT NULL';
         $unsigned = empty($field['unsigned']) ? '' : ' UNSIGNED';
+        if (empty($default) && empty($notnull)) {
+            $default = ' DEFAULT NULL';
+        }
         $name = $db->quoteIdentifier($name, true);
         return $name.' '.$this->getTypeDeclaration($field).$unsigned.$default.$notnull.$autoinc;
     }

Modified: branches/0.8/html/libraries/pear/MDB2/Driver/Datatype/sqlsrv.php
===================================================================
--- branches/0.8/html/libraries/pear/MDB2/Driver/Datatype/sqlsrv.php	2012-08-01 12:50:42 UTC (rev 13187)
+++ branches/0.8/html/libraries/pear/MDB2/Driver/Datatype/sqlsrv.php	2012-08-01 18:06:02 UTC (rev 13188)
@@ -72,7 +72,7 @@
         }
         switch ($type) {
         case 'boolean':
-            return $value == '1';
+            return ($value === 0)? false : !empty($value);
         case 'date':
             if (strlen($value) > 10) {
                 $value = substr($value,0,10);

Modified: branches/0.8/html/libraries/pear/MDB2/Driver/Function/Common.php
===================================================================
--- branches/0.8/html/libraries/pear/MDB2/Driver/Function/Common.php	2012-08-01 12:50:42 UTC (rev 13187)
+++ branches/0.8/html/libraries/pear/MDB2/Driver/Function/Common.php	2012-08-01 18:06:02 UTC (rev 13188)
@@ -78,14 +78,14 @@
      * @return mixed a result handle or MDB2_OK on success, a MDB2 error on failure
      * @access public
      */
-    function &executeStoredProc($name, $params = null, $types = null, $result_class = true, $result_wrap_class = false)
+    function executeStoredProc($name, $params = null, $types = null, $result_class = true, $result_wrap_class = false)
     {
-        $db =& $this->getDBInstance();
+        $db = $this->getDBInstance();
         if (PEAR::isError($db)) {
             return $db;
         }
 
-        $error =& $db->raiseError(MDB2_ERROR_UNSUPPORTED, null, null,
+        $error = $db->raiseError(MDB2_ERROR_UNSUPPORTED, null, null,
             'method not implemented', __FUNCTION__);
         return $error;
     }
@@ -145,12 +145,12 @@
      */
     function unixtimestamp($expression)
     {
-        $db =& $this->getDBInstance();
+        $db = $this->getDBInstance();
         if (PEAR::isError($db)) {
             return $db;
         }
 
-        $error =& $db->raiseError(MDB2_ERROR_UNSUPPORTED, null, null,
+        $error = $db->raiseError(MDB2_ERROR_UNSUPPORTED, null, null,
             'method not implemented', __FUNCTION__);
         return $error;
     }
@@ -278,12 +278,12 @@
      */
     function guid()
     {
-        $db =& $this->getDBInstance();
+        $db = $this->getDBInstance();
         if (PEAR::isError($db)) {
             return $db;
         }
 
-        $error =& $db->raiseError(MDB2_ERROR_UNSUPPORTED, null, null,
+        $error = $db->raiseError(MDB2_ERROR_UNSUPPORTED, null, null,
             'method not implemented', __FUNCTION__);
         return $error;
     }

Modified: branches/0.8/html/libraries/pear/MDB2/Driver/Function/ibase.php
===================================================================
--- branches/0.8/html/libraries/pear/MDB2/Driver/Function/ibase.php	2012-08-01 12:50:42 UTC (rev 13187)
+++ branches/0.8/html/libraries/pear/MDB2/Driver/Function/ibase.php	2012-08-01 18:06:02 UTC (rev 13188)
@@ -93,12 +93,12 @@
      */
     function replace($str, $from_str, $to_str)
     {
-        $db =& $this->getDBInstance();
+        $db = $this->getDBInstance();
         if (PEAR::isError($db)) {
             return $db;
         }
 
-        $error =& $db->raiseError(MDB2_ERROR_UNSUPPORTED, null, null,
+        $error = $db->raiseError(MDB2_ERROR_UNSUPPORTED, null, null,
             'method not implemented', __FUNCTION__);
         return $error;
     }

Modified: branches/0.8/html/libraries/pear/MDB2/Driver/Function/mssql.php
===================================================================
--- branches/0.8/html/libraries/pear/MDB2/Driver/Function/mssql.php	2012-08-01 12:50:42 UTC (rev 13187)
+++ branches/0.8/html/libraries/pear/MDB2/Driver/Function/mssql.php	2012-08-01 18:06:02 UTC (rev 13188)
@@ -71,9 +71,9 @@
      * @return mixed a result handle or MDB2_OK on success, a MDB2 error on failure
      * @access public
      */
-    function &executeStoredProc($name, $params = null, $types = null, $result_class = true, $result_wrap_class = false)
+    function executeStoredProc($name, $params = null, $types = null, $result_class = true, $result_wrap_class = false)
     {
-        $db =& $this->getDBInstance();
+        $db = $this->getDBInstance();
         if (PEAR::isError($db)) {
             return $db;
         }

Modified: branches/0.8/html/libraries/pear/MDB2/Driver/Function/mysql.php
===================================================================
--- branches/0.8/html/libraries/pear/MDB2/Driver/Function/mysql.php	2012-08-01 12:50:42 UTC (rev 13187)
+++ branches/0.8/html/libraries/pear/MDB2/Driver/Function/mysql.php	2012-08-01 18:06:02 UTC (rev 13188)
@@ -71,9 +71,9 @@
      * @return mixed a result handle or MDB2_OK on success, a MDB2 error on failure
      * @access public
      */
-    function &executeStoredProc($name, $params = null, $types = null, $result_class = true, $result_wrap_class = false)
+    function executeStoredProc($name, $params = null, $types = null, $result_class = true, $result_wrap_class = false)
     {
-        $db =& $this->getDBInstance();
+        $db = $this->getDBInstance();
         if (PEAR::isError($db)) {
             return $db;
         }

Modified: branches/0.8/html/libraries/pear/MDB2/Driver/Function/mysqli.php
===================================================================
--- branches/0.8/html/libraries/pear/MDB2/Driver/Function/mysqli.php	2012-08-01 12:50:42 UTC (rev 13187)
+++ branches/0.8/html/libraries/pear/MDB2/Driver/Function/mysqli.php	2012-08-01 18:06:02 UTC (rev 13188)
@@ -71,9 +71,9 @@
      * @return mixed a result handle or MDB2_OK on success, a MDB2 error on failure
      * @access public
      */
-    function &executeStoredProc($name, $params = null, $types = null, $result_class = true, $result_wrap_class = false)
+    function executeStoredProc($name, $params = null, $types = null, $result_class = true, $result_wrap_class = false)
     {
-        $db =& $this->getDBInstance();
+        $db = $this->getDBInstance();
         if (PEAR::isError($db)) {
             return $db;
         }
@@ -84,7 +84,7 @@
         }
         $query = 'CALL '.$name;
         $query .= $params ? '('.implode(', ', $params).')' : '()';
-        $result =& $db->query($query, $types, $result_class, $result_wrap_class);
+        $result = $db->query($query, $types, $result_class, $result_wrap_class);
         if (!$multi_query) {
             $db->setOption('multi_query', false);
         }

Modified: branches/0.8/html/libraries/pear/MDB2/Driver/Function/oci8.php
===================================================================
--- branches/0.8/html/libraries/pear/MDB2/Driver/Function/oci8.php	2012-08-01 12:50:42 UTC (rev 13187)
+++ branches/0.8/html/libraries/pear/MDB2/Driver/Function/oci8.php	2012-08-01 18:06:02 UTC (rev 13188)
@@ -69,9 +69,9 @@
      * @return mixed a result handle or MDB2_OK on success, a MDB2 error on failure
      * @access public
      */
-    function &executeStoredProc($name, $params = null, $types = null, $result_class = true, $result_wrap_class = false)
+    function executeStoredProc($name, $params = null, $types = null, $result_class = true, $result_wrap_class = false)
     {
-        $db =& $this->getDBInstance();
+        $db = $this->getDBInstance();
         if (PEAR::isError($db)) {
             return $db;
         }

Modified: branches/0.8/html/libraries/pear/MDB2/Driver/Function/pgsql.php
===================================================================
--- branches/0.8/html/libraries/pear/MDB2/Driver/Function/pgsql.php	2012-08-01 12:50:42 UTC (rev 13187)
+++ branches/0.8/html/libraries/pear/MDB2/Driver/Function/pgsql.php	2012-08-01 18:06:02 UTC (rev 13188)
@@ -69,9 +69,9 @@
      * @return mixed a result handle or MDB2_OK on success, a MDB2 error on failure
      * @access public
      */
-    function &executeStoredProc($name, $params = null, $types = null, $result_class = true, $result_wrap_class = false)
+    function executeStoredProc($name, $params = null, $types = null, $result_class = true, $result_wrap_class = false)
     {
-        $db =& $this->getDBInstance();
+        $db = $this->getDBInstance();
         if (PEAR::isError($db)) {
             return $db;
         }

Modified: branches/0.8/html/libraries/pear/MDB2/Driver/Function/sqlite.php
===================================================================
--- branches/0.8/html/libraries/pear/MDB2/Driver/Function/sqlite.php	2012-08-01 12:50:42 UTC (rev 13187)
+++ branches/0.8/html/libraries/pear/MDB2/Driver/Function/sqlite.php	2012-08-01 18:06:02 UTC (rev 13188)
@@ -147,12 +147,12 @@
      */
     function replace($str, $from_str, $to_str)
     {
-        $db =& $this->getDBInstance();
+        $db = $this->getDBInstance();
         if (PEAR::isError($db)) {
             return $db;
         }
 
-        $error =& $db->raiseError(MDB2_ERROR_UNSUPPORTED, null, null,
+        $error = $db->raiseError(MDB2_ERROR_UNSUPPORTED, null, null,
             'method not implemented', __FUNCTION__);
         return $error;
     }

Modified: branches/0.8/html/libraries/pear/MDB2/Driver/Manager/Common.php
===================================================================
--- branches/0.8/html/libraries/pear/MDB2/Driver/Manager/Common.php	2012-08-01 12:50:42 UTC (rev 13187)
+++ branches/0.8/html/libraries/pear/MDB2/Driver/Manager/Common.php	2012-08-01 18:06:02 UTC (rev 13188)
@@ -385,7 +385,11 @@
         }
 
         $name = $db->quoteIdentifier($name, true);
-        return $db->exec("DROP TABLE $name");
+        $result = $db->exec("DROP TABLE $name");
+        if (MDB2::isError($result)) {
+            return $result;
+        }
+        return MDB2_OK;
     }
 
     // }}}
@@ -407,7 +411,11 @@
         }
 
         $name = $db->quoteIdentifier($name, true);
-        return $db->exec("DELETE FROM $name");
+        $result = $db->exec("DELETE FROM $name");
+        if (MDB2::isError($result)) {
+            return $result;
+        }
+        return MDB2_OK;
     }
 
     // }}}
@@ -761,7 +769,11 @@
             $fields[] = $db->quoteIdentifier($field, true);
         }
         $query .= ' ('. implode(', ', $fields) . ')';
-        return $db->exec($query);
+        $result = $db->exec($query);
+        if (MDB2::isError($result)) {
+            return $result;
+        }
+        return MDB2_OK;
     }
 
     // }}}
@@ -783,7 +795,11 @@
         }
 
         $name = $db->quoteIdentifier($db->getIndexName($name), true);
-        return $db->exec("DROP INDEX $name");
+        $result = $db->exec("DROP INDEX $name");
+        if (MDB2::isError($result)) {
+            return $result;
+        }
+        return MDB2_OK;
     }
 
     // }}}
@@ -895,7 +911,11 @@
             $query .= ' ('. implode(', ', $referenced_fields) . ')';
             $query .= $this->_getAdvancedFKOptions($definition);
         }
-        return $db->exec($query);
+        $result = $db->exec($query);
+        if (MDB2::isError($result)) {
+            return $result;
+        }
+        return MDB2_OK;
     }
 
     // }}}
@@ -919,7 +939,11 @@
 
         $table = $db->quoteIdentifier($table, true);
         $name = $db->quoteIdentifier($db->getIndexName($name), true);
-        return $db->exec("ALTER TABLE $table DROP CONSTRAINT $name");
+        $result = $db->exec("ALTER TABLE $table DROP CONSTRAINT $name");
+        if (MDB2::isError($result)) {
+            return $result;
+        }
+        return MDB2_OK;
     }
 
     // }}}
@@ -1011,4 +1035,4 @@
 
     // }}}
 }
-?>
\ No newline at end of file
+?>

Modified: branches/0.8/html/libraries/pear/MDB2/Driver/Manager/fbsql.php
===================================================================
--- branches/0.8/html/libraries/pear/MDB2/Driver/Manager/fbsql.php	2012-08-01 12:50:42 UTC (rev 13187)
+++ branches/0.8/html/libraries/pear/MDB2/Driver/Manager/fbsql.php	2012-08-01 18:06:02 UTC (rev 13188)
@@ -120,7 +120,11 @@
         }
 
         $name = $db->quoteIdentifier($name, true);
-        return $db->exec("DROP TABLE $name CASCADE");
+        $result = $db->exec("DROP TABLE $name CASCADE");
+        if (MDB2::isError($result)) {
+            return $result;
+        }
+        return MDB2_OK;
     }
 
     // }}}
@@ -305,7 +309,11 @@
         }
 
         $name = $db->quoteIdentifier($name, true);
-        return $db->exec("ALTER TABLE $name $query");
+        $result = $db->exec("ALTER TABLE $name $query");
+        if (MDB2::isError($result)) {
+            return $result;
+        }
+        return MDB2_OK;
     }
 
     // }}}
@@ -432,7 +440,11 @@
 
         $table = $db->quoteIdentifier($table, true);
         $name = $db->quoteIdentifier($db->getIndexName($name), true);
-        return $db->exec("ALTER TABLE $table DROP INDEX $name");
+        $result = $db->exec("ALTER TABLE $table DROP INDEX $name");
+        if (MDB2::isError($result)) {
+            return $result;
+        }
+        return MDB2_OK;
     }
 
     // }}}
@@ -542,7 +554,11 @@
         }
 
         $sequence_name = $db->quoteIdentifier($db->getSequenceName($seq_name), true);
-        return $db->exec("DROP TABLE $sequence_name CASCADE");
+        $result = $db->exec("DROP TABLE $sequence_name CASCADE");
+        if (MDB2::isError($result)) {
+            return $result;
+        }
+        return MDB2_OK;
     }
 
     // }}}
@@ -578,4 +594,4 @@
     }
     // }}}
 }
-?>
\ No newline at end of file
+?>

Modified: branches/0.8/html/libraries/pear/MDB2/Driver/Manager/ibase.php
===================================================================
--- branches/0.8/html/libraries/pear/MDB2/Driver/Manager/ibase.php	2012-08-01 12:50:42 UTC (rev 13187)
+++ branches/0.8/html/libraries/pear/MDB2/Driver/Manager/ibase.php	2012-08-01 18:06:02 UTC (rev 13188)
@@ -399,6 +399,9 @@
             return $result;
         }
         $result = parent::dropTable($name);
+        if (MDB2::isError($result)) {
+            return $result;
+        }
         $this->_silentCommit();
         return $result;
     }
@@ -598,8 +601,11 @@
 
         $name = $db->quoteIdentifier($name, true);
         $result = $db->exec("ALTER TABLE $name $query");
+        if (MDB2::isError($result)) {
+            return $result;
+        }
         $this->_silentCommit();
-        return $result;
+        return MDB2_OK;
     }
 
     // }}}
@@ -870,8 +876,11 @@
         }
         $query .= ' ('.implode(', ', $fields) . ')';
         $result = $db->exec($query);
+        if (MDB2::isError($result)) {
+            return $result;
+        }
         $this->_silentCommit();
-        return $result;
+        return MDB2_OK;
     }
 
     // }}}
@@ -982,8 +991,11 @@
             $query .= $this->_getAdvancedFKOptions($definition);
         }
         $result = $db->exec($query);
+        if (MDB2::isError($result)) {
+            return $result;
+        }
         $this->_silentCommit();
-        return $result;
+        return MDB2_OK;
     }
 
     // }}}
@@ -1059,7 +1071,7 @@
                     'Could not setup sequence start value and then it was not possible to drop it', __FUNCTION__);
             }
         }
-        return $result;
+        return MDB2_OK;
     }
 
     // }}}
@@ -1083,7 +1095,11 @@
         $sequence_name = $db->getSequenceName($seq_name);
         $sequence_name = $db->quote($sequence_name, 'text');
         $query = "DELETE FROM RDB\$GENERATORS WHERE UPPER(RDB\$GENERATOR_NAME)=$sequence_name";
-        return $db->exec($query);
+        $result = $db->exec($query);
+        if (MDB2::isError($result)) {
+            return $result;
+        }
+        return MDB2_OK;
     }
 
     // }}}
@@ -1117,4 +1133,4 @@
         return $result;
     }
 }
-?>
\ No newline at end of file
+?>

Modified: branches/0.8/html/libraries/pear/MDB2/Driver/Manager/mssql.php
===================================================================
--- branches/0.8/html/libraries/pear/MDB2/Driver/Manager/mssql.php	2012-08-01 12:50:42 UTC (rev 13187)
+++ branches/0.8/html/libraries/pear/MDB2/Driver/Manager/mssql.php	2012-08-01 18:06:02 UTC (rev 13188)
@@ -251,7 +251,11 @@
         }
 
         $name = $db->quoteIdentifier($name, true);
-        return $db->exec("TRUNCATE TABLE $name");
+        $result = $db->exec("TRUNCATE TABLE $name");
+        if (MDB2::isError($result)) {
+            return $result;
+        }
+        return MDB2_OK;
     }
 
     // }}}
@@ -287,7 +291,11 @@
             return $result;
         }
 
-        return $db->exec('EXEC NSVacuum '.$timeout);
+        $result = $db->exec('EXEC NSVacuum '.$timeout);
+        if (MDB2::isError($result)) {
+            return $result;
+        }
+        return MDB2_OK;
     }
 
     // }}}
@@ -974,7 +982,11 @@
 
         $table = $db->quoteIdentifier($table, true);
         $name = $db->quoteIdentifier($db->getIndexName($name), true);
-        return $db->exec("DROP INDEX $table.$name");
+        $result = $db->exec("DROP INDEX $table.$name");
+        if (MDB2::isError($result)) {
+            return $result;
+        }
+        return MDB2_OK;
     }
 
     // }}}
@@ -1085,7 +1097,11 @@
         }
 
         $sequence_name = $db->quoteIdentifier($db->getSequenceName($seq_name), true);
-        return $db->exec("DROP TABLE $sequence_name");
+        $result = $db->exec("DROP TABLE $sequence_name");
+        if (MDB2::isError($result)) {
+            return $result;
+        }
+        return MDB2_OK;
     }
 
     // }}}
@@ -1126,4 +1142,4 @@
 }
 
 // }}}
-?>
\ No newline at end of file
+?>

Modified: branches/0.8/html/libraries/pear/MDB2/Driver/Manager/mysql.php
===================================================================
--- branches/0.8/html/libraries/pear/MDB2/Driver/Manager/mysql.php	2012-08-01 12:50:42 UTC (rev 13187)
+++ branches/0.8/html/libraries/pear/MDB2/Driver/Manager/mysql.php	2012-08-01 18:06:02 UTC (rev 13188)
@@ -327,7 +327,11 @@
         }
 
         $name = $db->quoteIdentifier($name, true);
-        return $db->exec("TRUNCATE TABLE $name");
+        $result = $db->exec("TRUNCATE TABLE $name");
+        if (MDB2::isError($result)) {
+            return $result;
+        }
+        return MDB2_OK;
     }
 
     // }}}
@@ -374,7 +378,10 @@
             return $result;
         }
         if (!empty($options['analyze'])) {
-            return $db->exec('ANALYZE TABLE '.$table);
+            $result = $db->exec('ANALYZE TABLE '.$table);
+            if (MDB2::isError($result)) {
+                return $result;
+            }
         }
         return MDB2_OK;
     }
@@ -561,7 +568,11 @@
         }
 
         $name = $db->quoteIdentifier($name, true);
-        return $db->exec("ALTER TABLE $name $query");
+        $result = $db->exec("ALTER TABLE $name $query");
+        if (MDB2::isError($result)) {
+            return $result;
+        }
+        return MDB2_OK;
     }
 
     // }}}
@@ -832,7 +843,11 @@
             }
         }
         $query .= ' ('. implode(', ', $fields) . ')';
-        return $db->exec($query);
+        $result = $db->exec($query);
+        if (MDB2::isError($result)) {
+            return $result;
+        }
+        return MDB2_OK;
     }
 
     // }}}
@@ -855,7 +870,11 @@
 
         $table = $db->quoteIdentifier($table, true);
         $name = $db->quoteIdentifier($db->getIndexName($name), true);
-        return $db->exec("DROP INDEX $name ON $table");
+        $result = $db->exec("DROP INDEX $name ON $table");
+        if (MDB2::isError($result)) {
+            return $result;
+        }
+        return MDB2_OK;
     }
 
     // }}}
@@ -1015,7 +1034,11 @@
 
         if ($primary || strtolower($name) == 'primary') {
             $query = 'ALTER TABLE '. $db->quoteIdentifier($table, true) .' DROP PRIMARY KEY';
-            return $db->exec($query);
+            $result = $db->exec($query);
+            if (MDB2::isError($result)) {
+                return $result;
+            }
+            return MDB2_OK;
         }
 
         //is it a FK constraint? If so, also delete the associated triggers
@@ -1031,13 +1054,21 @@
             $table = $db->quoteIdentifier($table, true);
             $name = $db->quoteIdentifier($db->getIndexName($name), true);
             $query = "ALTER TABLE $table DROP FOREIGN KEY $name";
-            return $db->exec($query);
+            $result = $db->exec($query);
+            if (MDB2::isError($result)) {
+                return $result;
+            }
+            return MDB2_OK;
         }
 
         $table = $db->quoteIdentifier($table, true);
         $name = $db->quoteIdentifier($db->getIndexName($name), true);
         $query = "ALTER TABLE $table DROP INDEX $name";
-        return $db->exec($query);
+        $result = $db->exec($query);
+        if (MDB2::isError($result)) {
+            return $result;
+        }
+        return MDB2_OK;
     }
 
     // }}}
@@ -1390,7 +1421,11 @@
         }
 
         $sequence_name = $db->quoteIdentifier($db->getSequenceName($seq_name), true);
-        return $db->exec("DROP TABLE $sequence_name");
+        $result = $db->exec("DROP TABLE $sequence_name");
+        if (MDB2::isError($result)) {
+            return $result;
+        }
+        return MDB2_OK;
     }
 
     // }}}
@@ -1433,4 +1468,4 @@
 
     // }}}
 }
-?>
\ No newline at end of file
+?>

Modified: branches/0.8/html/libraries/pear/MDB2/Driver/Manager/mysqli.php
===================================================================
--- branches/0.8/html/libraries/pear/MDB2/Driver/Manager/mysqli.php	2012-08-01 12:50:42 UTC (rev 13187)
+++ branches/0.8/html/libraries/pear/MDB2/Driver/Manager/mysqli.php	2012-08-01 18:06:02 UTC (rev 13188)
@@ -327,7 +327,11 @@
         }
 
         $name = $db->quoteIdentifier($name, true);
-        return $db->exec("TRUNCATE TABLE $name");
+        $result = $db->exec("TRUNCATE TABLE $name");
+        if (MDB2::isError($result)) {
+            return $result;
+        }
+        return MDB2_OK;
     }
 
     // }}}
@@ -374,7 +378,10 @@
             return $result;
         }
         if (!empty($options['analyze'])) {
-            return $db->exec('ANALYZE TABLE '.$table);
+            $result = $db->exec('ANALYZE TABLE '.$table);
+            if (MDB2::isError($result)) {
+                return $result;
+            }
         }
         return MDB2_OK;
     }
@@ -561,7 +568,11 @@
         }
 
         $name = $db->quoteIdentifier($name, true);
-        return $db->exec("ALTER TABLE $name $query");
+        $result = $db->exec("ALTER TABLE $name $query");
+        if (MDB2::isError($result)) {
+            return $result;
+        }
+        return MDB2_OK;
     }
 
     // }}}
@@ -832,7 +843,11 @@
             }
         }
         $query .= ' ('. implode(', ', $fields) . ')';
-        return $db->exec($query);
+        $result = $db->exec($query);
+        if (MDB2::isError($result)) {
+            return $result;
+        }
+        return MDB2_OK;
     }
 
     // }}}
@@ -855,7 +870,11 @@
 
         $table = $db->quoteIdentifier($table, true);
         $name = $db->quoteIdentifier($db->getIndexName($name), true);
-        return $db->exec("DROP INDEX $name ON $table");
+        $result = $db->exec("DROP INDEX $name ON $table");
+        if (MDB2::isError($result)) {
+            return $result;
+        }
+        return MDB2_OK;
     }
 
     // }}}
@@ -1015,7 +1034,11 @@
         
         if ($primary || strtolower($name) == 'primary') {
             $query = 'ALTER TABLE '. $db->quoteIdentifier($table, true) .' DROP PRIMARY KEY';
-            return $db->exec($query);
+            $result = $db->exec($query);
+            if (MDB2::isError($result)) {
+                return $result;
+            }
+            return MDB2_OK;
         }
         
         //is it a FK constraint? If so, also delete the associated triggers
@@ -1031,13 +1054,21 @@
             $table = $db->quoteIdentifier($table, true);
             $name = $db->quoteIdentifier($db->getIndexName($name), true);
             $query = "ALTER TABLE $table DROP FOREIGN KEY $name";
-            return $db->exec($query);
+            $result = $db->exec($query);
+            if (MDB2::isError($result)) {
+                return $result;
+            }
+            return MDB2_OK;
         }
 
         $table = $db->quoteIdentifier($table, true);
         $name = $db->quoteIdentifier($db->getIndexName($name), true);
         $query = "ALTER TABLE $table DROP INDEX $name";
-        return $db->exec($query);
+        $result = $db->exec($query);
+        if (MDB2::isError($result)) {
+            return $result;
+        }
+        return MDB2_OK;
     }
 
     // }}}
@@ -1390,7 +1421,11 @@
         }
 
         $sequence_name = $db->quoteIdentifier($db->getSequenceName($seq_name), true);
-        return $db->exec("DROP TABLE $sequence_name");
+        $result = $db->exec("DROP TABLE $sequence_name");
+        if (MDB2::isError($result)) {
+            return $result;
+        }
+        return MDB2_OK;
     }
 
     // }}}
@@ -1433,4 +1468,4 @@
 
     // }}}
 }
-?>
\ No newline at end of file
+?>

Modified: branches/0.8/html/libraries/pear/MDB2/Driver/Manager/oci8.php
===================================================================
--- branches/0.8/html/libraries/pear/MDB2/Driver/Manager/oci8.php	2012-08-01 12:50:42 UTC (rev 13187)
+++ branches/0.8/html/libraries/pear/MDB2/Driver/Manager/oci8.php	2012-08-01 18:06:02 UTC (rev 13188)
@@ -444,6 +444,9 @@
         $result = $this->_dropAutoincrement($name);
         if (!PEAR::isError($result)) {
             $result = parent::dropTable($name);
+            if (MDB2::isError($result)) {
+                return $result;
+            }
         }
         $db->completeNestedTransaction();
         return $result;
@@ -468,7 +471,11 @@
         }
 
         $name = $db->quoteIdentifier($name, true);
-        return $db->exec("TRUNCATE TABLE $name");
+        $result = $db->exec("TRUNCATE TABLE $name");
+        if (MDB2::isError($result)) {
+            return $result;
+        }
+        return MDB2_OK;
     }
 
     // }}}
@@ -1262,7 +1269,11 @@
         $sequence_name = $db->quoteIdentifier($db->getSequenceName($seq_name), true);
         $query = "CREATE SEQUENCE $sequence_name START WITH $start INCREMENT BY 1 NOCACHE";
         $query.= ($start < 1 ? " MINVALUE $start" : '');
-        return $db->exec($query);
+        $result = $db->exec($query);
+        if (MDB2::isError($result)) {
+            return $result;
+        }
+        return MDB2_OK;
     }
 
     // }}}
@@ -1284,7 +1295,11 @@
         }
 
         $sequence_name = $db->quoteIdentifier($db->getSequenceName($seq_name), true);
-        return $db->exec("DROP SEQUENCE $sequence_name");
+        $result = $db->exec("DROP SEQUENCE $sequence_name");
+        if (MDB2::isError($result)) {
+            return $result;
+        }
+        return MDB2_OK;
     }
 
     // }}}
@@ -1337,4 +1352,4 @@
         return $col;
     }
 }
-?>
\ No newline at end of file
+?>

Modified: branches/0.8/html/libraries/pear/MDB2/Driver/Manager/pgsql.php
===================================================================
--- branches/0.8/html/libraries/pear/MDB2/Driver/Manager/pgsql.php	2012-08-01 12:50:42 UTC (rev 13187)
+++ branches/0.8/html/libraries/pear/MDB2/Driver/Manager/pgsql.php	2012-08-01 18:06:02 UTC (rev 13188)
@@ -193,7 +193,11 @@
         }
 
         $name = $db->quoteIdentifier($name, true);
-        return $db->exec("TRUNCATE TABLE $name");
+        $result = $db->exec("TRUNCATE TABLE $name");
+        if (MDB2::isError($result)) {
+            return $result;
+        }
+        return MDB2_OK;
     }
 
     // }}}
@@ -234,7 +238,11 @@
         if (!empty($table)) {
             $query .= ' '.$db->quoteIdentifier($table, true);
         }
-        return $db->exec($query);
+        $result = $db->exec($query);
+        if (MDB2::isError($result)) {
+            return $result;
+        }
+        return MDB2_OK;
     }
 
     // }}}
@@ -801,11 +809,19 @@
         }
 
         if (in_array($name, $unique)) {
-            return $db->exec('DROP INDEX '.$db->quoteIdentifier($name, true));
+            $result = $db->exec('DROP INDEX '.$db->quoteIdentifier($name, true));
+            if (MDB2::isError($result)) {
+                return $result;
+            }
+            return MDB2_OK;
         }
         $idxname = $db->getIndexName($name);
         if (in_array($idxname, $unique)) {
-            return $db->exec('DROP INDEX '.$db->quoteIdentifier($idxname, true));
+            $result = $db->exec('DROP INDEX '.$db->quoteIdentifier($idxname, true));
+            if (MDB2::isError($result)) {
+                return $result;
+            }
+            return MDB2_OK;
         }
         return $db->raiseError(MDB2_ERROR_NOT_FOUND, null, null,
             $name . ' is not an existing constraint for table ' . $table, __FUNCTION__);
@@ -894,8 +910,12 @@
         }
 
         $sequence_name = $db->quoteIdentifier($db->getSequenceName($seq_name), true);
-        return $db->exec("CREATE SEQUENCE $sequence_name INCREMENT 1".
+        $result = $db->exec("CREATE SEQUENCE $sequence_name INCREMENT 1".
             ($start < 1 ? " MINVALUE $start" : '')." START $start");
+        if (MDB2::isError($result)) {
+            return $result;
+        }
+        return MDB2_OK;
     }
 
     // }}}
@@ -916,7 +936,11 @@
         }
 
         $sequence_name = $db->quoteIdentifier($db->getSequenceName($seq_name), true);
-        return $db->exec("DROP SEQUENCE $sequence_name");
+        $result = $db->exec("DROP SEQUENCE $sequence_name");
+        if (MDB2::isError($result)) {
+            return $result;
+        }
+        return MDB2_OK;
     }
 
     // }}}
@@ -951,4 +975,4 @@
         return $result;
     }
 }
-?>
\ No newline at end of file
+?>

Modified: branches/0.8/html/libraries/pear/MDB2/Driver/Manager/sqlite.php
===================================================================
--- branches/0.8/html/libraries/pear/MDB2/Driver/Manager/sqlite.php	2012-08-01 12:50:42 UTC (rev 13187)
+++ branches/0.8/html/libraries/pear/MDB2/Driver/Manager/sqlite.php	2012-08-01 18:06:02 UTC (rev 13188)
@@ -405,7 +405,11 @@
         }
 
         $name = $db->quoteIdentifier($name, true);
-        return $db->exec("DROP TABLE $name");
+        $result = $db->exec("DROP TABLE $name");
+        if (MDB2::isError($result)) {
+            return $result;
+        }
+        return MDB2_OK;
     }
 
     // }}}
@@ -436,7 +440,11 @@
         if (!empty($table)) {
             $query .= ' '.$db->quoteIdentifier($table, true);
         }
-        return $db->exec($query);
+        $result = $db->exec($query);
+        if (MDB2::isError($result)) {
+            return $result;
+        }
+        return MDB2_OK;
     }
 
     // }}}
@@ -982,7 +990,11 @@
             $fields[] = $field_string;
         }
         $query .= ' ('.implode(', ', $fields) . ')';
-        return $db->exec($query);
+        $result = $db->exec($query);
+        if (MDB2::isError($result)) {
+            return $result;
+        }
+        return MDB2_OK;
     }
 
     // }}}
@@ -1004,7 +1016,11 @@
         }
 
         $name = $db->getIndexName($name);
-        return $db->exec("DROP INDEX $name");
+        $result = $db->exec("DROP INDEX $name");
+        if (MDB2::isError($result)) {
+            return $result;
+        }
+        return MDB2_OK;
     }
 
     // }}}
@@ -1112,7 +1128,11 @@
             $fields[] = $field_string;
         }
         $query .= ' ('.implode(', ', $fields) . ')';
-        return $db->exec($query);
+        $result = $db->exec($query);
+        if (MDB2::isError($result)) {
+            return $result;
+        }
+        return MDB2_OK;
     }
 
     // }}}
@@ -1152,7 +1172,11 @@
         }
 
         $name = $db->getIndexName($name);
-        return $db->exec("DROP INDEX $name");
+        $result = $db->exec("DROP INDEX $name");
+        if (MDB2::isError($result)) {
+            return $result;
+        }
+        return MDB2_OK;
     }
 
     // }}}
@@ -1321,7 +1345,11 @@
         }
 
         $sequence_name = $db->quoteIdentifier($db->getSequenceName($seq_name), true);
-        return $db->exec("DROP TABLE $sequence_name");
+        $result = $db->exec("DROP TABLE $sequence_name");
+        if (MDB2::isError($result)) {
+            return $result;
+        }
+        return MDB2_OK;
     }
 
     // }}}
@@ -1359,4 +1387,4 @@
 
     // }}}
 }
-?>
\ No newline at end of file
+?>

Modified: branches/0.8/html/libraries/pear/MDB2/Driver/Manager/sqlsrv.php
===================================================================
--- branches/0.8/html/libraries/pear/MDB2/Driver/Manager/sqlsrv.php	2012-08-01 12:50:42 UTC (rev 13187)
+++ branches/0.8/html/libraries/pear/MDB2/Driver/Manager/sqlsrv.php	2012-08-01 18:06:02 UTC (rev 13188)
@@ -161,7 +161,11 @@
             return $db;
         }
         $name = $db->quoteIdentifier($name, true);
-        return $db->exec("IF EXISTS (SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME='$name') DROP TABLE $name");
+        $result = $db->exec("IF EXISTS (SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME='$name') DROP TABLE $name");
+        if (MDB2::isError($result)) {
+            return $result;
+        }
+        return MDB2_OK;
     }
 
     // }}}
@@ -268,7 +272,11 @@
         }
 
         $name = $db->quoteIdentifier($name, true);
-        return $db->exec("TRUNCATE TABLE $name");
+        $result = $db->exec("TRUNCATE TABLE $name");
+        if (MDB2::isError($result)) {
+            return $result;
+        }
+        return MDB2_OK;
     }
 
     // }}}
@@ -304,7 +312,11 @@
             return $result;
         }
 
-        return $db->exec('EXEC NSVacuum '.$timeout);
+        $result = $db->exec('EXEC NSVacuum '.$timeout);
+        if (MDB2::isError($result)) {
+            return $result;
+        }
+        return MDB2_OK;
     }
 
     // }}}
@@ -991,7 +1003,11 @@
 
         $table = $db->quoteIdentifier($table, true);
         $name = $db->quoteIdentifier($db->getIndexName($name), true);
-        return $db->exec("DROP INDEX $table.$name");
+        $result = $db->exec("DROP INDEX $table.$name");
+        if (MDB2::isError($result)) {
+            return $result;
+        }
+        return MDB2_OK;
     }
 
     // }}}
@@ -1149,7 +1165,11 @@
         }
 
         $sequence_name = $db->quoteIdentifier($db->getSequenceName($seq_name), true);
-        return $db->exec("DROP TABLE $sequence_name");
+        $result = $db->exec("DROP TABLE $sequence_name");
+        if (MDB2::isError($result)) {
+            return $result;
+        }
+        return MDB2_OK;
     }
 
     // }}}
@@ -1385,7 +1405,11 @@
             $query .= ' ('. implode(', ', $referenced_fields) . ')';
             $query .= $this->_getAdvancedFKOptions($definition);
         }
-        return $db->exec($query);
+        $result = $db->exec($query);
+        if (MDB2::isError($result)) {
+            return $result;
+        }
+        return MDB2_OK;
     }
 
     // }}}

Modified: branches/0.8/html/libraries/pear/MDB2/Driver/Reverse/sqlite.php
===================================================================
--- branches/0.8/html/libraries/pear/MDB2/Driver/Reverse/sqlite.php	2012-08-01 12:50:42 UTC (rev 13187)
+++ branches/0.8/html/libraries/pear/MDB2/Driver/Reverse/sqlite.php	2012-08-01 18:06:02 UTC (rev 13188)
@@ -128,6 +128,8 @@
                     $default = null;
                 }
                 $columns[$j]['default'] = $default;
+            } else {
+                $columns[$j]['default'] = null;
             }
             if (isset($matches[7]) && strlen($matches[7])) {
                 $columns[$j]['notnull'] = ($matches[7] === ' NOT NULL');
@@ -160,7 +162,7 @@
         if (PEAR::isError($db)) {
             return $db;
         }
-        
+
         list($schema, $table) = $this->splitTableSchema($table_name);
 
         $result = $db->loadModule('Datatype', null, true);
@@ -262,7 +264,7 @@
         if (PEAR::isError($db)) {
             return $db;
         }
-        
+
         list($schema, $table) = $this->splitTableSchema($table_name);
 
         $query = "SELECT sql FROM sqlite_master WHERE type='index' AND ";
@@ -345,7 +347,7 @@
         if (PEAR::isError($db)) {
             return $db;
         }
-        
+
         list($schema, $table) = $this->splitTableSchema($table_name);
 
         $query = "SELECT sql FROM sqlite_master WHERE type='index' AND ";

Modified: branches/0.8/html/libraries/pear/MDB2/Driver/fbsql.php
===================================================================
--- branches/0.8/html/libraries/pear/MDB2/Driver/fbsql.php	2012-08-01 12:50:42 UTC (rev 13187)
+++ branches/0.8/html/libraries/pear/MDB2/Driver/fbsql.php	2012-08-01 18:06:02 UTC (rev 13188)
@@ -428,7 +428,7 @@
         $limit = $this->limit;
         $this->offset = $this->limit = 0;
         $query = $this->_modifyQuery($query, $is_manip, $limit, $offset);
-        
+
         $result =& $this->_doQuery($query, $is_manip, $connection, $this->database_name);
         if (!PEAR::isError($result)) {
             $result = $this->_affectedRows($connection, $result);
@@ -671,7 +671,9 @@
         if ($fetchmode == MDB2_FETCHMODE_DEFAULT) {
             $fetchmode = $this->db->fetchmode;
         }
-        if ($fetchmode & MDB2_FETCHMODE_ASSOC) {
+        if (   $fetchmode == MDB2_FETCHMODE_ASSOC
+            || $fetchmode == MDB2_FETCHMODE_OBJECT
+        ) {
             $row = @fbsql_fetch_assoc($this->result);
             if (is_array($row)
                 && $this->db->options['portability'] & MDB2_PORTABILITY_FIX_CASE
@@ -694,8 +696,10 @@
         if ($mode) {
             $this->db->_fixResultArrayValues($row, $mode);
         }
-        if (!empty($this->types)) {
-            $row = $this->db->datatype->convertResultRow($this->types, $row, false);
+        if (($fetchmode != MDB2_FETCHMODE_ASSOC) && !empty($this->types)) {
+            $row = $this->db->datatype->convertResultRow($this->types, $row, $rtrim);
+        } elseif (($fetchmode == MDB2_FETCHMODE_ASSOC) && !empty($this->types_assoc)) {
+            $row = $this->db->datatype->convertResultRow($this->types_assoc, $row, $rtrim);
         }
         if (!empty($this->values)) {
             $this->_assignBindColumns($row);
@@ -907,4 +911,4 @@
 
 }
 
-?>
\ No newline at end of file
+?>

Modified: branches/0.8/html/libraries/pear/MDB2/Driver/ibase.php
===================================================================
--- branches/0.8/html/libraries/pear/MDB2/Driver/ibase.php	2012-08-01 12:50:42 UTC (rev 13187)
+++ branches/0.8/html/libraries/pear/MDB2/Driver/ibase.php	2012-08-01 18:06:02 UTC (rev 13188)
@@ -222,8 +222,29 @@
         }
         return array($error, $native_code, $native_msg);
     }
+    // {{{ escape()
 
+    /**
+     * Quotes a string so it can be safely used in a query. It will quote
+     * the text so it can safely be used within a query.
+     *
+     * @param   string  the input string to quote
+     * @param   bool    escape wildcards
+     *
+     * @return  string  quoted string
+     *
+     * @access  public
+     */
+    function escape($text, $escape_wildcards = false)
+    {
+        //Remove a NULL-character (may break queries when inserted):
+        $text = str_replace("\x00", '', $text);
+        
+        return parent::escape($text, $escape_wildcards);
+    }
+
     // }}}
+    // }}}
     // {{{ quoteIdentifier()
 
     /**
@@ -855,7 +876,7 @@
             if (null === $placeholder_type) {
                 $placeholder_type_guess = $query[$p_position];
             }
-            
+
             $new_pos = $this->_skipDelimitedStrings($query, $position, $p_position);
             if (PEAR::isError($new_pos)) {
                 return $new_pos;
@@ -864,7 +885,7 @@
                 $position = $new_pos;
                 continue; //evaluate again starting from the new position
             }
-            
+
             if ($query[$position] == $placeholder_type_guess) {
                 if (null === $placeholder_type) {
                     $placeholder_type = $query[$p_position];
@@ -974,7 +995,7 @@
         //$seq = $table.(empty($field) ? '' : '_'.$field);
         return $this->currID($table);
     }
-    
+
     // }}}
     // {{{ currID()
 
@@ -1075,7 +1096,9 @@
         if ($fetchmode == MDB2_FETCHMODE_DEFAULT) {
             $fetchmode = $this->db->fetchmode;
         }
-        if ($fetchmode & MDB2_FETCHMODE_ASSOC) {
+        if (   $fetchmode == MDB2_FETCHMODE_ASSOC
+            || $fetchmode == MDB2_FETCHMODE_OBJECT
+        ) {
             $row = @ibase_fetch_assoc($this->result);
             if (is_array($row)
                 && $this->db->options['portability'] & MDB2_PORTABILITY_FIX_CASE
@@ -1106,8 +1129,16 @@
         if ($mode) {
             $this->db->_fixResultArrayValues($row, $mode);
         }
-        if (!empty($this->types)) {
-            $row = $this->db->datatype->convertResultRow($this->types, $row, $rtrim);
+        if (   (   $fetchmode != MDB2_FETCHMODE_ASSOC
+                && $fetchmode != MDB2_FETCHMODE_OBJECT)
+            && !empty($this->types)
+        ) {
+             $row = $this->db->datatype->convertResultRow($this->types, $row, $rtrim);
+        } elseif (($fetchmode == MDB2_FETCHMODE_ASSOC
+                || $fetchmode == MDB2_FETCHMODE_OBJECT)
+            && !empty($this->types_assoc)
+        ) {
+            $row = $this->db->datatype->convertResultRow($this->types_assoc, $row, $rtrim);
         }
         if (!empty($this->values)) {
             $this->_assignBindColumns($row);
@@ -1313,7 +1344,9 @@
             return $null;
         }
         $row = $this->buffer[$target_rownum];
-        if ($fetchmode & MDB2_FETCHMODE_ASSOC) {
+        if (   $fetchmode == MDB2_FETCHMODE_ASSOC
+            || $fetchmode == MDB2_FETCHMODE_OBJECT
+        ) {
             $column_names = $this->getColumnNames();
             foreach ($column_names as $name => $i) {
                 $column_names[$name] = $row[$i];
@@ -1332,8 +1365,16 @@
         if ($mode) {
             $this->db->_fixResultArrayValues($row, $mode);
         }
-        if (!empty($this->types)) {
+        if (   (   $fetchmode != MDB2_FETCHMODE_ASSOC
+                && $fetchmode != MDB2_FETCHMODE_OBJECT)
+            && !empty($this->types)
+        ) {
             $row = $this->db->datatype->convertResultRow($this->types, $row, $rtrim);
+        } elseif (($fetchmode == MDB2_FETCHMODE_ASSOC
+                || $fetchmode == MDB2_FETCHMODE_OBJECT)
+            && !empty($this->types_assoc)
+        ) {
+            $row = $this->db->datatype->convertResultRow($this->types_assoc, $row, $rtrim);
         }
         if (!empty($this->values)) {
             $this->_assignBindColumns($row);
@@ -1457,7 +1498,7 @@
      *               a MDB2 error on failure
      * @access private
      */
-    function &_execute($result_class = true, $result_wrap_class = false)
+    function &_execute($result_class = true, $result_wrap_class = true)
     {
         if (null === $this->statement) {
             $result =& parent::_execute($result_class, $result_wrap_class);

Modified: branches/0.8/html/libraries/pear/MDB2/Driver/mssql.php
===================================================================
--- branches/0.8/html/libraries/pear/MDB2/Driver/mssql.php	2012-08-01 12:50:42 UTC (rev 13187)
+++ branches/0.8/html/libraries/pear/MDB2/Driver/mssql.php	2012-08-01 18:06:02 UTC (rev 13188)
@@ -555,7 +555,7 @@
         $limit = $this->limit;
         $this->offset = $this->limit = 0;
         $query = $this->_modifyQuery($query, $is_manip, $limit, $offset);
-        
+
         $result =& $this->_doQuery($query, $is_manip, $connection, $this->database_name);
         if (!PEAR::isError($result)) {
             $result = $this->_affectedRows($connection, $result);
@@ -760,7 +760,7 @@
         $seqcol_name = $this->quoteIdentifier($this->options['seqcol_name'], true);
         $this->pushErrorHandling(PEAR_ERROR_RETURN);
         $this->expectError(MDB2_ERROR_NOSUCHTABLE);
-        
+
         $seq_val = $this->_checkSequence($sequence_name);
 
         if ($seq_val) {
@@ -787,7 +787,7 @@
                      * exists, then we get the last inserted id if it does.
                      *
                      * In theory, $seq_name should be created otherwise there would
-                     * have been an error thrown somewhere up there.. 
+                     * have been an error thrown somewhere up there..
                      *
                      * @todo confirm
                      */
@@ -911,7 +911,9 @@
         if ($fetchmode == MDB2_FETCHMODE_DEFAULT) {
             $fetchmode = $this->db->fetchmode;
         }
-        if ($fetchmode & MDB2_FETCHMODE_ASSOC) {
+        if (   $fetchmode == MDB2_FETCHMODE_ASSOC
+            || $fetchmode == MDB2_FETCHMODE_OBJECT
+        ) {
             $row = @mssql_fetch_assoc($this->result);
             if (is_array($row)
                 && $this->db->options['portability'] & MDB2_PORTABILITY_FIX_CASE
@@ -942,8 +944,16 @@
         if ($mode) {
             $this->db->_fixResultArrayValues($row, $mode);
         }
-        if (!empty($this->types)) {
+        if (   (   $fetchmode != MDB2_FETCHMODE_ASSOC
+                && $fetchmode != MDB2_FETCHMODE_OBJECT)
+            && !empty($this->types)
+        ) {
             $row = $this->db->datatype->convertResultRow($this->types, $row, $rtrim);
+        } elseif (($fetchmode == MDB2_FETCHMODE_ASSOC
+                || $fetchmode == MDB2_FETCHMODE_OBJECT)
+            && !empty($this->types_assoc)
+        ) {
+            $row = $this->db->datatype->convertResultRow($this->types_assoc, $row, $rtrim);
         }
         if (!empty($this->values)) {
             $this->_assignBindColumns($row);
@@ -1172,4 +1182,4 @@
 }
 
 // }}}
-?>
\ No newline at end of file
+?>

Modified: branches/0.8/html/libraries/pear/MDB2/Driver/mysql.php
===================================================================
--- branches/0.8/html/libraries/pear/MDB2/Driver/mysql.php	2012-08-01 12:50:42 UTC (rev 13187)
+++ branches/0.8/html/libraries/pear/MDB2/Driver/mysql.php	2012-08-01 18:06:02 UTC (rev 13188)
@@ -126,7 +126,7 @@
 
     // }}}
     // {{{ _reCheckSupportedOptions()
-    
+
     /**
      * If the user changes certain options, other capabilities may depend
      * on the new settings, so we need to check them (again).
@@ -958,7 +958,7 @@
             $this->supported['triggers'] = false;
             $this->start_transaction = false;
             $this->varchar_max_length = 255;
-            
+
             $server_info = $this->getServerVersion();
             if (is_array($server_info)) {
                 $server_version = $server_info['major'].'.'.$server_info['minor'].'.'.$server_info['patch'];
@@ -996,7 +996,7 @@
     // {{{ function _skipUserDefinedVariable($query, $position)
 
     /**
-     * Utility method, used by prepare() to avoid misinterpreting MySQL user 
+     * Utility method, used by prepare() to avoid misinterpreting MySQL user
      * defined variables (SELECT @x:=5) for placeholders.
      * Check if the placeholder is a false positive, i.e. if it is an user defined
      * variable instead. If so, skip it and advance the position, otherwise
@@ -1091,7 +1091,7 @@
             if (is_null($placeholder_type)) {
                 $placeholder_type_guess = $query[$p_position];
             }
-            
+
             $new_pos = $this->_skipDelimitedStrings($query, $position, $p_position);
             if (PEAR::isError($new_pos)) {
                 return $new_pos;
@@ -1100,7 +1100,7 @@
                 $position = $new_pos;
                 continue; //evaluate again starting from the new position
             }
-            
+
             //make sure this is not part of an user defined variable
             $new_pos = $this->_skipUserDefinedVariable($query, $position);
             if ($new_pos != $position) {
@@ -1380,7 +1380,9 @@
         if ($fetchmode == MDB2_FETCHMODE_DEFAULT) {
             $fetchmode = $this->db->fetchmode;
         }
-        if ($fetchmode & MDB2_FETCHMODE_ASSOC) {
+        if (   $fetchmode == MDB2_FETCHMODE_ASSOC
+            || $fetchmode == MDB2_FETCHMODE_OBJECT
+        ) {
             $row = @mysql_fetch_assoc($this->result);
             if (is_array($row)
                 && $this->db->options['portability'] & MDB2_PORTABILITY_FIX_CASE
@@ -1412,8 +1414,16 @@
         if ($mode) {
             $this->db->_fixResultArrayValues($row, $mode);
         }
-        if (!empty($this->types)) {
+        if (   (   $fetchmode != MDB2_FETCHMODE_ASSOC
+                && $fetchmode != MDB2_FETCHMODE_OBJECT)
+            && !empty($this->types)
+        ) {
             $row = $this->db->datatype->convertResultRow($this->types, $row, $rtrim);
+        } elseif (($fetchmode == MDB2_FETCHMODE_ASSOC
+                || $fetchmode == MDB2_FETCHMODE_OBJECT)
+            && !empty($this->types_assoc)
+        ) {
+            $row = $this->db->datatype->convertResultRow($this->types_assoc, $row, $rtrim);
         }
         if (!empty($this->values)) {
             $this->_assignBindColumns($row);
@@ -1586,7 +1596,7 @@
         }
         return $rows;
     }
-    
+
     // }}}
 }
 
@@ -1611,7 +1621,7 @@
      *               a MDB2 error on failure
      * @access private
      */
-    function &_execute($result_class = true, $result_wrap_class = false)
+    function &_execute($result_class = true, $result_wrap_class = true)
     {
         if (is_null($this->statement)) {
             $result =& parent::_execute($result_class, $result_wrap_class);

Modified: branches/0.8/html/libraries/pear/MDB2/Driver/mysqli.php
===================================================================
--- branches/0.8/html/libraries/pear/MDB2/Driver/mysqli.php	2012-08-01 12:50:42 UTC (rev 13187)
+++ branches/0.8/html/libraries/pear/MDB2/Driver/mysqli.php	2012-08-01 18:06:02 UTC (rev 13188)
@@ -70,6 +70,18 @@
         'escape' => '`',
     );
 
+    /**
+     * The ouptut of mysqli_errno() in _doQuery(), if any.
+     * @var integer
+     */
+    var $_query_errno;
+
+    /**
+     * The ouptut of mysqli_error() in _doQuery(), if any.
+     * @var string
+     */
+    var $_query_error;
+
     var $sql_comments = array(
         array('start' => '-- ', 'end' => "\n", 'escape' => false),
         array('start' => '#', 'end' => "\n", 'escape' => false),
@@ -191,7 +203,10 @@
      */
     function errorInfo($error = null)
     {
-        if ($this->connection) {
+        if ($this->_query_errno) {
+            $native_code = $this->_query_errno;
+            $native_msg  = $this->_query_error;
+        } elseif ($this->connection) {
             $native_code = @mysqli_errno($this->connection);
             $native_msg  = @mysqli_error($this->connection);
         } else {
@@ -702,7 +717,7 @@
     // }}}
     // {{{ standaloneQuery()
 
-    /**
+   /**
      * execute a query as DBA
      *
      * @param string $query the SQL query
@@ -725,7 +740,7 @@
         $limit = $this->limit;
         $this->offset = $this->limit = 0;
         $query = $this->_modifyQuery($query, $is_manip, $limit, $offset);
-        
+
         $result =& $this->_doQuery($query, $is_manip, $connection, $this->database_name);
         if (!PEAR::isError($result)) {
             $result = $this->_affectedRows($connection, $result);
@@ -790,10 +805,15 @@
             $result = mysqli_query($connection, $query);
         }
 
-        if (!$result && 0 !== mysqli_errno($connection)) {
-            $err =& $this->raiseError(null, null, null,
-                'Could not execute statement', __FUNCTION__);
-            return $err;
+        if (!$result) {
+            // Store now because standaloneQuery throws off $this->connection.
+            $this->_query_errno = mysqli_errno($connection);
+            if (0 !== $this->_query_errno) {
+                $this->_query_error = mysqli_error($connection);
+                $err = $this->raiseError(null, null, null,
+                    'Could not execute statement', __FUNCTION__);
+                return $err;
+            }
         }
 
         if ($this->options['multi_query']) {
@@ -960,7 +980,7 @@
             $server_info = $this->getServerVersion();
             if (is_array($server_info)) {
                 $server_version = $server_info['major'].'.'.$server_info['minor'].'.'.$server_info['patch'];
-            
+
                 if (!version_compare($server_version, '4.1.0', '<')) {
                     $this->supported['sub_selects'] = true;
                     $this->supported['prepared_statements'] = true;
@@ -1089,7 +1109,7 @@
             if (null === $placeholder_type) {
                 $placeholder_type_guess = $query[$p_position];
             }
-            
+
             $new_pos = $this->_skipDelimitedStrings($query, $position, $p_position);
             if (PEAR::isError($new_pos)) {
                 return $new_pos;
@@ -1098,7 +1118,7 @@
                 $position = $new_pos;
                 continue; //evaluate again starting from the new position
             }
-            
+
             //make sure this is not part of an user defined variable
             $new_pos = $this->_skipUserDefinedVariable($query, $position);
             if ($new_pos != $position) {
@@ -1389,7 +1409,9 @@
         if ($fetchmode == MDB2_FETCHMODE_DEFAULT) {
             $fetchmode = $this->db->fetchmode;
         }
-        if ($fetchmode & MDB2_FETCHMODE_ASSOC) {
+        if (   $fetchmode == MDB2_FETCHMODE_ASSOC
+            || $fetchmode == MDB2_FETCHMODE_OBJECT
+        ) {
             $row = @mysqli_fetch_assoc($this->result);
             if (is_array($row)
                 && $this->db->options['portability'] & MDB2_PORTABILITY_FIX_CASE
@@ -1421,8 +1443,16 @@
         if ($mode) {
             $this->db->_fixResultArrayValues($row, $mode);
         }
-        if (!empty($this->types)) {
+        if (   (   $fetchmode != MDB2_FETCHMODE_ASSOC
+                && $fetchmode != MDB2_FETCHMODE_OBJECT)
+            && !empty($this->types)
+        ) {
             $row = $this->db->datatype->convertResultRow($this->types, $row, $rtrim);
+        } elseif (($fetchmode == MDB2_FETCHMODE_ASSOC
+                || $fetchmode == MDB2_FETCHMODE_OBJECT)
+            && !empty($this->types_assoc)
+        ) {
+            $row = $this->db->datatype->convertResultRow($this->types_assoc, $row, $rtrim);
         }
         if (!empty($this->values)) {
             $this->_assignBindColumns($row);
@@ -1681,7 +1711,7 @@
      *               a MDB2 error on failure
      * @access private
      */
-    function &_execute($result_class = true, $result_wrap_class = false)
+    function &_execute($result_class = true, $result_wrap_class = true)
     {
         if (null === $this->statement) {
             $result =& parent::_execute($result_class, $result_wrap_class);
@@ -1767,7 +1797,7 @@
                 $query.= ' USING @'.implode(', @', array_values($this->positions));
             } else {
                 $result = @call_user_func_array('mysqli_stmt_bind_param', $parameters);
-                if (true !== $result) {
+                if (false === $result) {
                     $err =& $this->db->raiseError(null, null, null,
                         'Unable to bind parameters', __FUNCTION__);
                     return $err;
@@ -1874,4 +1904,4 @@
         return $result;
    }
 }
-?>
\ No newline at end of file
+?>

Modified: branches/0.8/html/libraries/pear/MDB2/Driver/oci8.php
===================================================================
--- branches/0.8/html/libraries/pear/MDB2/Driver/oci8.php	2012-08-01 12:50:42 UTC (rev 13187)
+++ branches/0.8/html/libraries/pear/MDB2/Driver/oci8.php	2012-08-01 18:06:02 UTC (rev 13188)
@@ -403,7 +403,7 @@
             return $this->raiseError(MDB2_ERROR_CONNECT_FAILED, null, null,
                 'unable to establish a connection', __FUNCTION__);
         }
-        
+
         if (empty($this->dsn['disable_iso_date'])) {
             $query = "ALTER SESSION SET NLS_DATE_FORMAT='YYYY-MM-DD HH24:MI:SS'";
             $err =& $this->_doQuery($query, true, $connection);
@@ -412,7 +412,7 @@
                 return $err;
             }
         }
-        
+
         $query = "ALTER SESSION SET NLS_NUMERIC_CHARACTERS='. '";
         $err =& $this->_doQuery($query, true, $connection);
         if (PEAR::isError($err)) {
@@ -593,7 +593,7 @@
             if ($is_manip) {
                 $result = $this->_affectedRows($connection, $result);
             } else {
-                $result =& $this->_wrapResult($result, $types, true, false, $limit, $offset);
+                $result =& $this->_wrapResult($result, $types, true, true, $limit, $offset);
             }
         }
 
@@ -821,7 +821,7 @@
             if (null === $placeholder_type) {
                 $placeholder_type_guess = $query[$p_position];
             }
-            
+
             $new_pos = $this->_skipDelimitedStrings($query, $position, $p_position);
             if (PEAR::isError($new_pos)) {
                 return $new_pos;
@@ -1026,7 +1026,9 @@
         if ($fetchmode == MDB2_FETCHMODE_DEFAULT) {
             $fetchmode = $this->db->fetchmode;
         }
-        if ($fetchmode & MDB2_FETCHMODE_ASSOC) {
+        if (   $fetchmode == MDB2_FETCHMODE_ASSOC
+            || $fetchmode == MDB2_FETCHMODE_OBJECT
+        ) {
             @OCIFetchInto($this->result, $row, OCI_ASSOC+OCI_RETURN_NULLS);
             if (is_array($row)
                 && $this->db->options['portability'] & MDB2_PORTABILITY_FIX_CASE
@@ -1061,8 +1063,16 @@
         if ($mode) {
             $this->db->_fixResultArrayValues($row, $mode);
         }
-        if (!empty($this->types)) {
+        if (   (   $fetchmode != MDB2_FETCHMODE_ASSOC
+                && $fetchmode != MDB2_FETCHMODE_OBJECT)
+            && !empty($this->types)
+        ) {
             $row = $this->db->datatype->convertResultRow($this->types, $row, $rtrim);
+        } elseif (($fetchmode == MDB2_FETCHMODE_ASSOC
+                || $fetchmode == MDB2_FETCHMODE_OBJECT)
+            && !empty($this->types_assoc)
+        ) {
+            $row = $this->db->datatype->convertResultRow($this->types_assoc, $row, $rtrim);
         }
         if (!empty($this->values)) {
             $this->_assignBindColumns($row);
@@ -1208,7 +1218,7 @@
             }
             if (empty($this->types)) {
                 foreach (array_keys($buffer) as $key) {
-                    if (is_a($buffer[$key], 'oci-lob')) {
+                    if (is_object($buffer[$key]) && is_a($buffer[$key], 'oci-lob')) {
                         $buffer[$key] = $buffer[$key]->load();
                     }
                 }
@@ -1260,7 +1270,9 @@
             return $null;
         }
         $row = $this->buffer[$target_rownum];
-        if ($fetchmode & MDB2_FETCHMODE_ASSOC) {
+        if (   $fetchmode == MDB2_FETCHMODE_ASSOC
+            || $fetchmode == MDB2_FETCHMODE_OBJECT
+        ) {
             $column_names = $this->getColumnNames();
             foreach ($column_names as $name => $i) {
                 $column_names[$name] = $row[$i];
@@ -1279,8 +1291,16 @@
         if ($mode) {
             $this->db->_fixResultArrayValues($row, $mode);
         }
-        if (!empty($this->types)) {
+        if (   (   $fetchmode != MDB2_FETCHMODE_ASSOC
+                && $fetchmode != MDB2_FETCHMODE_OBJECT)
+            && !empty($this->types)
+        ) {
             $row = $this->db->datatype->convertResultRow($this->types, $row, $rtrim);
+        } elseif (($fetchmode == MDB2_FETCHMODE_ASSOC
+                || $fetchmode == MDB2_FETCHMODE_OBJECT)
+            && !empty($this->types_assoc)
+        ) {
+            $row = $this->db->datatype->convertResultRow($this->types_assoc, $row, $rtrim);
         }
         if (!empty($this->values)) {
             $this->_assignBindColumns($row);
@@ -1472,7 +1492,7 @@
                     while (!feof($fp)) {
                         $this->values[$parameter] .= fread($fp, 8192);
                     }
-                } elseif (is_a($this->values[$parameter], 'OCI-Lob')) {
+                } elseif (is_object($this->values[$parameter]) && is_a($this->values[$parameter], 'OCI-Lob')) {
                     //do nothing
                 } elseif ($this->db->getOption('lob_allow_url_include')
                           && preg_match('/^(\w+:\/\/)(.*)$/', $this->values[$parameter], $match)
@@ -1486,7 +1506,7 @@
                 $lobs[$i]['descriptor'] =& $this->values[$parameter];
                 // Test to see if descriptor has already been created for this
                 // variable (i.e. if it has been bound more than once):
-                if (!is_a($this->values[$parameter], 'OCI-Lob')) {
+                if (!(is_object($this->values[$parameter]) && is_a($this->values[$parameter], 'OCI-Lob'))) {
                     $this->values[$parameter] = @OCINewDescriptor($connection, OCI_D_LOB);
                     if (false === $this->values[$parameter]) {
                         $result = $this->db->raiseError(null, null, null,
@@ -1503,7 +1523,7 @@
             } else if ($type == OCI_B_BFILE) {
                 // Test to see if descriptor has already been created for this
                 // variable (i.e. if it has been bound more than once):
-                if (!is_a($this->values[$parameter], "OCI-Lob")) {
+                if (!(is_object($this->values[$parameter]) && is_a($this->values[$parameter], "OCI-Lob"))) {
                     $this->values[$parameter] = @OCINewDescriptor($connection, OCI_D_FILE);
                     if (false === $this->values[$parameter]) {
                         $result = $this->db->raiseError(null, null, null,
@@ -1648,4 +1668,4 @@
         return $result;
     }
 }
-?>
\ No newline at end of file
+?>

Modified: branches/0.8/html/libraries/pear/MDB2/Driver/pgsql.php
===================================================================
--- branches/0.8/html/libraries/pear/MDB2/Driver/pgsql.php	2012-08-01 12:50:42 UTC (rev 13187)
+++ branches/0.8/html/libraries/pear/MDB2/Driver/pgsql.php	2012-08-01 18:06:02 UTC (rev 13188)
@@ -381,7 +381,7 @@
             return $this->raiseError(MDB2_ERROR_NOT_FOUND, null, null,
                 'extension '.$this->phptype.' is not compiled into PHP', __FUNCTION__);
         }
-        
+
         if ($database_name == '') {
             $database_name = 'template1';
         }
@@ -652,7 +652,7 @@
             if ($is_manip) {
                 $result =  $this->_affectedRows($connection, $result);
             } else {
-                $result =& $this->_wrapResult($result, $types, true, false, $limit, $offset);
+                $result =& $this->_wrapResult($result, $types, true, true, $limit, $offset);
             }
         }
 
@@ -764,10 +764,10 @@
         }
         return $query;
     }
-    
+
     // }}}
     // {{{ _modifyManipQuery()
-    
+
     /**
      * Changes a manip query string for various DBMS specific reasons
      *
@@ -916,7 +916,7 @@
             if (null === $placeholder_type) {
                 $placeholder_type_guess = $query[$p_position];
             }
-            
+
             $new_pos = $this->_skipDelimitedStrings($query, $position, $p_position);
             if (PEAR::isError($new_pos)) {
                 return $new_pos;
@@ -1169,7 +1169,7 @@
      * @return int data array on success, a MDB2 error on failure
      * @access public
      */
-    function &fetchRow($fetchmode = MDB2_FETCHMODE_DEFAULT, $rownum = null)
+    function fetchRow($fetchmode = MDB2_FETCHMODE_DEFAULT, $rownum = null)
     {
         if (null !== $rownum) {
             $seek = $this->seek($rownum);
@@ -1180,7 +1180,9 @@
         if ($fetchmode == MDB2_FETCHMODE_DEFAULT) {
             $fetchmode = $this->db->fetchmode;
         }
-        if ($fetchmode & MDB2_FETCHMODE_ASSOC) {
+        if (   $fetchmode == MDB2_FETCHMODE_ASSOC
+            || $fetchmode == MDB2_FETCHMODE_OBJECT
+        ) {
             $row = @pg_fetch_array($this->result, null, PGSQL_ASSOC);
             if (is_array($row)
                 && $this->db->options['portability'] & MDB2_PORTABILITY_FIX_CASE
@@ -1211,8 +1213,16 @@
         if ($mode) {
             $this->db->_fixResultArrayValues($row, $mode);
         }
-        if (!empty($this->types)) {
+        if (   (   $fetchmode != MDB2_FETCHMODE_ASSOC
+                && $fetchmode != MDB2_FETCHMODE_OBJECT)
+            && !empty($this->types)
+        ) {
             $row = $this->db->datatype->convertResultRow($this->types, $row, $rtrim);
+        } elseif (($fetchmode == MDB2_FETCHMODE_ASSOC
+                || $fetchmode == MDB2_FETCHMODE_OBJECT)
+            && !empty($this->types_assoc)
+        ) {
+            $row = $this->db->datatype->convertResultRow($this->types_assoc, $row, $rtrim);
         }
         if (!empty($this->values)) {
             $this->_assignBindColumns($row);
@@ -1548,5 +1558,29 @@
         parent::free();
         return $result;
     }
+
+    /**
+     * drop an existing table
+     *
+     * @param string $name name of the table that should be dropped
+     * @return mixed MDB2_OK on success, a MDB2 error on failure
+     * @access public
+     */
+    function dropTable($name)
+    {
+        $db =& $this->getDBInstance();
+        if (PEAR::isError($db)) {
+            return $db;
+        }
+
+        $name = $db->quoteIdentifier($name, true);
+        $result = $db->exec("DROP TABLE $name");
+
+        if (PEAR::isError($result)) {
+            $result = $db->exec("DROP TABLE $name CASCADE");
+        }
+
+       return $result;
+    }
 }
-?>
\ No newline at end of file
+?>

Modified: branches/0.8/html/libraries/pear/MDB2/Driver/sqlite.php
===================================================================
--- branches/0.8/html/libraries/pear/MDB2/Driver/sqlite.php	2012-08-01 12:50:42 UTC (rev 13187)
+++ branches/0.8/html/libraries/pear/MDB2/Driver/sqlite.php	2012-08-01 18:06:02 UTC (rev 13188)
@@ -126,7 +126,7 @@
         }
         $native_msg = $this->_lasterror
             ? html_entity_decode($this->_lasterror) : @sqlite_error_string($native_code);
-            
+
         // PHP 5.2+ prepends the function name to $php_errormsg, so we need
         // this hack to work around it, per bug #9599.
         $native_msg = preg_replace('/^sqlite[a-z_]+\(\)[^:]*: /', '', $native_msg);
@@ -142,6 +142,7 @@
                     '/is not unique/' => MDB2_ERROR_CONSTRAINT,
                     '/columns .* are not unique/i' => MDB2_ERROR_CONSTRAINT,
                     '/uniqueness constraint failed/' => MDB2_ERROR_CONSTRAINT,
+                    '/violates .*constraint/' => MDB2_ERROR_CONSTRAINT,
                     '/may not be NULL/' => MDB2_ERROR_CONSTRAINT_NOT_NULL,
                     '/^no such column:/' => MDB2_ERROR_NOSUCHFIELD,
                     '/no column named/' => MDB2_ERROR_NOSUCHFIELD,
@@ -893,7 +894,9 @@
         if ($fetchmode == MDB2_FETCHMODE_DEFAULT) {
             $fetchmode = $this->db->fetchmode;
         }
-        if ($fetchmode & MDB2_FETCHMODE_ASSOC) {
+        if (   $fetchmode == MDB2_FETCHMODE_ASSOC
+            || $fetchmode == MDB2_FETCHMODE_OBJECT
+        ) {
             $row = @sqlite_fetch_array($this->result, SQLITE_ASSOC);
             if (is_array($row)
                 && $this->db->options['portability'] & MDB2_PORTABILITY_FIX_CASE
@@ -924,8 +927,16 @@
         if ($mode) {
             $this->db->_fixResultArrayValues($row, $mode);
         }
-        if (!empty($this->types)) {
+        if (   (   $fetchmode != MDB2_FETCHMODE_ASSOC
+                && $fetchmode != MDB2_FETCHMODE_OBJECT)
+            && !empty($this->types)
+        ) {
             $row = $this->db->datatype->convertResultRow($this->types, $row, $rtrim);
+        } elseif (($fetchmode == MDB2_FETCHMODE_ASSOC
+                || $fetchmode == MDB2_FETCHMODE_OBJECT)
+            && !empty($this->types_assoc)
+        ) {
+            $row = $this->db->datatype->convertResultRow($this->types_assoc, $row, $rtrim);
         }
         if (!empty($this->values)) {
             $this->_assignBindColumns($row);
@@ -1091,4 +1102,4 @@
 {
 
 }
-?>
\ No newline at end of file
+?>

Modified: branches/0.8/html/libraries/pear/MDB2/Driver/sqlsrv.php
===================================================================
--- branches/0.8/html/libraries/pear/MDB2/Driver/sqlsrv.php	2012-08-01 12:50:42 UTC (rev 13187)
+++ branches/0.8/html/libraries/pear/MDB2/Driver/sqlsrv.php	2012-08-01 18:06:02 UTC (rev 13188)
@@ -120,14 +120,14 @@
         $native_code = null;
         $native_msg  = null;
         if ($connection) {
-            $retErrors = sqlsrv_errors(SQLSRV_ERR_ALL);  
+            $retErrors = sqlsrv_errors(SQLSRV_ERR_ALL);
             if ($retErrors !== null) {
                 foreach ($retErrors as $arrError) {
-                    $native_msg .= "SQLState: ".$arrError[ 'SQLSTATE']."\n";  
-                    $native_msg .= "Error Code: ".$arrError[ 'code']."\n";  
-                    $native_msg .= "Message: ".$arrError[ 'message']."\n";  
+                    $native_msg .= "SQLState: ".$arrError[ 'SQLSTATE']."\n";
+                    $native_msg .= "Error Code: ".$arrError[ 'code']."\n";
+                    $native_msg .= "Message: ".$arrError[ 'message']."\n";
                     $native_code = $arrError[ 'code'];
-                }  
+                }
             }
         }
         if (null === $error) {
@@ -473,7 +473,7 @@
 
         $query = $this->_modifyQuery($query, $is_manip, $this->limit, $this->offset);
         $this->offset = $this->limit = 0;
-        
+
         $result = $this->_doQuery($query, $is_manip, $connection);
         if (!PEAR::isError($result)) {
             $result = $this->_affectedRows($connection, $result);
@@ -530,8 +530,8 @@
             $this->connected_database_name = $database_name;
         }
 
-    $query = preg_replace('/DATE_FORMAT\((MIN\()?([\w|.]*)(\))?\\Q, \'%Y-%m-%d\')\E/i','CONVERT(varchar(10),$1$2$3,120)',$query); 
-    $query = preg_replace('/DATE_FORMAT\(([\w|.]*)\, \'\%Y\-\%m\-\%d %H\:00\:00\'\)/i','CONVERT(varchar(13),$1,120)+\':00:00\'',$query); 
+    $query = preg_replace('/DATE_FORMAT\((MIN\()?([\w|.]*)(\))?\\Q, \'%Y-%m-%d\')\E/i','CONVERT(varchar(10),$1$2$3,120)',$query);
+    $query = preg_replace('/DATE_FORMAT\(([\w|.]*)\, \'\%Y\-\%m\-\%d %H\:00\:00\'\)/i','CONVERT(varchar(13),$1,120)+\':00:00\'',$query);
         $result = @sqlsrv_query($connection,$query);
         if (!$result) {
             $err = $this->raiseError(null, null, null,
@@ -650,7 +650,7 @@
             }
             return false;
         }
-        if (@sqlsrv_fetch($tableExits)) {
+        if (@sqlsrv_fetch($tableExists)) {
             return true;
         }
         return false;
@@ -676,7 +676,7 @@
         $seqcol_name = $this->quoteIdentifier($this->options['seqcol_name'], true);
         $this->pushErrorHandling(PEAR_ERROR_RETURN);
         $this->expectError(MDB2_ERROR_NOSUCHTABLE);
-        
+
         $seq_val = $this->_checkSequence($sequence_name);
 
         if ($seq_val) {
@@ -703,7 +703,7 @@
                      * exists, then we get the last inserted id if it does.
                      *
                      * In theory, $seq_name should be created otherwise there would
-                     * have been an error thrown somewhere up there.. 
+                     * have been an error thrown somewhere up there..
                      *
                      * @todo confirm
                      */
@@ -834,7 +834,7 @@
             }
         }
         return $obj;
-    } 
+    }
     // {{{ fetchRow()
 
     /**
@@ -863,6 +863,7 @@
         if ($fetchmode == MDB2_FETCHMODE_DEFAULT) {
             $fetchmode = $this->db->fetchmode;
         }
+
         $row = false;
         $arrNum = array();
         if ($fetchmode == MDB2_FETCHMODE_ORDERED) {
@@ -881,10 +882,7 @@
                 $o = new $this->db->options['fetch_class'];
                 $row = $this->array_to_obj($this->rows[$this->cursor], $o);
                 break;
-            default:
-            $row = $this->rows[$this->cursor] + $arrNum;
-            break;
-        } 
+        }
         $this->cursor++;
 
         /*
@@ -894,8 +892,8 @@
         switch($fetchmode) {
             case MDB2_FETCHMODE_ASSOC: $fetchmode = SQLSRV_FETCH_ASSOC; break;
             case MDB2_FETCHMODE_ORDERED: $fetchmode = SQLSRV_FETCH_NUMERIC; break;
-            case MDB2_FETCHMODE_DEFAULT: 
-            default: 
+            case MDB2_FETCHMODE_DEFAULT:
+            default:
                 $fetchmode = SQLSRV_FETCH_BOTH;
         }
             $row = sqlsrv_fetch_array($this->result,$fetchmode);
@@ -933,8 +931,16 @@
         if ($mode) {
             $this->db->_fixResultArrayValues($row, $mode);
         }
-        if (!empty($this->types)) {
+        if (   (   $fetchmode != MDB2_FETCHMODE_ASSOC
+                && $fetchmode != MDB2_FETCHMODE_OBJECT)
+            && !empty($this->types)
+        ) {
             $row = $this->db->datatype->convertResultRow($this->types, $row, $rtrim);
+        } elseif (($fetchmode == MDB2_FETCHMODE_ASSOC
+                || $fetchmode == MDB2_FETCHMODE_OBJECT)
+            && !empty($this->types_assoc)
+        ) {
+            $row = $this->db->datatype->convertResultRow($this->types_assoc, $row, $rtrim);
         }
         if (!empty($this->values)) {
             $this->_assignBindColumns($row);



More information about the Jaws-commits mailing list