ChangeLog
authorKarsten Dambekalns <karsten.dambekalns@typo3.org>
Thu, 29 Jun 2006 22:18:11 +0000 (22:18 +0000)
committerKarsten Dambekalns <karsten.dambekalns@typo3.org>
Thu, 29 Jun 2006 22:18:11 +0000 (22:18 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@1562 709f56b5-9817-0410-a4d7-c38de5d9e867

120 files changed:
ChangeLog
t3lib/class.t3lib_page.php
t3lib/class.t3lib_sqlparser.php
typo3/sysext/adodb/adodb/adodb-active-record.inc.php
typo3/sysext/adodb/adodb/adodb-csvlib.inc.php
typo3/sysext/adodb/adodb/adodb-datadict.inc.php
typo3/sysext/adodb/adodb/adodb-error.inc.php
typo3/sysext/adodb/adodb/adodb-errorhandler.inc.php
typo3/sysext/adodb/adodb/adodb-errorpear.inc.php
typo3/sysext/adodb/adodb/adodb-exceptions.inc.php
typo3/sysext/adodb/adodb/adodb-iterator.inc.php
typo3/sysext/adodb/adodb/adodb-lib.inc.php
typo3/sysext/adodb/adodb/adodb-pager.inc.php
typo3/sysext/adodb/adodb/adodb-pear.inc.php
typo3/sysext/adodb/adodb/adodb-perf.inc.php
typo3/sysext/adodb/adodb/adodb-php4.inc.php
typo3/sysext/adodb/adodb/adodb.inc.php
typo3/sysext/adodb/adodb/datadict/datadict-access.inc.php
typo3/sysext/adodb/adodb/datadict/datadict-db2.inc.php
typo3/sysext/adodb/adodb/datadict/datadict-firebird.inc.php
typo3/sysext/adodb/adodb/datadict/datadict-generic.inc.php
typo3/sysext/adodb/adodb/datadict/datadict-ibase.inc.php
typo3/sysext/adodb/adodb/datadict/datadict-informix.inc.php
typo3/sysext/adodb/adodb/datadict/datadict-mssql.inc.php
typo3/sysext/adodb/adodb/datadict/datadict-mysql.inc.php
typo3/sysext/adodb/adodb/datadict/datadict-oci8.inc.php
typo3/sysext/adodb/adodb/datadict/datadict-postgres.inc.php
typo3/sysext/adodb/adodb/datadict/datadict-sybase.inc.php
typo3/sysext/adodb/adodb/docs/docs-active-record.htm
typo3/sysext/adodb/adodb/docs/docs-adodb.htm
typo3/sysext/adodb/adodb/docs/docs-datadict.htm
typo3/sysext/adodb/adodb/docs/docs-oracle.htm
typo3/sysext/adodb/adodb/docs/docs-perf.htm
typo3/sysext/adodb/adodb/docs/docs-session.htm
typo3/sysext/adodb/adodb/drivers/adodb-access.inc.php
typo3/sysext/adodb/adodb/drivers/adodb-ado.inc.php
typo3/sysext/adodb/adodb/drivers/adodb-ado5.inc.php
typo3/sysext/adodb/adodb/drivers/adodb-ado_access.inc.php
typo3/sysext/adodb/adodb/drivers/adodb-ado_mssql.inc.php
typo3/sysext/adodb/adodb/drivers/adodb-borland_ibase.inc.php
typo3/sysext/adodb/adodb/drivers/adodb-csv.inc.php
typo3/sysext/adodb/adodb/drivers/adodb-db2.inc.php
typo3/sysext/adodb/adodb/drivers/adodb-fbsql.inc.php
typo3/sysext/adodb/adodb/drivers/adodb-firebird.inc.php
typo3/sysext/adodb/adodb/drivers/adodb-ibase.inc.php
typo3/sysext/adodb/adodb/drivers/adodb-informix.inc.php
typo3/sysext/adodb/adodb/drivers/adodb-informix72.inc.php
typo3/sysext/adodb/adodb/drivers/adodb-ldap.inc.php
typo3/sysext/adodb/adodb/drivers/adodb-mssql.inc.php
typo3/sysext/adodb/adodb/drivers/adodb-mssqlpo.inc.php
typo3/sysext/adodb/adodb/drivers/adodb-mysql.inc.php
typo3/sysext/adodb/adodb/drivers/adodb-mysqli.inc.php
typo3/sysext/adodb/adodb/drivers/adodb-mysqlt.inc.php
typo3/sysext/adodb/adodb/drivers/adodb-netezza.inc.php
typo3/sysext/adodb/adodb/drivers/adodb-oci8.inc.php
typo3/sysext/adodb/adodb/drivers/adodb-oci805.inc.php
typo3/sysext/adodb/adodb/drivers/adodb-oci8po.inc.php
typo3/sysext/adodb/adodb/drivers/adodb-odbc.inc.php
typo3/sysext/adodb/adodb/drivers/adodb-odbc_db2.inc.php
typo3/sysext/adodb/adodb/drivers/adodb-odbc_mssql.inc.php
typo3/sysext/adodb/adodb/drivers/adodb-odbc_oracle.inc.php
typo3/sysext/adodb/adodb/drivers/adodb-odbtp.inc.php
typo3/sysext/adodb/adodb/drivers/adodb-odbtp_unicode.inc.php
typo3/sysext/adodb/adodb/drivers/adodb-oracle.inc.php
typo3/sysext/adodb/adodb/drivers/adodb-pdo.inc.php
typo3/sysext/adodb/adodb/drivers/adodb-pdo_mssql.inc.php
typo3/sysext/adodb/adodb/drivers/adodb-pdo_mysql.inc.php
typo3/sysext/adodb/adodb/drivers/adodb-pdo_oci.inc.php
typo3/sysext/adodb/adodb/drivers/adodb-pdo_pgsql.inc.php
typo3/sysext/adodb/adodb/drivers/adodb-postgres.inc.php
typo3/sysext/adodb/adodb/drivers/adodb-postgres64.inc.php
typo3/sysext/adodb/adodb/drivers/adodb-postgres7.inc.php
typo3/sysext/adodb/adodb/drivers/adodb-postgres8.inc.php
typo3/sysext/adodb/adodb/drivers/adodb-proxy.inc.php
typo3/sysext/adodb/adodb/drivers/adodb-sapdb.inc.php
typo3/sysext/adodb/adodb/drivers/adodb-sqlanywhere.inc.php
typo3/sysext/adodb/adodb/drivers/adodb-sqlite.inc.php
typo3/sysext/adodb/adodb/drivers/adodb-sqlitepo.inc.php
typo3/sysext/adodb/adodb/drivers/adodb-sybase.inc.php
typo3/sysext/adodb/adodb/drivers/adodb-sybase_ase.inc.php
typo3/sysext/adodb/adodb/drivers/adodb-vfp.inc.php
typo3/sysext/adodb/adodb/perf/perf-db2.inc.php
typo3/sysext/adodb/adodb/perf/perf-informix.inc.php
typo3/sysext/adodb/adodb/perf/perf-mssql.inc.php
typo3/sysext/adodb/adodb/perf/perf-mysql.inc.php
typo3/sysext/adodb/adodb/perf/perf-oci8.inc.php
typo3/sysext/adodb/adodb/perf/perf-postgres.inc.php
typo3/sysext/adodb/adodb/pivottable.inc.php
typo3/sysext/adodb/adodb/rsfilter.inc.php
typo3/sysext/adodb/adodb/server.php
typo3/sysext/adodb/adodb/session/adodb-compress-bzip2.php
typo3/sysext/adodb/adodb/session/adodb-compress-gzip.php
typo3/sysext/adodb/adodb/session/adodb-cryptsession.php
typo3/sysext/adodb/adodb/session/adodb-encrypt-mcrypt.php
typo3/sysext/adodb/adodb/session/adodb-encrypt-md5.php
typo3/sysext/adodb/adodb/session/adodb-encrypt-secret.php
typo3/sysext/adodb/adodb/session/adodb-session-clob.php
typo3/sysext/adodb/adodb/session/adodb-session.php
typo3/sysext/adodb/adodb/session/old/adodb-cryptsession.php
typo3/sysext/adodb/adodb/session/old/adodb-session-clob.php
typo3/sysext/adodb/adodb/session/old/adodb-session.php
typo3/sysext/adodb/adodb/tests/test-active-recs2.php
typo3/sysext/adodb/adodb/tests/test.php
typo3/sysext/adodb/adodb/tests/testdatabases.inc.php
typo3/sysext/adodb/adodb/toexport.inc.php
typo3/sysext/adodb/adodb/tohtml.inc.php
typo3/sysext/adodb/checkconnectionwizard.php
typo3/sysext/adodb/class.tx_adodb_tceforms.php
typo3/sysext/adodb/doc/490.DBAL.patch [new file with mode: 0644]
typo3/sysext/adodb/ext_emconf.php
typo3/sysext/adodb/ext_localconf.php
typo3/sysext/dbal/ChangeLog
typo3/sysext/dbal/class.ux_t3lib_db.php
typo3/sysext/dbal/class.ux_t3lib_sqlengine.php
typo3/sysext/dbal/class.ux_t3lib_sqlparser.php
typo3/sysext/dbal/doc/manual.sxw
typo3/sysext/dbal/ext_emconf.php
typo3/sysext/dbal/ext_localconf.php
typo3/sysext/dbal/ext_tables.sql
typo3/sysext/dbal/mod1/index.php

index b96b761..90b00cb 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2006-06-30 Karsten Dambekalns <karsten@typo3.org>
+
+       * t3lib_page: Changed getMultipleGroupsWhereClause() to include a check using IS NULL to make it compatible to Oracle. Made enableFields() call getMultipleGroupsWhereClause() non-statically using $this.
+
 2006-06-29  Ernesto Baschny <ernst@cron-it.de>
 
        * Fix bug #3522 also in "content (default)": Linking images to hidden pages results in click-enlarge
index fd74e24..dd6117f 100755 (executable)
@@ -972,7 +972,7 @@ class t3lib_pageSelect {
                                        }
                                        if ($ctrl['enablecolumns']['fe_group'] && !$ignore_array['fe_group']) {
                                                $field = $table.'.'.$ctrl['enablecolumns']['fe_group'];
-                                               $query.= t3lib_pageSelect::getMultipleGroupsWhereClause($field, $table);
+                                               $query.= $this->getMultipleGroupsWhereClause($field, $table);
                                        }
 
                                        // Call hook functions for additional enableColumns
@@ -1009,6 +1009,7 @@ class t3lib_pageSelect {
                $memberGroups = t3lib_div::intExplode(',',$GLOBALS['TSFE']->gr_list);
                $orChecks=array();
                $orChecks[]=$field.'=\'\'';     // If the field is empty, then OK
+               $orChecks[]=$field.' IS NULL';  // If the field is NULL, then OK
                $orChecks[]=$field.'=\'0\'';    // If the field contsains zero, then OK
 
                foreach($memberGroups as $value)        {
index 0c5a3ff..6a327aa 100755 (executable)
@@ -712,7 +712,7 @@ class t3lib_sqlparser {
                        } else {        // Outside parenthesis, looking for next field:
 
                                        // Looking for a known function (only known functions supported)
-                               $func = $this->nextPart($parseString,'^(count|max|min|floor|sum|avg)[[:space:]]*\(');
+                               $func = $this->nextPart($parseString,'^(count|max|min|floor|sum|avg|concat|year|from_unixtime|lcase|left|unix_timestamp)[[:space:]]*\(');
                                if ($func)      {
                                        $parseString = trim(substr($parseString,1));    // Strip of "("
                                        $stack[$pnt]['type'] = 'function';
@@ -804,14 +804,14 @@ class t3lib_sqlparser {
                                // Looking for the table:
                        if ($stack[$pnt]['table'] = $this->nextPart($parseString,'^([[:alnum:]_]+)(,|[[:space:]]+)'))   {
                                        // Looking for stop-keywords before fetching potential table alias:
-                                       if ($stopRegex && ($this->lastStopKeyWord = $this->nextPart($parseString, $stopRegex))) {
-                                               $this->lastStopKeyWord = strtoupper(str_replace(array(' ',"\t","\r","\n"),'',$this->lastStopKeyWord));
-                                               return $stack;
-                                       }
-                                       if(!preg_match('/^(LEFT|JOIN)[[:space:]]+/i',$parseString)) {
-                                               $stack[$pnt]['as_keyword'] = $this->nextPart($parseString,'^(AS[[:space:]]+)');
-                           $stack[$pnt]['as'] = $this->nextPart($parseString,'^([[:alnum:]_]+)[[:space:]]*');
-                                       }
+                               if ($stopRegex && ($this->lastStopKeyWord = $this->nextPart($parseString, $stopRegex))) {
+                                       $this->lastStopKeyWord = strtoupper(str_replace(array(' ',"\t","\r","\n"),'',$this->lastStopKeyWord));
+                                       return $stack;
+                               }
+                               if(!preg_match('/^(LEFT|JOIN)[[:space:]]+/i',$parseString)) {
+                                       $stack[$pnt]['as_keyword'] = $this->nextPart($parseString,'^(AS[[:space:]]+)');
+                                       $stack[$pnt]['as'] = $this->nextPart($parseString,'^([[:alnum:]_]+)[[:space:]]*');
+                               }
                        } else return $this->parseError('No table name found as expected in parseFromTables()!',$parseString);
 
                                // Looking for JOIN
@@ -905,9 +905,18 @@ class t3lib_sqlparser {
                                        // Find "modifyer", eg. "NOT or !"
                                $stack[$level][$pnt[$level]]['modifier'] = trim($this->nextPart($parseString,'^(!|NOT[[:space:]]+)'));
 
-                                       // Fieldname:
-                               if ($fieldName = $this->nextPart($parseString,'^([[:alnum:]._]+)([[:space:]]+|&|<=|>=|<|>|=|!=|IS)'))   {
-
+                               if($fieldName = $this->nextFunction($parseString)) {    // SQL functions
+                                       if($parseString{0}=='(') {
+                                               $parseString = ltrim(substr($parseString,1));
+                                               $arg = $this->getValue($parseString);
+                                               $fieldName .= '('.$arg[0].')';
+                                               $parseString = ltrim(substr($parseString,1));
+                                       }
+                                       $stack[$level][$pnt[$level]]['table'] = '';
+                                       $stack[$level][$pnt[$level]]['field'] = $fieldName;
+                               }
+                                               // Fieldname:
+                               elseif ($fieldName = $this->nextPart($parseString,'^([[:alnum:]._]+)([[:space:]]+|&|<=|>=|<|>|=|!=|IS)'))       {
                                                // Parse field name into field and table:
                                        $tableField = explode('.',$fieldName,2);
                                        if (count($tableField)==2)      {
@@ -929,7 +938,7 @@ class t3lib_sqlparser {
                                }
 
                                        // Find "comparator":
-                               $stack[$level][$pnt[$level]]['comparator'] = $this->nextPart($parseString,'^(<=|>=|<|>|=|!=|NOT[[:space:]]+IN|IN|NOT[[:space:]]+LIKE|LIKE|IS)');
+                               $stack[$level][$pnt[$level]]['comparator'] = $this->nextPart($parseString,'^(<=|>=|<|>|=|!=|NOT[[:space:]]+IN|IN|NOT[[:space:]]+LIKE|LIKE|IS NOT|IS)');
                                if (strlen($stack[$level][$pnt[$level]]['comparator'])) {
                                                // Finding value for comparator:
                                        $stack[$level][$pnt[$level]]['value'] = $this->getValue($parseString,$stack[$level][$pnt[$level]]['comparator']);
@@ -996,7 +1005,7 @@ class t3lib_sqlparser {
                $result = array();
 
                        // Field type:
-               if ($result['fieldType'] =  $this->nextPart($parseString,'^(int|smallint|tinyint|mediumint|bigint|double|numeric|decimal|varchar|char|text|tinytext|mediumtext|longtext|blob|tinyblob|mediumblob|longblob)([[:space:],]+|\()')) {
+               if ($result['fieldType'] =  $this->nextPart($parseString,'^(int|smallint|tinyint|mediumint|bigint|double|numeric|decimal|float|varchar|char|text|tinytext|mediumtext|longtext|blob|tinyblob|mediumblob|longblob)([[:space:],]+|\()'))   {
 
                                // Looking for value:
                        if (substr($parseString,0,1)=='(')      {
@@ -1065,7 +1074,7 @@ class t3lib_sqlparser {
         * @param       string          The comparator used before. If "NOT IN" or "IN" then the value is expected to be a list of values. Otherwise just an integer (un-quoted) or string (quoted)
         * @return      mixed           The value (string/integer). Otherwise an array with error message in first key (0)
         */
-       function getValue(&$parseString,$comparator='') {
+       function getValue(&$parseString,$comparator='',$extraRegexpChars='')    {
                $value = '';
 
                if (t3lib_div::inList('NOTIN,IN,_LIST',strtoupper(str_replace(array(' ',"\n","\r","\t"),'',$comparator))))      {       // List of values:
@@ -1092,11 +1101,23 @@ class t3lib_sqlparser {
                                } else return array($this->parseError('No ) parenthesis in list',$parseString));
                        } else return array($this->parseError('No ( parenthesis starting the list',$parseString));
 
+               } elseif($function = $this->nextFunction($parseString)) {       // SQL functions
+                       if($parseString{0}=='(') {
+                               $parseString = ltrim(substr($parseString,1));
+                               $arg = $this->getValue($parseString,'',','); // extraRegexpChars for stuff like LEFT(tx_dam.title,1)
+                               if(count($arg)==2)
+                                       $function .= '('.$arg[1].$arg[0].$arg[1].')';
+                               else
+                                       $function .= '('.$arg[0].')';
+                               $parseString = ltrim(substr($parseString,1));
+                       } elseif($function=='BETWEEN') {
+
+                       }
+                       return array($function);
                } else {        // Just plain string value, in quotes or not:
 
                                // Quote?
                        $firstChar = substr($parseString,0,1);
-
                        switch($firstChar)      {
                                case '"':
                                        $value = array($this->getValueInQuotes($parseString,'"'),'"');
@@ -1106,7 +1127,7 @@ class t3lib_sqlparser {
                                break;
                                default:
                                        $reg = array();
-                                       if (preg_match('/^([[:alnum:]._-]+)/i',$parseString, $reg))     {
+                                       if (preg_match('/^([[:alnum:]'.$extraRegexpChars.'._-]+)/i',$parseString, $reg))        {
                                                $parseString = ltrim(substr($parseString,strlen($reg[0])));
                                                $value = array($reg[1]);
                                        }
@@ -1116,6 +1137,10 @@ class t3lib_sqlparser {
                return $value;
        }
 
+       function nextFunction(&$parseString) {
+               return $this->nextPart($parseString,'^(count|max|min|floor|sum|avg|concat|year|from_unixtime|lcase|left|unix_timestamp)([[:space:]]*\()');
+       }
+
        /**
         * Get value in quotes from $parseString.
         * NOTICE: If a query being parsed was prepared for another database than MySQL this function should probably be changed
index 93d4da3..40e3708 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /*
 
-@version V4.81 3 May 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
+@version V4.90 8 June 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
   Latest version is available at http://adodb.sourceforge.net
  
   Released under both BSD license and Lesser GPL library license. 
@@ -10,7 +10,7 @@
   
   Active Record implementation. Superset of Zend Framework's.
   
-  Version 0.03
+  Version 0.04
   
   See http://www-128.ibm.com/developerworks/java/library/j-cb03076/?ca=dgr-lnxw01ActiveRecord 
        for info on Ruby on Rails Active Record implementation
@@ -56,7 +56,7 @@ function ADODB_SetDatabaseAdapter(&$db)
 
 class ADODB_Active_Record {
        var $_dbat; // associative index pointing to ADODB_Active_DB eg. $ADODB_Active_DBS[_dbat]
-       var $_table; // tablename
+       var $_table; // tablename, if set in class definition then use it as table name
        var $_tableat; // associative index pointing to ADODB_Active_Table, eg $ADODB_Active_DBS[_dbat]->tables[$this->_tableat]
        var $_where; // where clause set in Load()
        var $_saved = false; // indicates whether data is already inserted.
@@ -85,8 +85,10 @@ class ADODB_Active_Record {
                        $pkeyarr = false;
                }
                
-               if (!$table) $table = $this->_pluralize(get_class($this));
-               
+               if (!$table) { 
+                       if (!empty($this->_table)) $table = $this->_table;
+                       else $table = $this->_pluralize(get_class($this));
+               }
                if ($db) {
                        $this->_dbat = ADODB_Active_Record::SetDatabaseAdapter($db);
                } else
@@ -455,6 +457,13 @@ class ADODB_Active_Record {
                $db->Execute($sql);
        }
        
+       // returns an array of active record objects
+       function &Find($whereOrderBy,$bindarr=false,$pkeysArr=false)
+       {
+               $db =& $this->DB(); if (!$db || empty($this->_table)) return false;
+               $arr =& $db->GetActiveRecordsClass(get_class($this),$this->_table, $whereOrderBy,$bindarr,$pkeysArr);
+               return $arr;
+       }
        
        // returns 0 on error, 1 on update, 2 on insert
        function Replace()
index 073c20f..77ad6f9 100644 (file)
@@ -8,7 +8,7 @@ $ADODB_INCLUDED_CSV = 1;
 
 /* 
 
-  V4.81 3 May 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
+  V4.90 8 June 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence. See License.txt. 
index 94a03d6..7165392 100644 (file)
@@ -1,15 +1,15 @@
 <?php
 
 /**
-  V4.81 3 May 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
-  Released under both BSD license and Lesser GPL library license. 
-  Whenever there is any discrepancy between the two licenses, 
+  V4.90 8 June 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
+  Released under both BSD license and Lesser GPL library license.
+  Whenever there is any discrepancy between the two licenses,
   the BSD license will take precedence.
-       
+
   Set tabs to 4 for best viewing.
+
        DOCUMENTATION:
-       
+
                See adodb/tests/test-datadict.php for docs and examples.
 */
 
@@ -42,13 +42,13 @@ if (!function_exists('ctype_alnum')) {
 /**
        Parse arguments, treat "text" (text) and 'text' as quotation marks.
        To escape, use "" or '' or ))
-       
+
        Will read in "abc def" sans quotes, as: abc def
        Same with 'abc def'.
        However if `abc def`, then will read in as `abc def`
-       
+
        @param endstmtchar    Character that indicates end of statement
-       @param tokenchars     Include the following characters in tokens apart from A-Z and 0-9 
+       @param tokenchars     Include the following characters in tokens apart from A-Z and 0-9
        @returns 2 dimensional array containing parsed tokens.
 */
 function Lens_ParseArgs($args,$endstmtchar=',',$tokenchars='_.-')
@@ -62,7 +62,7 @@ function Lens_ParseArgs($args,$endstmtchar=',',$tokenchars='_.-')
        $max = strlen($args);
        $quoted = false;
        $tokarr = array();
-       
+
        while ($pos < $max) {
                $ch = substr($args,$pos,1);
                switch($ch) {
@@ -77,17 +77,17 @@ function Lens_ParseArgs($args,$endstmtchar=',',$tokenchars='_.-')
                                }
                                break;
                        }
-                       
+
                        $tokarr[] = $ch;
                        break;
-               
+
                case '`':
                        if ($intoken) $tokarr[] = $ch;
                case '(':
-               case ')':       
+               case ')':
                case '"':
                case "'":
-                       
+
                        if ($intoken) {
                                if (empty($endquote)) {
                                        $tokens[$stmtno][] = implode('',$tokarr);
@@ -109,9 +109,9 @@ function Lens_ParseArgs($args,$endstmtchar=',',$tokenchars='_.-')
                                        }
                                } else
                                        $tokarr[] = $ch;
-                                       
+
                        }else {
-                       
+
                                if ($ch == '(') $endquote = ')';
                                else $endquote = $ch;
                                $quoted = true;
@@ -120,27 +120,27 @@ function Lens_ParseArgs($args,$endstmtchar=',',$tokenchars='_.-')
                                if ($ch == '`') $tokarr[] = '`';
                        }
                        break;
-                       
+
                default:
-                       
+
                        if (!$intoken) {
                                if ($ch == $endstmtchar) {
                                        $stmtno += 1;
                                        $tokens[$stmtno] = array();
                                        break;
                                }
-                       
+
                                $intoken = true;
                                $quoted = false;
                                $endquote = false;
                                $tokarr = array();
-       
+
                        }
-                       
+
                        if ($quoted) $tokarr[] = $ch;
                        else if (ctype_alnum($ch) || strpos($tokenchars,$ch) !== false) $tokarr[] = $ch;
                        else {
-                               if ($ch == $endstmtchar) {                      
+                               if ($ch == $endstmtchar) {
                                        $tokens[$stmtno][] = implode('',$tokarr);
                                        $stmtno += 1;
                                        $tokens[$stmtno] = array();
@@ -156,7 +156,7 @@ function Lens_ParseArgs($args,$endstmtchar=',',$tokenchars='_.-')
                $pos += 1;
        }
        if ($intoken) $tokens[$stmtno][] = implode('',$tokarr);
-       
+
        return $tokens;
 }
 
@@ -165,7 +165,7 @@ class ADODB_DataDict {
        var $connection;
        var $debug = false;
        var $dropTable = 'DROP TABLE %s';
-       var $renameTable = 'RENAME TABLE %s TO %s'; 
+       var $renameTable = 'RENAME TABLE %s TO %s';
        var $dropIndex = 'DROP INDEX %s';
        var $addCol = ' ADD';
        var $alterCol = ' ALTER COLUMN';
@@ -180,75 +180,75 @@ class ADODB_DataDict {
        var $invalidResizeTypes4 = array('CLOB','BLOB','TEXT','DATE','TIME'); // for changetablesql
        var $blobSize = 100;    /// any varchar/char field this size or greater is treated as a blob
                                                        /// in other words, we use a text area for editting.
-       
+
        function GetCommentSQL($table,$col)
        {
                return false;
        }
-       
+
        function SetCommentSQL($table,$col,$cmt)
        {
                return false;
        }
-       
+
        function MetaTables()
        {
                if (!$this->connection->IsConnected()) return array();
                return $this->connection->MetaTables();
        }
-       
+
        function MetaColumns($tab, $upper=true, $schema=false)
        {
                if (!$this->connection->IsConnected()) return array();
                return $this->connection->MetaColumns($this->TableName($tab), $upper, $schema);
        }
-       
+
        function MetaPrimaryKeys($tab,$owner=false,$intkey=false)
        {
                if (!$this->connection->IsConnected()) return array();
                return $this->connection->MetaPrimaryKeys($this->TableName($tab), $owner, $intkey);
        }
-       
+
        function MetaIndexes($table, $primary = false, $owner = false)
        {
                if (!$this->connection->IsConnected()) return array();
                return $this->connection->MetaIndexes($this->TableName($table), $primary, $owner);
        }
-       
+
        function MetaType($t,$len=-1,$fieldobj=false)
        {
                return ADORecordSet::MetaType($t,$len,$fieldobj);
        }
-       
+
        function NameQuote($name = NULL,$allowBrackets=false)
        {
                if (!is_string($name)) {
                        return FALSE;
                }
-               
+
                $name = trim($name);
-               
+
                if ( !is_object($this->connection) ) {
                        return $name;
                }
-               
+
                $quote = $this->connection->nameQuote;
-               
+
                // if name is of the form `name`, quote it
                if ( preg_match('/^`(.+)`$/', $name, $matches) ) {
                        return $quote . $matches[1] . $quote;
                }
-               
+
                // if name contains special characters, quote it
                $regex = ($allowBrackets) ? $this->nameRegexBrackets : $this->nameRegex;
-               
+
                if ( !preg_match('/^[' . $regex . ']+$/', $name) ) {
                        return $quote . $name . $quote;
                }
-               
+
                return $name;
        }
-       
+
        function TableName($name)
        {
                if ( $this->schema ) {
@@ -256,7 +256,7 @@ class ADODB_DataDict {
                }
                return $this->NameQuote($name);
        }
-       
+
        // Executes the sql array returned by GetTableSQL and GetIndexSQL
        function ExecuteSQLArray($sql, $continueOnError = true)
        {
@@ -264,7 +264,7 @@ class ADODB_DataDict {
                $conn = &$this->connection;
                $saved = $conn->debug;
                foreach($sql as $line) {
-                       
+
                        if ($this->debug) $conn->debug = true;
                        $ok = $conn->Execute($line);
                        $conn->debug = $saved;
@@ -276,43 +276,43 @@ class ADODB_DataDict {
                }
                return $rez;
        }
-       
+
        /*
                Returns the actual type given a character code.
-               
+
                C:  varchar
                X:  CLOB (character large object) or largest varchar size if CLOB is not supported
                C2: Multibyte varchar
                X2: Multibyte CLOB
-               
+
                B:  BLOB (binary large object)
-               
+
                D:  Date
-               T:  Date-time 
+               T:  Date-time
                L:  Integer field suitable for storing booleans (0 or 1)
                I:  Integer
                F:  Floating point number
                N:  Numeric or decimal number
        */
-       
+
        function ActualType($meta)
        {
                return $meta;
        }
-       
+
        function CreateDatabase($dbname,$options=false)
        {
                $options = $this->_Options($options);
                $sql = array();
-               
+
                $s = 'CREATE DATABASE ' . $this->NameQuote($dbname);
                if (isset($options[$this->upperName]))
                        $s .= ' '.$options[$this->upperName];
-               
+
                $sql[] = $s;
                return $sql;
        }
-       
+
        /*
         Generates the SQL to create index. Returns an array of sql strings.
        */
@@ -321,25 +321,25 @@ class ADODB_DataDict {
                if (!is_array($flds)) {
                        $flds = explode(',',$flds);
                }
-               
+
                foreach($flds as $key => $fld) {
                        # some indexes can use partial fields, eg. index first 32 chars of "name" with NAME(32)
                        $flds[$key] = $this->NameQuote($fld,$allowBrackets=true);
                }
-               
+
                return $this->_IndexSQL($this->NameQuote($idxname), $this->TableName($tabname), $flds, $this->_Options($idxoptions));
        }
-       
+
        function DropIndexSQL ($idxname, $tabname = NULL)
        {
                return array(sprintf($this->dropIndex, $this->NameQuote($idxname), $this->TableName($tabname)));
        }
-       
+
        function SetSchema($schema)
        {
                $this->schema = $schema;
        }
-       
+
        function AddColumnSQL($tabname, $flds)
        {
                $tabname = $this->TableName ($tabname);
@@ -351,7 +351,7 @@ class ADODB_DataDict {
                }
                return $sql;
        }
-       
+
        /**
         * Change the definition of one column
         *
@@ -374,7 +374,7 @@ class ADODB_DataDict {
                }
                return $sql;
        }
-       
+
        /**
         * Rename one column
         *
@@ -395,7 +395,7 @@ class ADODB_DataDict {
                }
                return array(sprintf($this->renameColumn,$tabname,$this->NameQuote($oldcolumn),$this->NameQuote($newcolumn),$column_def));
        }
-               
+
        /**
         * Drop one column
         *
@@ -418,36 +418,36 @@ class ADODB_DataDict {
                }
                return $sql;
        }
-       
+
        function DropTableSQL($tabname)
        {
                return array (sprintf($this->dropTable, $this->TableName($tabname)));
        }
-       
+
        function RenameTableSQL($tabname,$newname)
        {
                return array (sprintf($this->renameTable, $this->TableName($tabname),$this->TableName($newname)));
-       }       
-       
+       }
+
        /*
         Generate the SQL to create table. Returns an array of sql strings.
        */
        function CreateTableSQL($tabname, $flds, $tableoptions=false)
        {
                if (!$tableoptions) $tableoptions = array();
-               
+
                list($lines,$pkey) = $this->_GenFields($flds, true);
-               
+
                $taboptions = $this->_Options($tableoptions);
                $tabname = $this->TableName ($tabname);
                $sql = $this->_TableSQL($tabname,$lines,$pkey,$taboptions);
-               
+
                $tsql = $this->_Triggers($tabname,$taboptions);
                foreach($tsql as $s) $sql[] = $s;
-               
+
                return $sql;
        }
-       
+
        function _GenFields($flds,$widespacing=false)
        {
                if (is_string($flds)) {
@@ -461,7 +461,7 @@ class ADODB_DataDict {
                                foreach($f0 as $token) {
                                        switch (strtoupper($token)) {
                                        case 'CONSTRAINT':
-                                       case 'DEFAULT': 
+                                       case 'DEFAULT':
                                                $hasparam = $token;
                                                break;
                                        default:
@@ -472,7 +472,7 @@ class ADODB_DataDict {
                                        }
                                }
                                $flds[] = $f1;
-                               
+
                        }
                }
                $this->autoIncrement = false;
@@ -480,7 +480,7 @@ class ADODB_DataDict {
                $pkey = array();
                foreach($flds as $fld) {
                        $fld = _array_change_key_case($fld);
-               
+
                        $fname = false;
                        $fdefault = false;
                        $fautoinc = false;
@@ -494,20 +494,20 @@ class ADODB_DataDict {
                        $fconstraint = false;
                        $fnotnull = false;
                        $funsigned = false;
-                       
+
                        //-----------------
                        // Parse attributes
                        foreach($fld as $attr => $v) {
                                if ($attr == 2 && is_numeric($v)) $attr = 'SIZE';
                                else if (is_numeric($attr) && $attr > 1 && !is_numeric($v)) $attr = strtoupper($v);
-                               
+
                                switch($attr) {
                                case '0':
                                case 'NAME':    $fname = $v; break;
                                case '1':
                                case 'TYPE':    $ty = $v; $ftype = $this->ActualType(strtoupper($v)); break;
-                               
-                               case 'SIZE':    
+
+                               case 'SIZE':
                                                                $dotat = strpos($v,'.'); if ($dotat === false) $dotat = strpos($v,',');
                                                                if ($dotat === false) $fsize = $v;
                                                                else {
@@ -529,33 +529,33 @@ class ADODB_DataDict {
                                case 'CONSTRAINT': $fconstraint = $v; break;
                                } //switch
                        } // foreach $fld
-                       
+
                        //--------------------
                        // VALIDATE FIELD INFO
                        if (!strlen($fname)) {
                                if ($this->debug) ADOConnection::outp("Undefined NAME");
                                return false;
                        }
-                       
+
                        $fid = strtoupper(preg_replace('/^`(.+)`$/', '$1', $fname));
                        $fname = $this->NameQuote($fname);
-                       
+
                        if (!strlen($ftype)) {
                                if ($this->debug) ADOConnection::outp("Undefined TYPE for field '$fname'");
                                return false;
                        } else {
                                $ftype = strtoupper($ftype);
                        }
-                       
+
                        $ftype = $this->_GetSize($ftype, $ty, $fsize, $fprec);
-                       
+
                        if ($ty == 'X' || $ty == 'X2' || $ty == 'B') $fnotnull = false; // some blob types do not accept nulls
-                       
+
                        if ($fprimary) $pkey[] = $fname;
-                       
+
                        // some databases do not allow blobs to have defaults
                        if ($ty == 'X') $fdefault = false;
-                       
+
                        //--------------------
                        // CONSTRUCT FIELD SQL
                        if ($fdefts) {
@@ -571,20 +571,20 @@ class ADODB_DataDict {
                                        $fdefault = $this->connection->sysDate;
                                }
                        } else if ($fdefault !== false && !$fnoquote)
-                               if ($ty == 'C' or $ty == 'X' or 
+                               if ($ty == 'C' or $ty == 'X' or
                                        ( substr($fdefault,0,1) != "'" && !is_numeric($fdefault)))
-                                       if (strlen($fdefault) != 1 && substr($fdefault,0,1) == ' ' && substr($fdefault,strlen($fdefault)-1) == ' ') 
+                                       if (strlen($fdefault) != 1 && substr($fdefault,0,1) == ' ' && substr($fdefault,strlen($fdefault)-1) == ' ')
                                                $fdefault = trim($fdefault);
                                        else if (strtolower($fdefault) != 'null')
                                                $fdefault = $this->connection->qstr($fdefault);
                        $suffix = $this->_CreateSuffix($fname,$ftype,$fnotnull,$fdefault,$fautoinc,$fconstraint,$funsigned);
-                       
+
                        if ($widespacing) $fname = str_pad($fname,24);
                        $lines[$fid] = $fname.' '.$ftype.$suffix;
-                       
+
                        if ($fautoinc) $this->autoIncrement = true;
                } // foreach $flds
-               
+
                return array($lines,$pkey);
        }
        /*
@@ -601,56 +601,56 @@ class ADODB_DataDict {
                }
                return $ftype;
        }
-       
-       
+
+
        // return string must begin with space
        function _CreateSuffix($fname,$ftype,$fnotnull,$fdefault,$fautoinc,$fconstraint)
-       {       
+       {
                $suffix = '';
                if (strlen($fdefault)) $suffix .= " DEFAULT $fdefault";
                if ($fnotnull) $suffix .= ' NOT NULL';
                if ($fconstraint) $suffix .= ' '.$fconstraint;
                return $suffix;
        }
-       
+
        function _IndexSQL($idxname, $tabname, $flds, $idxoptions)
        {
                $sql = array();
-               
+
                if ( isset($idxoptions['REPLACE']) || isset($idxoptions['DROP']) ) {
                        $sql[] = sprintf ($this->dropIndex, $idxname);
                        if ( isset($idxoptions['DROP']) )
                                return $sql;
                }
-               
+
                if ( empty ($flds) ) {
                        return $sql;
                }
-               
+
                $unique = isset($idxoptions['UNIQUE']) ? ' UNIQUE' : '';
-       
+
                $s = 'CREATE' . $unique . ' INDEX ' . $idxname . ' ON ' . $tabname . ' ';
-               
+
                if ( isset($idxoptions[$this->upperName]) )
                        $s .= $idxoptions[$this->upperName];
-               
+
                if ( is_array($flds) )
                        $flds = implode(', ',$flds);
                $s .= '(' . $flds . ')';
                $sql[] = $s;
-               
+
                return $sql;
        }
-       
+
        function _DropAutoIncrement($tabname)
        {
                return false;
        }
-       
+
        function _TableSQL($tabname,$lines,$pkey,$tableoptions)
        {
                $sql = array();
-               
+
                if (isset($tableoptions['REPLACE']) || isset ($tableoptions['DROP'])) {
                        $sql[] = sprintf($this->dropTable,$tabname);
                        if ($this->autoIncrement) {
@@ -667,19 +667,19 @@ class ADODB_DataDict {
                        $s .= ",\n                 PRIMARY KEY (";
                        $s .= implode(", ",$pkey).")";
                }
-               if (isset($tableoptions['CONSTRAINTS'])) 
+               if (isset($tableoptions['CONSTRAINTS']))
                        $s .= "\n".$tableoptions['CONSTRAINTS'];
-               
-               if (isset($tableoptions[$this->upperName.'_CONSTRAINTS'])) 
+
+               if (isset($tableoptions[$this->upperName.'_CONSTRAINTS']))
                        $s .= "\n".$tableoptions[$this->upperName.'_CONSTRAINTS'];
-               
+
                $s .= "\n)";
                if (isset($tableoptions[$this->upperName])) $s .= $tableoptions[$this->upperName];
                $sql[] = $s;
-               
+
                return $sql;
        }
-       
+
        /*
                GENERATE TRIGGERS IF NEEDED
                used when table has auto-incrementing field that is emulated using triggers
@@ -688,7 +688,7 @@ class ADODB_DataDict {
        {
                return array();
        }
-       
+
        /*
                Sanitize options, so that array elements with no keys are promoted to keys
        */
@@ -702,34 +702,34 @@ class ADODB_DataDict {
                }
                return $newopts;
        }
-       
+
        /*
        "Florian Buzin [ easywe ]" <florian.buzin#easywe.de>
-       
+
        This function changes/adds new fields to your table. You don't
        have to know if the col is new or not. It will check on its own.
        */
        function ChangeTableSQL($tablename, $flds, $tableoptions = false)
        {
        global $ADODB_FETCH_MODE;
-       
+
                $save = $ADODB_FETCH_MODE;
                $ADODB_FETCH_MODE = ADODB_FETCH_ASSOC;
                if ($this->connection->fetchMode !== false) $savem = $this->connection->SetFetchMode(false);
-               
+
                // check table exists
                $save_handler = $this->connection->raiseErrorFn;
                $this->connection->raiseErrorFn = '';
                $cols = $this->MetaColumns($tablename);
                $this->connection->raiseErrorFn = $save_handler;
-               
+
                if (isset($savem)) $this->connection->SetFetchMode($savem);
                $ADODB_FETCH_MODE = $save;
-               
-               if ( empty($cols)) { 
+
+               if ( empty($cols)) {
                        return $this->CreateTableSQL($tablename, $flds, $tableoptions);
                }
-               
+
                if (is_array($flds)) {
                // Cycle through the update fields, comparing
                // existing fields to fields to update.
@@ -753,11 +753,11 @@ class ADODB_DataDict {
                                        }
                                } else {
                                        $holdflds[$k] = $v;
-                               }               
+                               }
                        }
                        $flds = $holdflds;
                }
-       
+
 
                // already exists, alter table instead
                list($lines,$pkey) = $this->_GenFields($flds);
@@ -766,18 +766,18 @@ class ADODB_DataDict {
 
                foreach ( $lines as $id => $v ) {
                        if ( isset($cols[$id]) && is_object($cols[$id]) ) {
-                       
+
                                $flds = Lens_ParseArgs($v,',');
-                               
+
                                //  We are trying to change the size of the field, if not allowed, simply ignore the request.
-                               if ($flds && in_array(strtoupper(substr($flds[0][1],0,4)),$this->invalidResizeTypes4)) continue;         
-                       
+                               if ($flds && in_array(strtoupper(substr($flds[0][1],0,4)),$this->invalidResizeTypes4)) continue;
+
                                $sql[] = $alter . $this->alterCol . ' ' . $v;
                        } else {
                                $sql[] = $alter . $this->addCol . ' ' . $v;
                        }
                }
-               
+
                return $sql;
        }
 } // class
index b866008..74d028f 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /** 
- * @version V4.81 3 May 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
+ * @version V4.90 8 June 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
  * Released under both BSD license and Lesser GPL library license. 
  * Whenever there is any discrepancy between the two licenses, 
  * the BSD license will take precedence. 
index c3bebb9..60e140f 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * @version V4.81 3 May 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
+ * @version V4.90 8 June 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
  * Released under both BSD license and Lesser GPL library license.
  * Whenever there is any discrepancy between the two licenses,
  * the BSD license will take precedence.
index e1eb49a..2c6c4ca 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /** 
- * @version V4.81 3 May 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
+ * @version V4.90 8 June 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
  * Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence. 
index 3f24126..b53d00c 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 
 /**
- * @version V4.81 3 May 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
+ * @version V4.90 8 June 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
  * Released under both BSD license and Lesser GPL library license.
  * Whenever there is any discrepancy between the two licenses,
  * the BSD license will take precedence.
index 91578b9..d90cf98 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 
 /*
-  V4.81 3 May 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
+  V4.90 8 June 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence.
index e67faf3..db3606f 100644 (file)
@@ -7,7 +7,7 @@ global $ADODB_INCLUDED_LIB;
 $ADODB_INCLUDED_LIB = 1;
 
 /* 
- @version V4.81 3 May 2006 (c) 2000-2006 John Lim (jlim\@natsoft.com.my). All rights reserved.
+ @version V4.90 8 June 2006 (c) 2000-2006 John Lim (jlim\@natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence. See License.txt. 
@@ -325,6 +325,8 @@ function _adodb_getcount(&$zthis, $sql,$inputarr=false,$secs2cache=0)
                $rewritesql = preg_replace(
                                        '/^\s*SELECT\s.*\s+FROM\s/Uis','SELECT COUNT(*) FROM ',$sql);
 
+               
+               
                // fix by alexander zhukov, alex#unipack.ru, because count(*) and 'order by' fails 
                // with mssql, access and postgresql. Also a good speedup optimization - skips sorting!
                // also see http://phplens.com/lens/lensforum/msgs.php?id=12752
@@ -332,10 +334,13 @@ function _adodb_getcount(&$zthis, $sql,$inputarr=false,$secs2cache=0)
                        $rewritesql = preg_replace('/(\sORDER\s+BY\s.*)/is','',$rewritesql);
                else
                        $rewritesql = preg_replace('/(\sORDER\s+BY\s[^)]*)/is','',$rewritesql);
-                
        }
        
+       
+       
        if (isset($rewritesql) && $rewritesql != $sql) {
+               if (preg_match('/\sLIMIT\s+[0-9]+/i',$sql,$limitarr)) $rewritesql .= $limitarr[1];
+                
                if ($secs2cache) {
                        // we only use half the time of secs2cache because the count can quickly
                        // become inaccurate if new records are added
@@ -354,6 +359,8 @@ function _adodb_getcount(&$zthis, $sql,$inputarr=false,$secs2cache=0)
        if (preg_match('/\s*UNION\s*/is', $sql)) $rewritesql = $sql;
        else $rewritesql = preg_replace('/(\sORDER\s+BY\s.*)/is','',$sql); 
        
+       if (preg_match('/\sLIMIT\s+[0-9]+/i',$sql,$limitarr)) $rewritesql .= $limitarr[0];
+               
        $rstest = &$zthis->Execute($rewritesql,$inputarr);
        if (!$rstest) $rstest = $zthis->Execute($sql,$inputarr);
        
@@ -1017,5 +1024,47 @@ function _adodb_backtrace($printOrArr=true,$levels=9999,$skippy=0)
        
        return $s;
 }
+/*
+function _adodb_find_from($sql) 
+{
+
+       $sql = str_replace(array("\n","\r"), ' ', $sql);
+       $charCount = strlen($sql);
+       
+       $inString = false;
+       $quote = '';
+       $parentheseCount = 0;
+       $prevChars = '';
+       $nextChars = '';
+       
+
+       for($i = 0; $i < $charCount; $i++) {
+
+       $char = substr($sql,$i,1);
+           $prevChars = substr($sql,0,$i);
+       $nextChars = substr($sql,$i+1);
+
+               if((($char == "'" || $char == '"' || $char == '`') && substr($prevChars,-1,1) != '\\') && $inString === false) {
+                       $quote = $char;
+                       $inString = true;
+               }
+
+               elseif((($char == "'" || $char == '"' || $char == '`') && substr($prevChars,-1,1) != '\\') && $inString === true && $quote == $char) {
+                       $quote = "";
+                       $inString = false;
+               }
+
+               elseif($char == "(" && $inString === false)
+                       $parentheseCount++;
+
+               elseif($char == ")" && $inString === false && $parentheseCount > 0)
+                       $parentheseCount--;
+
+               elseif($parentheseCount <= 0 && $inString === false && $char == " " && strtoupper(substr($prevChars,-5,5)) == " FROM")
+                       return $i;
+
+       }
+}
+*/
 
 ?>
\ No newline at end of file
index aa87f90..270c3d8 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 
 /*
-       V4.81 3 May 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
+       V4.90 8 June 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
          Released under both BSD license and Lesser GPL library license. 
          Whenever there is any discrepancy between the two licenses, 
          the BSD license will take precedence. 
index 3fcdde9..2d36d68 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /** 
- * @version V4.81 3 May 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
+ * @version V4.90 8 June 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
  * Released under both BSD license and Lesser GPL library license. 
  * Whenever there is any discrepancy between the two licenses, 
  * the BSD license will take precedence. 
index 42d2f89..7323788 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /* 
-V4.81 3 May 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
+V4.90 8 June 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence. See License.txt. 
index d595b18..28e1c8f 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 
 /*
-  V4.81 3 May 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
+  V4.90 8 June 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence.
index 89aab68..55e7ee7 100644 (file)
@@ -14,7 +14,7 @@
 /**
        \mainpage       
        
-        @version V4.81 3 May 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
+        @version V4.90 8 June 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
 
        Released under both BSD license and Lesser GPL library license. You can choose which license
        you prefer.
                /**
                 * ADODB version as a string.
                 */
-               $ADODB_vers = 'V4.81 3 May 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved. Released BSD & LGPL.';
+               $ADODB_vers = 'V4.90 8 June 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved. Released BSD & LGPL.';
        
                /**
                 * Determines whether recordset->RecordCount() is used. 
        var $_evalAll = false;
        var $_affected = false;
        var $_logsql = false;
+       var $_transmode = ''; // transaction mode
        
        /**
         * Constructor
                                                        $sql .= str_replace(',','.',$v); // locales fix so 1.1 does not get converted to 1,1
                                                else if ($typ == 'boolean')
                                                        $sql .= $v ? $this->true : $this->false;
-                                               else if ($v === null)
+                                               else if ($typ == 'object') {
+                                                       if (method_exists($v, '__toString')) $sql .= $this->qstr($v->__toString());
+                                                       else $sql .= $this->qstr((string) $v);
+                                               } else if ($v === null)
                                                        $sql .= 'NULL';
                                                else
                                                        $sql .= $v;
         */
        function& AutoExecute($table, $fields_values, $mode = 'INSERT', $where = FALSE, $forceUpdate=true, $magicq=false) 
        {
+               $false = false;
                $sql = 'SELECT * FROM '.$table;  
                if ($where!==FALSE) $sql .= ' WHERE '.$where;
                else if ($mode == 'UPDATE' || $mode == 2 /* DB_AUTOQUERY_UPDATE */) {
                        ADOConnection::outp('AutoExecute: Illegal mode=UPDATE with empty WHERE clause');
-                       return false;
+                       return $false;
                }
 
                $rs =& $this->SelectLimit($sql,1);
-               if (!$rs) return false; // table does not exist
+               if (!$rs) return $false; // table does not exist
                $rs->tableName = $table;
                
                switch((string) $mode) {
                        break;
                default:
                        ADOConnection::outp("AutoExecute: Unknown mode=$mode");
-                       return false;
+                       return $false;
                }
                $ret = false;
                if ($sql) $ret = $this->Execute($sql);
         */
        function BeginTrans() {return false;}
        
+       /* set transaction mode */
+       function SetTransactionMode( $transaction_mode ) 
+       {
+               $transaction_mode = $this->MetaTransaction($transaction_mode, $this->dataProvider);
+               $this->_transmode  = $transaction_mode;
+       }
+/*
+http://msdn2.microsoft.com/en-US/ms173763.aspx
+http://dev.mysql.com/doc/refman/5.0/en/innodb-transaction-isolation.html
+http://www.postgresql.org/docs/8.1/interactive/sql-set-transaction.html
+http://www.stanford.edu/dept/itss/docs/oracle/10g/server.101/b10759/statements_10005.htm
+*/
+       function MetaTransaction($mode,$db)
+       {
+               $mode = strtoupper($mode);
+               $mode = str_replace('ISOLATION LEVEL ','',$mode);
+               
+               switch($mode) {
+
+               case 'READ UNCOMMITTED':
+                       switch($db) { 
+                       case 'oci8':
+                       case 'oracle':
+                               return 'ISOLATION LEVEL READ COMMITTED';
+                       default:
+                               return 'ISOLATION LEVEL READ UNCOMMITTED';
+                       }
+                       break;
+                                       
+               case 'READ COMMITTED':
+                               return 'ISOLATION LEVEL READ COMMITTED';
+                       break;
+                       
+               case 'REPEATABLE READ':
+                       switch($db) {
+                       case 'oci8':
+                       case 'oracle':
+                               return 'ISOLATION LEVEL SERIALIZABLE';
+                       default:
+                               return 'ISOLATION LEVEL REPEATABLE READ';
+                       }
+                       break;
+                       
+               case 'SERIALIZABLE':
+                               return 'ISOLATION LEVEL SERIALIZABLE';
+                       break;
+                       
+               default:
+                       return $mode;
+               }
+       }
        
        /**
         * If database does not support transactions, always return true as data always commited
         *
         * @return  array of column names for current table.
         */ 
-       function &MetaColumnNames($table, $numIndexes=false) 
+       function &MetaColumnNames($table, $numIndexes=false,$useattnum=false /* only for postgres */
        {
                $objarr =& $this->MetaColumns($table);
                if (!is_array($objarr)) {
                $arr = array();
                if ($numIndexes) {
                        $i = 0;
-                       foreach($objarr as $v) $arr[$i++] = $v->name;
+                       if ($useattnum) {
+                               foreach($objarr as $v) 
+                                       $arr[$v->attnum] = $v->name;
+                               
+                       } else
+                               foreach($objarr as $v) $arr[$i++] = $v->name;
                } else
                        foreach($objarr as $v) $arr[strtoupper($v->name)] = $v->name;
                
                return adodb_date($this->fmtDate,$d);
        }
        
+       function BindDate($d)
+       {
+               $d = $this->DBDate($d);
+               if (strncmp($d,"'",1)) return $d;
+               
+               return substr($d,1,strlen($d)-2);
+       }
+       
+       function BindTimeStamp($d)
+       {
+               $d = $this->DBTimeStamp($d);
+               if (strncmp($d,"'",1)) return $d;
+               
+               return substr($d,1,strlen($d)-2);
+       }
+       
        
        /**
         * Converts a timestamp "ts" to a string that the database can understand.
                'BPCHAR' => 'C',
                'CHARACTER' => 'C',
                'INTERVAL' => 'C',  # Postgres
+               'MACADDR' => 'C', # postgres
                ##
                'LONGCHAR' => 'X',
                'TEXT' => 'X',
                'DATETIME' => 'T',
                'TIMESTAMPTZ' => 'T',
                'T' => 'T',
+               'TIMESTAMP WITHOUT TIME ZONE' => 'T', // postgresql
                ##
                'BOOL' => 'L',
                'BOOLEAN' => 'L', 
index 3bac62d..25d6398 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 
 /**
-  V4.81 3 May 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
+  V4.90 8 June 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence.
index 3f24449..38f2a1e 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 
 /**
-  V4.81 3 May 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
+  V4.90 8 June 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence.
index efadf89..dff2a24 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 
 /**
-  V4.81 3 May 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
+  V4.90 8 June 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence.
index d4dbd3e..3343806 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 
 /**
-  V4.81 3 May 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
+  V4.90 8 June 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence.
index 952f765..6c2e8e7 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 
 /**
-  V4.81 3 May 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
+  V4.90 8 June 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence.
index 45aeb88..67a4b33 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 
 /**
-  V4.81 3 May 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
+  V4.90 8 June 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence.
index 2ab112a..9be5f80 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 
 /**
-  V4.81 3 May 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
+  V4.90 8 June 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence.
index 6de9344..7fb82a8 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 
 /**
-  V4.81 3 May 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
+  V4.90 8 June 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence.
index 787d97e..f253195 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 
 /**
-  V4.81 3 May 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
+  V4.90 8 June 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence.
@@ -251,8 +251,8 @@ end;
                }
                
                if ( is_array($flds) )
-                       $flds = implode($this->quote.', '.$this->quote,$flds);
-               $s = 'CREATE' . $unique . ' INDEX ' .$this->quote. $idxname .$this->quote. ' ON ' . $this->quote.$tabname . $this->quote.' (' .$this->quote. $flds .$this->quote. ')';
+                       $flds = implode('", "',$flds);
+               $s = 'CREATE' . $unique . ' INDEX "' . $idxname . '" ON "' .$tabname . '" ("' . $flds . '")';
                
                if ( isset($idxoptions[$this->upperName]) )
                        $s .= $idxoptions[$this->upperName];
index fd5e047..89afb2b 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 
 /**
-  V4.81 3 May 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
+  V4.90 8 June 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence.
index a36de3b..61147f1 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 
 /**
-  V4.81 3 May 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
+  V4.90 8 June 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence.
index c682039..61eca0a 100644 (file)
@@ -159,11 +159,24 @@ The code snippet above will change the favorite color to red, and then UPDATE th
 <a name=additional>
 <h2>ADOdb Specific Functionality</h2>
 <h3><li>Setting the Table Name</h3>
-<p>The default behaviour on creating an ADOdb_Active_Record is to "pluralize" the class name and use that as the table name. Often, this is not the case. For example, the Person class could be reading from the "People" table. We provide a constructor parameter to override the default table naming behaviour.
+<p>The default behaviour on creating an ADOdb_Active_Record is to "pluralize" the class name and
+ use that as the table name. Often, this is not the case. For example, the Person class could be reading 
+ from the "People" table. 
+<p>We provide two ways to define your own table:
+<p>1. Use a constructor parameter to override the default table naming behaviour.
 <pre>
        class Person extends ADOdb_Active_Record{}
        $person = new Person('People');
 </pre>
+<p>2. Define it in a class declaration:
+<pre>
+       class Person extends ADOdb_Active_Record
+       {
+       var $_table = 'People';
+       }
+       $person = new Person();
+</pre>
+
 <h3><li>$ADODB_ASSOC_CASE</h3>
 <p>This allows you to control the case of field names and properties. For example, all field names in Oracle are upper-case by default. So you 
 can force field names to be lowercase using $ADODB_ASSOC_CASE. Legal values are as follows:
@@ -184,13 +197,13 @@ $person2->NAME = 'Lily';
 
 <p>Also see <a href=http://phplens.com/adodb/reference.constants.adodb_assoc_case.html>$ADODB_ASSOC_CASE</a>.
 
-<h3><li>ADOdb_Active_Record::Save</h3>
+<h3><li>ADOdb_Active_Record::Save()</h3>
 <p>
 Saves a record by executing an INSERT or UPDATE SQL statement as appropriate. 
 <p>Returns false on  unsuccessful INSERT, true if successsful INSERT.
 <p>Returns 0 on failed UPDATE, and 1 on UPDATE if data has changed, and -1 if no data was changed, so no UPDATE statement was executed.
 
-<h3><li>ADOdb_Active_Record::Replace</h3>
+<h3><li>ADOdb_Active_Record::Replace()</h3>
 <p>
 ADOdb supports replace functionality, whereby the record is inserted if it does not exists, or updated otherwise.
 <pre>
@@ -201,7 +214,7 @@ $ok = $rec->replace(); // 0=failure, 1=update, 2=insert
 </pre>
 
 
-<h3><li>ADOdb_Active_Record::Load()</h3>
+<h3><li>ADOdb_Active_Record::Load($where)</h3>
 <p>Sometimes, we want to load a single record into an Active Record. We can do so using:
 <pre>
 $person->load("id=3");
@@ -212,6 +225,17 @@ $person->load("id=?", array(3));
 </pre>
 <p>Returns false if an error occurs.
 
+<h3><li>ADOdb_Active_Record::Find($whereOrderBy, $bindarr=false, $pkeyArr=false)</h3>
+<p>We want to retrieve an array of active records based on some search criteria. For example:
+<pre>
+class Person extends ADOdb_Active_Record {
+var $_table = 'people';
+}
+
+$person = new Person();
+peopleArray =& $person->Find("name like ? order by age", array('Sm%'));
+</pre>
+
 <h3><li>Error Handling and Debugging</h3>
 <p>
 In PHP5, if adodb-exceptions.inc.php is included, then errors are thrown. Otherwise errors are handled by returning a value. False by default means an error has occurred. You can get the last error message using the ErrorMsg() function. 
@@ -473,6 +497,9 @@ echo "&lt;p>Name first (should be John): ",$person->name_first, "&lt;br>Class =
  <p>PHP5 specific: Change PHP5 implementation of Active Record to use __get() and __set() for better performance.
 
 <h3> Change Log</h3>
+<p>0.04 5 June 2006 <br>
+<p>Added support for declaring table name in $_table in class declaration. Thx Bill Dueber for idea.
+<p>Added find($where,$bindarr=false) method to retrieve an array of active record objects.
 <p>0.03 <br>
 - Now we only update fields that have changed, using $this->_original.<br>
 - We do not include auto_increment fields in replace(). Thx Travis Cline<br>
index 2402223..96a15cf 100644 (file)
@@ -15,7 +15,7 @@ pre {
 <body bgcolor="#ffffff" text="black">
 
 <h2>ADOdb Library for PHP</h2>
-<p>V4.81 3 May 2006 (c) 2000-2006 John Lim (jlim#natsoft.com)</p>
+<p>V4.90 8 June 2006 (c) 2000-2006 John Lim (jlim#natsoft.com)</p>
 <p><font size="1">This software is dual licensed using BSD-Style and LGPL. This 
   means you can use it in compiled proprietary and commercial products.</font></p>
   
@@ -81,6 +81,7 @@ pre {
   <a href="#concat">Concat</a> <a href="#ifnull">IfNull</a> <a href="#length">length</a> <a href="#random">random</a> <a href="#substr">substr</a> 
   <a href="#qstr">qstr</a> <a href="#param">Param</a>  <a href="#OffsetDate">OffsetDate</a> <a href="#SQLDate">SQLDate</a> 
   <a href="#dbdate">DBDate</a>  <a href="#dbtimestamp">DBTimeStamp</a>
+  <a href="#binddate">BindDate</a>  <a href="#bindtimestamp">BindTimeStamp</a>
   <br>
   Blobs: <a href="#updateblob">UpdateBlob</a> <a href="#updateclob">UpdateClob</a> 
   <a href="#updateblobfile">UpdateBlobFile</a> <a href="#blobencode">BlobEncode</a> 
@@ -90,10 +91,11 @@ pre {
   Transactions: <a href="#starttrans">StartTrans</a> <a href="#completetrans">CompleteTrans</a> 
   <a href="#failtrans">FailTrans</a> <a href="#hasfailedtrans">HasFailedTrans</a> 
   <a href="#begintrans">BeginTrans</a> <a href="#committrans">CommitTrans</a> 
-  <a href="#rollbacktrans">RollbackTrans</a> <br>
+  <a href="#rollbacktrans">RollbackTrans</a> <a href=#SetTransactionMode>SetTransactionMode</a><br>
   Fetching Data: </font> <font size="2"><a href="#setfetchmode">SetFetchMode</a><br>
   Strings: <a href="#concat">concat</a> <a href="#length">length</a>  <a href="#qstr">qstr</a> <a href="#quote">quote</a> <a href="#substr">substr</a><br>
   Dates: <a href="#dbdate">DBDate</a> <a href="#dbtimestamp">DBTimeStamp</a> <a href="#unixdate">UnixDate</a> 
+  <a href="#binddate">BindDate</a>  <a href="#bindtimestamp">BindTimeStamp</a>
   <a href="#unixtimestamp">UnixTimeStamp</a> <a href="#OffsetDate">OffsetDate</a> 
   <a href="#SQLDate">SQLDate</a> <br>
   Row Management: <a href="#affected_rows">Affected_Rows</a> <a href="#inserted_id">Insert_ID</a>  <a href="#rowlock">RowLock</a>
@@ -126,7 +128,7 @@ pre {
   Menu generation:<a href="#getmenu">GetMenu</a> <a href="#getmenu2">GetMenu2</a><br>
   Dates:<a href="#userdate">UserDate</a> <a href="#usertimestamp">UserTimeStamp</a> 
   <a href="#unixdate">UnixDate</a> <a href="#unixtimestamp">UnixTimeStamp<br>
-  </a>Recordset Info:<a href="#recordcount">RecordCount</a> <a href="#po_recordcount">PO_RecordSet</a> 
+  </a>Recordset Info:<a href="#recordcount">RecordCount</a> <a href="#po_recordcount">PO_RecordCount</a> 
   <a href="#nextrecordset">NextRecordSet</a><br>
   Field Info:<a href="#fieldcount">FieldCount</a> <a href="#fetchfield">FetchField</a> 
   <a href="#metatype">MetaType</a><br>
@@ -2026,8 +2028,36 @@ useful if you are calling black-box functions in which SQL queries might be exec
 <p><font>End a transaction, rollback all changes. Returns true if successful. If the 
   database does not support transactions, will return false as data is never rollbacked. 
 </font></p>
-<font> 
-</font><p><font><b>GetAssoc<a name="getassoc1"></a>($sql,$inputarr=false,$force_array=false,$first2cols=false)</b></font></p>
+<p><font><b>SetTransactionMode<a name="SetTransactionMode"></a>($mode )</b></font></p>
+<p>SetTransactionMode allows you to pass in the transaction mode to use for all subsequent transactions. 
+Note: if you have persistent connections and using mssql or mysql, you might have to explicitly reset your transaction mode at the beginning of each page request. 
+This is only supported in postgresql, mssql, mysql with InnoDB and oci8 currently. For example:
+<pre>
+$db->SetTransactionMode("SERIALIZABLE");
+$db->BeginTrans();
+$db->Execute(...); $db->Execute(...);
+$db->CommiTrans();
+
+$db->SetTransactionMode(""); // restore to default
+$db->StartTrans();
+$db->Execute(...); $db->Execute(...);
+$db->CompleteTrans();
+</pre>
+
+<p>Supported values to pass in:
+<ul>
+<li>READ UNCOMMITTED (allows dirty reads, but fastest)
+<li>READ COMMITTED (default postgres, mssql and oci8)
+<li>REPEATABLE READ (default mysql)
+<li>SERIALIZABLE (slowest and most restrictive)
+</ul>
+<p>You can also pass in database specific values such as 'SNAPSHOT' for mssql or 'READ ONLY' for oci8/postgres.
+<p>See transaction levels for <a href=http://www.postgresql.org/docs/8.1/interactive/sql-set-transaction.html>PostgreSQL</a>,
+<a href=http://www.stanford.edu/dept/itss/docs/oracle/10g/server.101/b10759/statements_10005.htm>Oracle</a>,
+<a href=http://dev.mysql.com/doc/refman/5.0/en/set-transaction.html>MySQL</a>, and
+<a href=http://msdn2.microsoft.com/en-US/ms173763.aspx>MS SQL Server</a>.
+<p><font><b>GetAssoc<a name="getassoc1"></a>($sql,$inputarr=false,$force_array=false,$first2cols=false)</b></font></p>
 <p><font>Returns an associative array for the given query $sql with optional bind parameters 
   in $inputarr. If the number of columns returned is greater to two, a 2-dimensional 
   array is returned, with the first column of the recordset becomes the keys 
@@ -2356,12 +2386,38 @@ function CountCachedExecs($db, $secs2cache, $sql, $inputarray)
   Y-m-d. Uses the fmtDate field, which holds the format to use. If null or false 
   or '' is passed in, it will be converted to an SQL null.</font></p>
 <p><font>Returns the date as a quoted string.</font></p>
+<pre>
+       $sql = "select * from atable where created > ".$db->DBDate("$year-$month-$day");
+       $db->Execute($sql);
+</pre>
+<p><font><b>BindDate<a name="binddate"></a>($date)</b></font></p>
+<p><font>Format the $<b>date</b> in the bind format the database accepts. Normally
+ this means that the date string is not quoted, unlike DBDate, which quotes the string.
+<pre>
+       $sql = "select * from atable where created > ".$db->Param('0');
+       // or
+       $sql = "select * from atable where created > ?";
+       $db->Execute($sql,array($db->BindDate("$year-$month-$day"));
+</pre>
 <p><font><b>DBTimeStamp<a name="dbtimestamp"></a>($ts)</b></font></p>
 <p><font>Format the timestamp $<b>ts</b> in the format the database accepts; this can 
   be a Unix integer timestamp or an ISO format Y-m-d H:i:s. Uses the fmtTimeStamp 
   field, which holds the format to use. If null or false or '' is passed in, it 
   will be converted to an SQL null.</font></p>
 <p><font>Returns the timestamp as a quoted string.</font></p>
+<pre>
+       $sql = "select * from atable where created > ".$db->DBTimeStamp("$year-$month-$day $hr:$min:$secs");
+       $db->Execute($sql);
+</pre>
+<p><font><b>BindTimeStamp<a name="bindtimestamp"></a>($ts)</b></font></p>
+<p><font>Format the timestamp $<b>ts</b> in the bind format the database accepts. Normally
+ this means that the timestamp string is not quoted, unlike DBTimeStamp, which quotes the string.
+<pre>
+       $sql = "select * from atable where created > ".$db->Param('0');
+       // or
+       $sql = "select * from atable where created > ?";
+       $db->Execute($sql,array($db->BindTimeStamp("$year-$month-$day $hr:$min:$secs"));
+</pre>
 <p><font><b>qstr<a name="qstr"></a>($s,[$magic_quotes_enabled</b>=false]<b>)</b></font></p>
 <p><font>Quotes a string to be sent to the database. The $<b>magic_quotes_enabled</b> 
   parameter may look funny, but the idea is if you are quoting a string extracted 
@@ -2844,8 +2900,26 @@ of MySQL.</font></p>
   PHP</a>. </font></p>
 
 <h2><font>Change Log<a name="Changes"></a><a name="changes"></a><a name="changelog"></a></font></h2>
-<P>
-<p><a name="4.81"></a><b>4.81 ? 2006</b>
+<p><a name="4.90"></a><b>4.90 8 June 2006</b>
+<p>Changed adodb_countrec() in adodb-lib.inc.php to allow LIMIT to be used as a speedup to reduce no of records counted.
+<p>Added support for transaction modes for postgres and oci8 with SetTransactionMode(). 
+These transaction modes affect all subsequent transactions of that connection.
+<p>Thanks to Halmai Csongor for suggestion.
+<p>Removed $off = $fieldOffset - 1 line in db2 driver, FetchField(). Tx Larry Menard.
+<p>Added support for PHP5 objects as Execute() bind parameters using __toString (eg. Simple-XML). Thx Carl-Christian Salvesen.
+<p>Rounding in tohtml.inc.php did not work properly. Fixed.
+<p>MetaIndexes in postgres fails when fields are deleted then added in again because the attnum has gaps in it. 
+See http://sourceforge.net/tracker/index.php?func=detail&aid=1451245&group_id=42718&atid=433976. Fixed.
+<p>MetaForeignkeys in mysql and mysqli did not work when fetchMode==ADODB_FETCH_ASSOC used. Fixed.
+<p>Reference error in AutoExecute() fixed.
+<p>Added macaddr postgres type to MetaType. Maps to 'C'.
+<p>Added to _connect() in adodb-ado5.inc.php support for $database and $dataProvider parameters.  Thx Larry Menard.
+<p>Added support for sequences in adodb-ado_mssql.inc.php. Thx Larry Menard.
+<p>Added ADODB_SESSION_READONLY.
+<p>Added session expiryref support to crc32 mode, and in LOB code.
+<p>Clear _errorMsg in postgres7 driver, so that ErrorMsg() displays properly when no error occurs.
+<p>Added BindDate and BindTimeStamp
+<p><a name="4.81"></a><b>4.81 3 May 2006</b>
 <p>Fixed variable ref errors in adodb-ado5.inc.php in _query().
 <p>Mysqli setcharset fix using method_exists().
 <p>The adodb-perf.inc.php CreateLogTable() code now works for user-defined table names.
index 34da7b4..d3eb595 100644 (file)
@@ -20,7 +20,7 @@
 </head>
 <body style="background-color: rgb(255, 255, 255);">
 <h2>ADOdb Data Dictionary Library for PHP</h2>
-<p>V4.81 3 May 2006 (c) 2000-2006 John Lim (<a
+<p>V4.90 8 June 2006 (c) 2000-2006 John Lim (<a
  href="mailto:jlim#natsoft.com.my">jlim#natsoft.com.my</a>).<br>
 AXMLS (c) 2004 ars Cognita, Inc</p>
 <p><font size="1">This software is dual licensed using BSD-Style and
index ad7677e..aeb0350 100644 (file)
@@ -203,12 +203,12 @@ $arr = $db->GetRow("select * from emp where empno=:emp", array('emp' => 7900));
 <pre>
 $arr = $db->GetOne("select ename from emp where empno=:emp", array('emp' => 7900));
 </pre>
-<p>For easy pagination support, we provide the SelectLimit function. The following will perform a select query, limiting it to 100 rows, starting from row 200:
+<p>For easy pagination support, we provide the SelectLimit function. The following will perform a select query, limiting it to 100 rows, starting from row 201 (row 1 being the 1st row):
 <pre>
 $offset = 200; $limitrows = 100;
-$rs = $db->SelectLimit('select * from table', $offset, $limitrows);
+$rs = $db->SelectLimit('select * from table', $limitrows, $offset);
 </pre>
-<p>The $limitrows parameter is optional.
+<p>The $offset parameter is optional.
 <h4>Array Fetch Mode</h4>
 <p>When data is being returned in an array, you can choose the type of array the data is returned in. 
 <ol>
index 3c80d5f..3ef2de5 100644 (file)
@@ -18,7 +18,7 @@ font-size: 8pt;
 </head>
 <body>
 <h3>The ADOdb Performance Monitoring Library</h3>
-<p>V4.81 3 May 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my)</p>
+<p>V4.90 8 June 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my)</p>
 <p><font size="1">This software is dual licensed using BSD-Style and
 LGPL. This means you can use it in compiled proprietary and commercial
 products.</font></p>
index 3f8f1e8..b8c6e28 100644 (file)
@@ -21,7 +21,7 @@ font-size: 8pt;
 <body style="background-color: rgb(255, 255, 255);">
 <h3>ADODB Session Management Manual</h3>
 <p>
-V4.81 3 May 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my)
+V4.90 8 June 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my)
 </p>
 <p> <font size="1">This software is dual licensed using BSD-Style and
 LGPL. This means you can use it in compiled proprietary and commercial
@@ -123,11 +123,23 @@ including adodb-cryptsession.inc.php instead of adodb-session.inc.php. </li>
  <pre>  <font
  color="#004040"><br>    include('adodb/adodb.inc.php');<br>    <br><b>    $ADODB_SESSION_DRIVER='mysql';<br>    $ADODB_SESSION_CONNECT='localhost';<br>    $ADODB_SESSION_USER ='scott';<br>    $ADODB_SESSION_PWD ='tiger';<br>    $ADODB_SESSION_DB ='sessiondb';<br>    <br>    include('adodb/session/adodb-session-clob.php');</b><br>    session_start();</font>
  </pre>
+ <p>An alternative way to set persistant or non-persistent connections is to call the following function before session_start() is called.
+ <pre>
+       ADODB_Session::persist('P'); # 'C' for non-persistent connections
+ </pre>
  <h4>Installation</h4>
-<p>1. Create this table in your database (syntax might vary depending on your db):
+<p>1. Create this table in your database (MySQL syntax):
 <p><pre> <a
- name="sessiontab"></a> <font color="#004040"><br>  create table sessions (<br>       SESSKEY char(32) not null,<br>       EXPIRY int(11) unsigned not null,<br>       EXPIREREF varchar(64),<br>       DATA text not null,<br>      primary key (sesskey)<br>  );</font><br> 
+ name="sessiontab"></a> <font color="#004040">
+   create table sessions (
+       SESSKEY char(32) not null,
+       EXPIRY int(11) unsigned not null,
+       EXPIREREF varchar(64),
+          DATA text not null,
+          primary key (sesskey)
+          );</font>
  </pre>
+
  <p>You may want to rename the 'data' field to 'session_data' as
        'data' appears to be a reserved word for one or more of the following:
        <ul>
@@ -169,8 +181,8 @@ adodb's garbage collection function, which can be setup to do notification.
 the userid of the session. Later when the session has expired,  just before the record is deleted,
 we reload the EXPIREREF field and call the notification function with the value of EXPIREREF, which 
 is the userid of the person being logged off.
-<p>ADOdb use a global variable $ADODB_SESSION_EXPIRE_NOTIFY that you must predefine before session
-start to store the notification configuratioin. 
+<p>ADOdb uses a global variable $ADODB_SESSION_EXPIRE_NOTIFY that you must predefine before session
+start to store the notification configuration. 
 $ADODB_SESSION_EXPIRE_NOTIFY is an array with 2 elements, the
 first being the name of the session variable you would like to store in
 the EXPIREREF field, and the 2nd is the notification function's name. </p>
@@ -179,19 +191,30 @@ based on the userid. When the user logs in, we store the id in the global sessio
 $USERID. The function name is 'NotifyFn'. 
 <p>
 So we define (before session_start() is called): </p>
-<pre> <font color="#004040"><br>        $ADODB_SESSION_EXPIRE_NOTIFY = array('USERID','NotifyFn');<br>    </font></pre>
+<pre> <font color="#004040">
+       $ADODB_SESSION_EXPIRE_NOTIFY = array('USERID','NotifyFn');
+</font></pre>
 And when the NotifyFn is called (when the session expires), the
 $USERID is passed in as the first parameter, eg. NotifyFn($userid, $sesskey). The
 session key (which is the primary key of the record in the sessions
 table) is the 2nd parameter.
 <p> Here is an example of a Notification function that deletes some
 records in the database and temporary files: </p>
-<pre><font color="#004040"><br>        function NotifyFn($expireref, $sesskey)<br>        {<br>        global $ADODB_SESS_CONN; # the session connection object<br><br>          $user = $ADODB_SESS_CONN-&gt;qstr($expireref);<br>          $ADODB_SESS_CONN-&gt;Execute("delete from shopping_cart where user=$user");<br>          system("rm /work/tmpfiles/$expireref/*");<br>        }</font><br>    </pre>
+<pre><font color="#004040">
+       function NotifyFn($expireref, $sesskey)
+       {
+               global $ADODB_SESS_CONN; # the session connection object
+               $user = $ADODB_SESS_CONN-&gt;qstr($expireref);
+               
+               $ADODB_SESS_CONN-&gt;Execute("delete from shopping_cart where user=$user");          
+               system("rm /work/tmpfiles/$expireref/*");
+       }</font>  
+                         </pre>
 <p> NOTE 1: If you have register_globals disabled in php.ini, then you
 will have to manually set the EXPIREREF. E.g. </p>
 <pre> <font color="#004040">
-    $GLOBALS['USERID'] = GetUserID();
-    $ADODB_SESSION_EXPIRE_NOTIFY = array('USERID','NotifyFn');</font>
+$GLOBALS['USERID'] = GetUserID();
+$ADODB_SESSION_EXPIRE_NOTIFY = array('USERID','NotifyFn');</font>
 </pre>
 <p> NOTE 2: If you want to change the EXPIREREF after the session
 record has been created, you will need to modify any session variable
@@ -211,6 +234,38 @@ site.
 <p>3. You can scan the sessions table to ensure no user
 can be logged in twice. Useful for security reasons.
 </p>
+<h3>Using Oracle CLOBs</h3>
+<p>Suppose you are storing the DATA field in a CLOB:
+ <pre><font color="#004040">
+   CREATE TABLE sessions (
+       SESSKEY VARCHAR(32) NOT NULL,
+       EXPIRY NUMBER(16)  NOT NULL,
+       EXPIREREF VARCHAR(64),
+       DATA CLOB,
+      PRIMARY KEY (sesskey)
+  );</font>
+ </pre> 
+ <p>Then your PHP code could look like this:
+        <pre>
+       ADODB_SESSION_DRIVER='oci8';
+       $ADODB_SESSION_CONNECT=$tnsname;
+       $ADODB_SESSION_USER ='scott';
+       $ADODB_SESSION_PWD = 'tiger';
+       $ADODB_SESSION_DB ='';
+       
+       $ADODB_SESSION_USE_LOBS = 'clob';
+       $ADODB_SESSION_TBL = 'sessions';
+       
+       $ADODB_SESS_DEBUG=0;
+       
+       include(ADODB_DIR.'/session/adodb-session.php');
+       
+       ADODB_Session::persist('P'); # use 'C' for non-persistent connects
+       
+       session_start();
+ </pre>
+ <p>Note that you can set persistance using ADODB_Session::persist('P').
 <h3>Compression/Encryption Schemes</h3>
 Since ADOdb 4.05, thanks to Ross Smith, multiple encryption and
 compression schemes are supported. Currently, supported are:
@@ -238,7 +293,8 @@ on the theory behind this feature. Usage:
        # This is extremely simplistic example, better 
        # to regenerate only when the user logs in or changes
        # user privilege levels.
-       if ((rand()%10) == 0) adodb_session_regenerate_id(); </pre>
+       if ((rand()%10) == 0) adodb_session_regenerate_id(); 
+</pre>
 <p>This function calls session_regenerate_id() internally or simulates it if the function does not exist.
 <h2>More Info</h2>
 <p>Also see the <a href="docs-adodb.htm">core ADOdb documentation</a>.
index 1fea0ed..aae91aa 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /* 
-V4.81 3 May 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
+V4.90 8 June 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence. See License.txt. 
index d855728..9c40247 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /* 
-V4.81 3 May 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
+V4.90 8 June 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence. 
index 03c0901..6fac23a 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /* 
-V4.81 3 May 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
+V4.90 8 June 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence. 
@@ -58,8 +58,22 @@ class ADODB_ado extends ADOConnection {
        // you can also pass a connection string like this:
        //
        // $DB->Connect('USER ID=sa;PASSWORD=pwd;SERVER=mangrove;DATABASE=ai',false,false,'SQLOLEDB');
-       function _connect($argHostname, $argUsername, $argPassword, $argProvider= 'MSDASQL')
+       function _connect($argHostname, $argUsername, $argPassword,$argDBorProvider, $argProvider= '')
        {
+       // two modes
+       //      -       if $argProvider is empty, we assume that $argDBorProvider holds provider -- this is for backward compat
+       //      -       if $argProvider is not empty, then $argDBorProvider holds db
+       
+               
+                if ($argProvider) {
+                       $argDatabasename = $argDBorProvider;
+                } else {
+                       $argDatabasename = '';
+                       if ($argDBorProvider) $argProvider = $argDBorProvider;
+                       else $argProvider = 'MSDASQL';
+               }
+               
+               
                try {
                $u = 'UID';
                $p = 'PWD';
@@ -86,7 +100,11 @@ class ADODB_ado extends ADOConnection {
                        $argProvider = "Microsoft.Jet.OLEDB.4.0"; // Microsoft Jet Provider
                
                if ($argProvider) $dbc->Provider = $argProvider;        
+
+               if ($argProvider) $argHostname = "PROVIDER=$argProvider;DRIVER={SQL Server};SERVER=$argHostname";       
                
+
+               if ($argDatabasename) $argHostname .= ";DATABASE=$argDatabasename";             
                if ($argUsername) $argHostname .= ";$u=$argUsername";
                if ($argPassword)$argHostname .= ";$p=$argPassword";
                
@@ -205,9 +223,6 @@ class ADODB_ado extends ADOConnection {
                return $arr;
        }
        
-
-
-       
        /* returns queryID or false */
        function &_query($sql,$inputarr=false) 
        {
@@ -251,7 +266,8 @@ class ADODB_ado extends ADOConnection {
                if ($rs->State == 0) {
                        $true = true;
                        return $true; // 0 = adStateClosed means no records returned
-               } return $rs;
+               }
+               return $rs;
                
                } catch (exception $e) {
                        
@@ -296,11 +312,17 @@ class ADODB_ado extends ADOConnection {
        function ErrorMsg() 
        {
                if (!$this->_connectionID) return "No connection established";
-               $errc = $this->_connectionID->Errors;
-               if (!$errc) return "No Errors object found";
-               if ($errc->Count == 0) return '';
-               $err = $errc->Item($errc->Count-1);
-               return $err->Description;
+               $errmsg = '';
+               
+               try {
+                       $errc = $this->_connectionID->Errors;
+                       if (!$errc) return "No Errors object found";
+                       if ($errc->Count == 0) return '';
+                       $err = $errc->Item($errc->Count-1);
+                       $errmsg = $err->Description;
+               }catch(exception $e) {
+               }
+               return $errmsg;
        }
        
        function ErrorNo() 
index 0078a39..e24992c 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /* 
-V4.81 3 May 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
+V4.90 8 June 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
 Released under both BSD license and Lesser GPL library license. 
 Whenever there is any discrepancy between the two licenses, 
 the BSD license will take precedence. See License.txt. 
index 3a5e691..42ea898 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /* 
-V4.81 3 May 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
+V4.90 8 June 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence. 
@@ -11,8 +11,8 @@ Set tabs to 4 for best viewing.
   Microsoft SQL Server ADO data driver. Requires ADO and MSSQL client. 
   Works only on MS Windows.
   
-  It is normally better to use the mssql driver directly because it is much faster
-  This file is only a technology demonstration and for test purposes.
+  Warning: Some versions of PHP (esp PHP4) leak memory when ADO/COM is used
+  Please check http://bugs.php.net/ for more info.
 */
 
 // security - hide paths
@@ -53,6 +53,17 @@ class  ADODB_ado_mssql extends ADODB_ado {
                return $this->GetOne('select @@rowcount');
        }
        
+       function SetTransactionMode( $transaction_mode ) 
+       {
+               $this->_transmode  = $transaction_mode;
+               if (empty($transaction_mode)) {
+                       $this->Execute('SET TRANSACTION ISOLATION LEVEL READ COMMITTED');
+                       return;
+               }
+               if (!stristr($transaction_mode,'isolation')) $transaction_mode = 'ISOLATION LEVEL '.$transaction_mode;
+               $this->Execute("SET TRANSACTION ".$transaction_mode);
+       }
+       
        function MetaColumns($table)
        {
         $table = strtoupper($table);
@@ -84,6 +95,44 @@ class  ADODB_ado_mssql extends ADODB_ado {
                return empty($arr) ? $false : $arr;
        }
        
+       function CreateSequence($seq='adodbseq',$start=1)
+       {
+               
+               $this->Execute('BEGIN TRANSACTION adodbseq');
+               $start -= 1;
+               $this->Execute("create table $seq (id float(53))");
+               $ok = $this->Execute("insert into $seq with (tablock,holdlock) values($start)");
+               if (!$ok) {
+                               $this->Execute('ROLLBACK TRANSACTION adodbseq');
+                               return false;
+               }
+               $this->Execute('COMMIT TRANSACTION adodbseq'); 
+               return true;
+       }
+
+       function GenID($seq='adodbseq',$start=1)
+       {
+               //$this->debug=1;
+               $this->Execute('BEGIN TRANSACTION adodbseq');
+               $ok = $this->Execute("update $seq with (tablock,holdlock) set id = id + 1");
+               if (!$ok) {
+                       $this->Execute("create table $seq (id float(53))");
+                       $ok = $this->Execute("insert into $seq with (tablock,holdlock) values($start)");
+                       if (!$ok) {
+                               $this->Execute('ROLLBACK TRANSACTION adodbseq');
+                               return false;
+                       }
+                       $this->Execute('COMMIT TRANSACTION adodbseq'); 
+                       return $start;
+               }
+               $num = $this->GetOne("select id from $seq");
+               $this->Execute('COMMIT TRANSACTION adodbseq'); 
+               return $num;
+               
+               // in old implementation, pre 1.90, we returned GUID...
+               //return $this->GetOne("SELECT CONVERT(varchar(255), NEWID()) AS 'Char'");
+       }
+       
        } // end class 
        
        class  ADORecordSet_ado_mssql extends ADORecordSet_ado {        
index dee957f..442af0e 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /* 
-V4.81 3 May 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
+V4.90 8 June 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence. 
index 3f7c8f8..638c99c 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /*
-V4.81 3 May 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
+V4.90 8 June 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence.
index a0f67e0..61d600b 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /* 
-  V4.81 3 May 2006  (c) 2006 John Lim (jlim#natsoft.com.my). All rights reserved.
+  V4.90 8 June 2006  (c) 2006 John Lim (jlim#natsoft.com.my). All rights reserved.
 
 This is a version of the ADODB driver for DB2.  It uses the 'ibm_db2' PECL extension for PHP
   (http://pecl.php.net/package/ibm_db2), which in turn requires DB2 V8.2.2.
@@ -25,7 +25,14 @@ if (!defined('ADODB_DIR')) die();
 class ADODB_db2 extends ADOConnection {
        var $databaseType = "db2";      
        var $fmtDate = "'Y-m-d'";
-       var $fmtTimeStamp = "'Y-m-d, h:i:sA'";
+       var $concat_operator = '||';
+       
+       var $sysTime = 'CURRENT TIME';
+       var $sysDate = 'CURRENT DATE';
+       var $sysTimeStamp = 'CURRENT TIMESTAMP';
+       
+       var $fmtTimeStamp = "'Y-m-d-H.i.s'";
+       #var $fmtTimeStamp = "'Y-m-d, h:i:sA'";
        var $replaceQuote = "''"; // string to use to replace quotes
        var $dataProvider = "db2";
        var $hasAffectedRows = true;
@@ -40,6 +47,12 @@ class ADODB_db2 extends ADOConnection {
        var $_haserrorfunctions = true;
        var $_lastAffectedRows = 0;
        var $uCaseTables = true; // for meta* functions, uppercase table names
+       var $hasInsertID = true;
+       
+    function _insertid()
+    {
+        return ADOConnection::GetOne('VALUES IDENTITY_VAL_LOCAL()');
+    }
        
        function ADODB_db2() 
        {       
@@ -104,6 +117,61 @@ class ADODB_db2 extends ADOConnection {
        }
 
        
+       // Format date column in sql string given an input format that understands Y M D
+       function SQLDate($fmt, $col=false)
+       {       
+       // use right() and replace() ?
+               if (!$col) $col = $this->sysDate;
+               $s = '';
+               
+               $len = strlen($fmt);
+               for ($i=0; $i < $len; $i++) {
+                       if ($s) $s .= $this->concat_operator;
+                       $ch = $fmt[$i];
+                       switch($ch) {
+                       case 'Y':
+                       case 'y':
+                               $s .= "char(year($col))";
+                               break;
+                       case 'M':
+                               $s .= "substr(monthname($col),1,3)";
+                               break;
+                       case 'm':
+                               $s .= "right(digits(month($col)),2)";
+                               break;
+                       case 'D':
+                       case 'd':
+                               $s .= "right(digits(day($col)),2)";
+                               break;
+                       case 'H':
+                       case 'h':
+                               if ($col != $this->sysDate) $s .= "right(digits(hour($col)),2)";        
+                               else $s .= "''";
+                               break;
+                       case 'i':
+                       case 'I':
+                               if ($col != $this->sysDate)
+                                       $s .= "right(digits(minute($col)),2)";
+                                       else $s .= "''";
+                               break;
+                       case 'S':
+                       case 's':
+                               if ($col != $this->sysDate)
+                                       $s .= "right(digits(second($col)),2)";
+                               else $s .= "''";
+                               break;
+                       default:
+                               if ($ch == '\\') {
+                                       $i++;
+                                       $ch = substr($fmt,$i,1);
+                               }
+                               $s .= $this->qstr($ch);
+                       }
+               }
+               return $s;
+       } 
+       
        function ServerInfo()
        {
        
@@ -575,15 +643,12 @@ class ADORecordSet_db2 extends ADORecordSet {
 
 
        // returns the field object
-       function &FetchField($fieldOffset = -1) 
+       function &FetchField($offset = -1) 
        {
-               
-               $off=$fieldOffset+1; // offsets begin at 1
-               
                $o= new ADOFieldObject();
-               $o->name = @db2_field_name($this->_queryID,$off);
-               $o->type = @db2_field_type($this->_queryID,$off);
-               $o->max_length = db2_field_width($this->_queryID,$off);
+               $o->name = @db2_field_name($this->_queryID,$offset);
+               $o->type = @db2_field_type($this->_queryID,$offset);
+               $o->max_length = db2_field_width($this->_queryID,$offset);
                if (ADODB_ASSOC_CASE == 0) $o->name = strtolower($o->name);
                else if (ADODB_ASSOC_CASE == 1) $o->name = strtoupper($o->name);
                return $o;
index c054a9e..1cf0d4d 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /*
- @version V4.81 3 May 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
+ @version V4.90 8 June 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
  Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence. 
index 286ca17..c26fc98 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /* 
-V4.81 3 May 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
+V4.90 8 June 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence. 
index f1eacda..d8d3bf1 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /*
-V4.81 3 May 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.  
+V4.90 8 June 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.  
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence.
index 2f90e24..99b9c12 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
-* @version V4.81 3 May 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
+* @version V4.90 8 June 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
 * Released under both BSD license and Lesser GPL library license.
 * Whenever there is any discrepancy between the two licenses,
 * the BSD license will take precedence.
index 4d94657..1f52b63 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /*
-V4.81 3 May 2006  (c) 2000-2006 John Lim. All rights reserved.
+V4.90 8 June 2006  (c) 2000-2006 John Lim. All rights reserved.
   Released under both BSD license and Lesser GPL library license.
   Whenever there is any discrepancy between the two licenses,
   the BSD license will take precedence.
index 38b0b57..05f20cb 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /*
-  V4.81 3 May 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
+  V4.90 8 June 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
    Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence.
index 2f5ed41..7693059 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /* 
-V4.81 3 May 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
+V4.90 8 June 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence. 
@@ -296,6 +296,17 @@ class ADODB_mssql extends ADOConnection {
                return true;
        }
        
+       function SetTransactionMode( $transaction_mode ) 
+       {
+               $this->_transmode  = $transaction_mode;
+               if (empty($transaction_mode)) {
+                       $this->Execute('SET TRANSACTION ISOLATION LEVEL READ COMMITTED');
+                       return;
+               }
+               if (!stristr($transaction_mode,'isolation')) $transaction_mode = 'ISOLATION LEVEL '.$transaction_mode;
+               $this->Execute("SET TRANSACTION ".$transaction_mode);
+       }
+       
        /*
                Usage:
                
index dc2441c..058dcf7 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
-* @version V4.81 3 May 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
+* @version V4.90 8 June 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
 * Released under both BSD license and Lesser GPL library license.
 * Whenever there is any discrepancy between the two licenses,
 * the BSD license will take precedence.
index c95e025..d7e96a7 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /*
-V4.81 3 May 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
+V4.90 8 June 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence.
@@ -542,6 +542,9 @@ class ADODB_mysql extends ADOConnection {
        // "Innox - Juan Carlos Gonzalez" <jgonzalez#innox.com.mx>
        function MetaForeignKeys( $table, $owner = FALSE, $upper = FALSE, $associative = FALSE )
      {
+        global $ADODB_FETCH_MODE;
+               if ($ADODB_FETCH_MODE == ADODB_FETCH_ASSOC || $this->fetchMode == ADODB_FETCH_ASSOC) $associative = true;
+
          if ( !empty($owner) ) {
             $table = "$owner.$table";
          }
index a6b0602..0915942 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /*
-V4.81 3 May 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
+V4.90 8 June 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence.
@@ -58,6 +58,16 @@ class ADODB_mysqli extends ADOConnection {
            
        }
        
+       function SetTransactionMode( $transaction_mode ) 
+       {
+               $this->_transmode  = $transaction_mode;
+               if (empty($transaction_mode)) {
+                       $this->Execute('SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ');
+                       return;
+               }
+               if (!stristr($transaction_mode,'isolation')) $transaction_mode = 'ISOLATION LEVEL '.$transaction_mode;
+               $this->Execute("SET SESSION TRANSACTION ".$transaction_mode);
+       }
 
        // returns true or false
        // To add: parameter int $port,
@@ -445,6 +455,10 @@ class ADODB_mysqli extends ADOConnection {
        // "Innox - Juan Carlos Gonzalez" <jgonzalez#innox.com.mx>
        function MetaForeignKeys( $table, $owner = FALSE, $upper = FALSE, $associative = FALSE )
        {
+        global $ADODB_FETCH_MODE;
+               
+               if ($ADODB_FETCH_MODE == ADODB_FETCH_ASSOC || $this->fetchMode == ADODB_FETCH_ASSOC) $associative = true;
+               
            if ( !empty($owner) ) {
               $table = "$owner.$table";
            }
index ea62002..c37d4bc 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 
 /*
-V4.81 3 May 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
+V4.90 8 June 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence.
@@ -30,6 +30,23 @@ class ADODB_mysqlt extends ADODB_mysql {
        global $ADODB_EXTENSION; if ($ADODB_EXTENSION) $this->rsPrefix .= 'ext_';
        }
        
+       /* set transaction mode
+       
+       SET [GLOBAL | SESSION] TRANSACTION ISOLATION LEVEL
+{ READ UNCOMMITTED | READ COMMITTED | REPEATABLE READ | SERIALIZABLE }
+
+       */
+       function SetTransactionMode( $transaction_mode ) 
+       {
+               $this->_transmode  = $transaction_mode;
+               if (empty($transaction_mode)) {
+                       $this->Execute('SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ');
+                       return;
+               }
+               if (!stristr($transaction_mode,'isolation')) $transaction_mode = 'ISOLATION LEVEL '.$transaction_mode;
+               $this->Execute("SET SESSION TRANSACTION ".$transaction_mode);
+       }
+       
        function BeginTrans()
        {         
                if ($this->transOff) return true;
index afd5923..6ed02c0 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /*
-  V4.81 3 May 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
+  V4.90 8 June 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
  
   First cut at the Netezza Driver by Josh Eldridge joshuae74#hotmail.com
  Based on the previous postgres drivers.
index 05f9aea..c7a1f6b 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /*
 
-  version V4.81 3 May 2006 (c) 2000-2006 John Lim. All rights reserved.
+  version V4.90 8 June 2006 (c) 2000-2006 John Lim. All rights reserved.
 
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
@@ -278,6 +278,21 @@ NATSOFT.DOMAIN =
                return "TO_DATE(".adodb_date($this->fmtDate,$d).",'".$this->NLS_DATE_FORMAT."')";
        }
 
+       function BindDate($d)
+       {
+               $d = ADOConnection::DBDate($d);
+               if (strncmp($d,"'",1)) return $d;
+               
+               return substr($d,1,strlen($d)-2);
+       }
+       
+       function BindTimeStamp($d)
+       {
+               $d = ADOConnection::DBTimeStamp($d);
+               if (strncmp($d,"'",1)) return $d;
+               
+               return substr($d,1,strlen($d)-2);
+       }
        
        // format and return date string in database timestamp format
        function DBTimeStamp($ts)
@@ -381,6 +396,8 @@ NATSOFT.DOMAIN =
                $this->transCnt += 1;
                $this->autoCommit = false;
                $this->_commit = OCI_DEFAULT;
+               
+               if ($this->_transmode) $this->Execute("SET TRANSACTION ".$this->_transmode);
                return true;
        }
        
index 5163df0..2aed0e0 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /** 
- * @version V4.81 3 May 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
+ * @version V4.90 8 June 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
  * Released under both BSD license and Lesser GPL library license. 
  * Whenever there is any discrepancy between the two licenses, 
  * the BSD license will take precedence. 
index 0555864..a033816 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /*
-V4.81 3 May 2006  (c) 2000-2006 John Lim. All rights reserved.
+V4.90 8 June 2006  (c) 2000-2006 John Lim. All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence.
index 9940150..ae9c588 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /* 
-V4.81 3 May 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
+V4.90 8 June 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence. 
index 4e9fee2..96e5dc0 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /* 
-V4.81 3 May 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
+V4.90 8 June 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence. 
@@ -60,7 +60,7 @@ Setting SQL_CUR_USE_ODBC
 ========================
 To set SQL_CUR_USE_ODBC for drivers that require it, do this:
 
-$db = NewADOConnection('db2');
+$db = NewADOConnection('odbc_db2');
 $db->curMode = SQL_CUR_USE_ODBC;
 $db->Connect($dsn, $userid, $pwd);
 
@@ -80,6 +80,10 @@ Connect() when using the CLI interface. From Halmai Csongor csongor.halmai#nexum
 > In case of DB2 I had to swap the first and last arguments in order to connect properly. 
 
 
+System Error 5
+==============
+IF you get a System Error 5 when trying to Connect/Load, it could be a permission problem. Give the user connecting
+to DB2 full rights to the DB2 SQLLIB directory, and place the user in the DBUSERS group.
 */
 
 // security - hide paths
@@ -88,13 +92,14 @@ if (!defined('ADODB_DIR')) die();
 if (!defined('_ADODB_ODBC_LAYER')) {
        include(ADODB_DIR."/drivers/adodb-odbc.inc.php");
 }
-if (!defined('ADODB_DB2')){
-define('ADODB_DB2',1);
+if (!defined('ADODB_ODBC_DB2')){
+define('ADODB_ODBC_DB2',1);
 
-class ADODB_DB2 extends ADODB_odbc {
+class ADODB_ODBC_DB2 extends ADODB_odbc {
        var $databaseType = "db2";      
        var $concat_operator = '||';
-       var $sysDate = 'CURRENT_DATE';
+       var $sysTime = 'CURRENT TIME';
+       var $sysDate = 'CURRENT DATE';
        var $sysTimeStamp = 'CURRENT TIMESTAMP';
        // The complete string representation of a timestamp has the form 
        // yyyy-mm-dd-hh.mm.ss.nnnnnn.
@@ -103,6 +108,7 @@ class ADODB_DB2 extends ADODB_odbc {
        var $identitySQL = 'values IDENTITY_VAL_LOCAL()';
        var $_bindInputArray = true;
         var $hasInsertID = true;
+       var $rsPrefix = 'ADORecordset_odbc_';
        
        function ADODB_DB2()
        {
@@ -294,7 +300,7 @@ class ADODB_DB2 extends ADODB_odbc {
 };
  
 
-class  ADORecordSet_db2 extends ADORecordSet_odbc {    
+class  ADORecordSet_odbc_db2 extends ADORecordSet_odbc {       
        
        var $databaseType = "db2";              
        
index e0eeff1..d9186a1 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /* 
-V4.81 3 May 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
+V4.90 8 June 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence. 
@@ -142,6 +142,17 @@ order by constraint_name, referenced_table_name, keyno";
                return ADODB_odbc::_query($sql,$inputarr);
        }
        
+       function SetTransactionMode( $transaction_mode ) 
+       {
+               $this->_transmode  = $transaction_mode;
+               if (empty($transaction_mode)) {
+                       $this->Execute('SET TRANSACTION ISOLATION LEVEL READ COMMITTED');
+                       return;
+               }
+               if (!stristr($transaction_mode,'isolation')) $transaction_mode = 'ISOLATION LEVEL '.$transaction_mode;
+               $this->Execute("SET TRANSACTION ".$transaction_mode);
+       }
+       
        // "Stein-Aksel Basma" <basma@accelero.no>
        // tested with MSSQL 2000
        function &MetaPrimaryKeys($table)
index 4cfc1bd..a77bcd2 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /* 
-V4.81 3 May 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
+V4.90 8 June 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence. 
index 580c8c1..270d2fa 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /*
-  V4.81 3 May 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
+  V4.90 8 June 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license.
   Whenever there is any discrepancy between the two licenses,
   the BSD license will take precedence. See License.txt.
index e570d19..f291bb3 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /*
-       V4.81 3 May 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
+       V4.90 8 June 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license.
   Whenever there is any discrepancy between the two licenses,
   the BSD license will take precedence. See License.txt.
index e6204f1..69df13b 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /*
-V4.81 3 May 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
+V4.90 8 June 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence.
@@ -45,6 +45,24 @@ class ADODB_oracle extends ADOConnection {
                if (is_string($ts)) $d = ADORecordSet::UnixTimeStamp($ts);
                return 'TO_DATE('.adodb_date($this->fmtTimeStamp,$ts).",'RRRR-MM-DD, HH:MI:SS AM')";
        }
+       
+       
+       function BindDate($d)
+       {
+               $d = ADOConnection::DBDate($d);
+               if (strncmp($d,"'",1)) return $d;
+               
+               return substr($d,1,strlen($d)-2);
+       }
+       
+       function BindTimeStamp($d)
+       {
+               $d = ADOConnection::DBTimeStamp($d);
+               if (strncmp($d,"'",1)) return $d;
+               
+               return substr($d,1,strlen($d)-2);
+       }
+       
 
        
        function BeginTrans()
index 7d09c22..e002efa 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /* 
-V4.81 3 May 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
+V4.90 8 June 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence. 
index 850fd12..54a681d 100644 (file)
@@ -2,7 +2,7 @@
 
 
 /*
-V4.81 3 May 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
+V4.90 8 June 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence.
@@ -36,6 +36,17 @@ class ADODB_pdo_mssql extends ADODB_pdo {
                return $ret;
        }
        
+       function SetTransactionMode( $transaction_mode ) 
+       {
+               $this->_transmode  = $transaction_mode;
+               if (empty($transaction_mode)) {
+                       $this->Execute('SET TRANSACTION ISOLATION LEVEL READ COMMITTED');
+                       return;
+               }
+               if (!stristr($transaction_mode,'isolation')) $transaction_mode = 'ISOLATION LEVEL '.$transaction_mode;
+               $this->Execute("SET TRANSACTION ".$transaction_mode);
+       }
+       
        function MetaTables()
        {
                return false;
index 3c8710b..3cec6d1 100644 (file)
@@ -2,7 +2,7 @@
 
 
 /*
-V4.81 3 May 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
+V4.90 8 June 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence.
@@ -50,6 +50,17 @@ class ADODB_pdo_mysql extends ADODB_pdo {
                return $ret;
        }
        
+       function SetTransactionMode( $transaction_mode ) 
+       {
+               $this->_transmode  = $transaction_mode;
+               if (empty($transaction_mode)) {
+                       $this->Execute('SET TRANSACTION ISOLATION LEVEL REPEATABLE READ');
+                       return;
+               }
+               if (!stristr($transaction_mode,'isolation')) $transaction_mode = 'ISOLATION LEVEL '.$transaction_mode;
+               $this->Execute("SET SESSION TRANSACTION ".$transaction_mode);
+       }
+       
        function &MetaColumns($table) 
        {
                $this->_findschema($table,$schema);
index 8066565..5c2519c 100644 (file)
@@ -2,7 +2,7 @@
 
 
 /*
-V4.81 3 May 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
+V4.90 8 June 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence.
index 2de5036..d1cc363 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 
 /*
-V4.81 3 May 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
+V4.90 8 June 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence.
index 63a057d..496a947 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /*
- V4.81 3 May 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
+ V4.90 8 June 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence.
index feadbaa..14f7b00 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /*
- V4.81 3 May 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
+ V4.90 8 June 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence.
@@ -174,7 +174,7 @@ a different OID if a database must be reloaded. */
        {
                if ($this->transOff) return true;
                $this->transCnt += 1;
-               return @pg_Exec($this->_connectionID, "begin");
+               return @pg_Exec($this->_connectionID, "begin ".$this->_transmode);
        }
        
        function RowLock($tables,$where,$flds='1 as ignore') 
@@ -532,6 +532,8 @@ select viewname,'V' from pg_views where viewname like $mask";
                        $fld->name = $rs->fields[0];
                        $fld->type = $rs->fields[1];
                        $fld->max_length = $rs->fields[2];
+                       $fld->attnum = $rs->fields[6];
+                       
                        if ($fld->max_length <= 0) $fld->max_length = $rs->fields[3]-4;
                        if ($fld->max_length <= 0) $fld->max_length = -1;
                        if ($fld->type == 'numeric') {
@@ -617,12 +619,14 @@ WHERE (c2.relname=\'%s\' or c2.relname=lower(\'%s\'))';
                                        return $false;
                 }
                                
-                $col_names = $this->MetaColumnNames($table,true);
+                $col_names = $this->MetaColumnNames($table,true,true); 
+                               //3rd param is use attnum, 
+                               // see http://sourceforge.net/tracker/index.php?func=detail&aid=1451245&group_id=42718&atid=433976
                 $indexes = array();
                 while ($row = $rs->FetchRow()) {
                         $columns = array();
                         foreach (explode(' ', $row[2]) as $col) {
-                                $columns[] = $col_names[$col - 1];
+                                $columns[] = $col_names[$col];
                         }
                         
                         $indexes[$row[0]] = array(
@@ -701,7 +705,7 @@ WHERE (c2.relname=\'%s\' or c2.relname=lower(\'%s\'))';
        // returns queryID or false
        function _query($sql,$inputarr)
        {
-               
+               $this->_errorMsg = false;
                if ($inputarr) {
                /*
                        It appears that PREPARE/EXECUTE is slower for many queries.
@@ -731,6 +735,7 @@ WHERE (c2.relname=\'%s\' or c2.relname=lower(\'%s\'))';
                        if ($execp) $exsql = "EXECUTE $plan ($execp)";
                        else $exsql = "EXECUTE $plan";
                        
+                       
                        $rez = @pg_exec($this->_connectionID,$exsql);
                        if (!$rez) {
                        # Perhaps plan does not exist? Prepare/compile plan.
@@ -756,12 +761,11 @@ WHERE (c2.relname=\'%s\' or c2.relname=lower(\'%s\'))';
                                $s = "PREPARE $plan ($params) AS ".substr($sql,0,strlen($sql)-2);               
                                //adodb_pr($s);
                                pg_exec($this->_connectionID,$s);
-                               echo $this->ErrorMsg();
+                               //echo $this->ErrorMsg();
                        }
                        
                        $rez = pg_exec($this->_connectionID,$exsql);
                } else {
-                       $this->_errorMsg = false;
                        //adodb_backtrace();
                        $rez = pg_exec($this->_connectionID,$sql);
                }
@@ -1000,6 +1004,7 @@ class ADORecordSet_postgres64 extends ADORecordSet{
                                case 'BPCHAR':
                                case '_VARCHAR':
                                case 'INET':
+                               case 'MACADDR':
                                        if ($len <= $this->blobSize) return 'C';
                                
                                case 'TEXT':
@@ -1019,6 +1024,8 @@ class ADORecordSet_postgres64 extends ADORecordSet{
                                case 'DATE':
                                        return 'D';
                                
+                               
+                               case 'TIMESTAMP WITHOUT TIME ZONE':
                                case 'TIME':
                                case 'DATETIME':
                                case 'TIMESTAMP':
index 7dc22cc..fb2c956 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /*
- V4.81 3 May 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
+ V4.90 8 June 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence.
@@ -56,6 +56,7 @@ class ADODB_postgres7 extends ADODB_postgres64 {
        }
        */
 
+
        // from  Edward Jaramilla, improved version - works on pg 7.4
        function MetaForeignKeys($table, $owner=false, $upper=false)
        {
@@ -96,6 +97,7 @@ class ADODB_postgres7 extends ADODB_postgres64 {
                        // We don't have native support for parameterized queries, so let's emulate it at the parent
                        return ADODB_postgres64::_query($sql, $inputarr);
                }
+               $this->_errorMsg = false;
                // -- added Cristiano da Cunha Duarte
                if ($inputarr) {
                        $sqlarr = explode('?',trim($sql));
index 80d6e18..b81f101 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /*
- V4.81 3 May 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
+ V4.90 8 June 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence.
index b0f9825..7759890 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /*
-V4.81 3 May 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
+V4.90 8 June 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence.
index df9fb45..7e968ac 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /* 
-V4.81 3 May 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
+V4.90 8 June 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence. 
index cd023cc..5e2fcd4 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /* 
-version V4.81 3 May 2006 (c) 2000-2006  John Lim (jlim#natsoft.com.my).  All rights
+version V4.90 8 June 2006 (c) 2000-2006  John Lim (jlim#natsoft.com.my).  All rights
 reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
index 1838220..70b1f02 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /*
-V4.81 3 May 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
+V4.90 8 June 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence.
index b8489e9..f8c6fbc 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /*
-V4.81 3 May 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
+V4.90 8 June 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license.
   Whenever there is any discrepancy between the two licenses,
   the BSD license will take precedence.
index 2649260..ef9948c 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /* 
-V4.81 3 May 2006  (c) 2000-2006 John Lim. All rights reserved.
+V4.90 8 June 2006  (c) 2000-2006 John Lim. All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence. 
index c0c783f..dfc0835 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /*
-  V4.81 3 May 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
+  V4.90 8 June 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence.
index f62d7d9..1e4237f 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /* 
-V4.81 3 May 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
+V4.90 8 June 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence. 
index 70f0274..e2d1944 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /* 
-V4.81 3 May 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
+V4.90 8 June 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence. See License.txt. 
index 750c81f..7d7e96f 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /* 
-V4.81 3 May 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
+V4.90 8 June 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence. See License.txt. 
index 5fcd407..3002521 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 
 /* 
-V4.81 3 May 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
+V4.90 8 June 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence. See License.txt. 
index 729c011..62f1778 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /* 
-V4.81 3 May 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
+V4.90 8 June 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence. See License.txt. 
index 5e801d2..654f9d2 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /* 
-V4.81 3 May 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
+V4.90 8 June 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence. See License.txt. 
index 89e414f..dccfac0 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 
 /* 
-V4.81 3 May 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
+V4.90 8 June 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence. See License.txt. 
index 35b9fe4..290171f 100644 (file)
@@ -1,15 +1,12 @@
 <?php
 /** 
- * @version V4.81 3 May 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
+ * @version V4.90 8 June 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
  * Released under both BSD license and Lesser GPL library license. 
  * Whenever there is any discrepancy between the two licenses, 
  * the BSD license will take precedence. 
  *
  * Set tabs to 4 for best viewing.
  * 
- * Latest version is available at http://php.weblogs.com
- *
- * Requires PHP4.01pl2 or later because it uses include_once
 */
 
 /*
@@ -38,7 +35,7 @@
        else $hidecnt = false;
        
        $iif = strpos($db->databaseType,'access') !== false; 
-               // note - vfp still doesn' work even with IIF enabled || $db->databaseType == 'vfp';
+               // note - vfp still doesn' work even with IIF enabled || $db->databaseType == 'vfp';
        
        //$hidecnt = false;
        
        else
                $sel = substr($sel,0,strlen($sel)-2);
        
+       
+       // Strip aliases
+       $rowfields = preg_replace('/ AS (\w+)/i', '', $rowfields);
+       
        $sql = "SELECT $sel \nFROM $tables $where \nGROUP BY $rowfields";
+       
        return $sql;
  }
 
index 21b759e..0527529 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /** 
- * @version V4.81 3 May 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
+ * @version V4.90 8 June 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
  * Released under both BSD license and Lesser GPL library license. 
  * Whenever there is any discrepancy between the two licenses, 
  * the BSD license will take precedence. 
index bff6bcc..4cadaa3 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 
 /** 
- * @version V4.81 3 May 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
+ * @version V4.90 8 June 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
  * Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence. 
index 0fe511d..91d15e3 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 
 /*
-V4.81 3 May 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
+V4.90 8 June 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
          Contributed by Ross Smith (adodb@netebb.com). 
   Released under both BSD license and Lesser GPL library license.
   Whenever there is any discrepancy between the two licenses,
index 59a37c7..3134408 100644 (file)
@@ -2,7 +2,7 @@
 
 
 /*
-V4.81 3 May 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
+V4.90 8 June 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
          Contributed by Ross Smith (adodb@netebb.com). 
   Released under both BSD license and Lesser GPL library license.
   Whenever there is any discrepancy between the two licenses,
index 1a91b8c..677c18e 100644 (file)
@@ -2,7 +2,7 @@
 
 
 /*
-V4.81 3 May 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
+V4.90 8 June 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
          Contributed by Ross Smith (adodb@netebb.com). 
   Released under both BSD license and Lesser GPL library license.
   Whenever there is any discrepancy between the two licenses,
index 9f4a31f..0a5174b 100644 (file)
@@ -2,7 +2,7 @@
 
 
 /*
-V4.81 3 May 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
+V4.90 8 June 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
          Contributed by Ross Smith (adodb@netebb.com). 
   Released under both BSD license and Lesser GPL library license.
   Whenever there is any discrepancy between the two licenses,
index 425a345..fc62c56 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 
 /*
-V4.81 3 May 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
+V4.90 8 June 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
          Contributed by Ross Smith (adodb@netebb.com). 
   Released under both BSD license and Lesser GPL library license.
   Whenever there is any discrepancy between the two licenses,
index 9d6b672..b882714 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 
 /*
-V4.81 3 May 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
+V4.90 8 June 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
          Contributed by Ross Smith (adodb@netebb.com). 
   Released under both BSD license and Lesser GPL library license.
   Whenever there is any discrepancy between the two licenses,
index a1210a6..1d470ea 100644 (file)
@@ -2,7 +2,7 @@
 
 
 /*
-V4.81 3 May 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
+V4.90 8 June 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
          Contributed by Ross Smith (adodb@netebb.com). 
   Released under both BSD license and Lesser GPL library license.
   Whenever there is any discrepancy between the two licenses,
index 12d01ad..dde1d94 100644 (file)
@@ -2,7 +2,7 @@
 
 
 /*
-V4.81 3 May 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
+V4.90 8 June 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
          Contributed by Ross Smith (adodb@netebb.com). 
   Released under both BSD license and Lesser GPL library license.
   Whenever there is any discrepancy between the two licenses,
@@ -492,6 +492,19 @@ class ADODB_Session {
        /////////////////////
        // public methods
        /////////////////////
+       
+       function config($driver, $host, $user, $password, $database=false,$options=false)
+       {
+               ADODB_Session::driver($driver);
+               ADODB_Session::host($host);
+               ADODB_Session::user($user);
+               ADODB_Session::password($password);
+               ADODB_Session::database($database);
+               
+               if (isset($options['table'])) ADODB_Session::table($options['table']);
+               if (isset($options['clob'])) ADODB_Session::table($options['clob']);
+               if (isset($options['field'])) ADODB_Session::dataFieldName($options['field']);
+       }
 
        /*!
                Create the connection to the database.
@@ -523,7 +536,6 @@ class ADODB_Session {
 #              assert('$driver');
 #              assert('$host');
 
-               // cannot use =& below - do not know why...
                $conn =& ADONewConnection($driver);
 
                if ($debug) {
@@ -618,6 +630,10 @@ class ADODB_Session {
                If the data has not been modified since the last read(), we do not write.
        */
        function write($key, $val) {
+       global $ADODB_SESSION_READONLY;
+       
+               if (!empty($ADODB_SESSION_READONLY)) return;
+               
                $clob                   = ADODB_Session::clob();
                $conn                   =& ADODB_Session::_conn();
                $crc                    = ADODB_Session::_crc();
@@ -646,12 +662,19 @@ class ADODB_Session {
                        if ($debug) {
                                echo '<p>Session: Only updating date - crc32 not changed</p>';
                        }
-                       $sql = "UPDATE $table SET expiry = ".$conn->Param('0')." WHERE $binary sesskey = ".$conn->Param('1')." AND expiry >= ".$conn->Param('2');
-                       $rs =& $conn->Execute($sql,array($expiry,$key,time()));
-                       ADODB_Session::_dumprs($rs);
-                       if ($rs) {
-                               $rs->Close();
+                       
+                       $expirevar = '';
+                       if ($expire_notify) {
+                               $var = reset($expire_notify);
+                               global $$var;
+                               if (isset($$var)) {
+                                       $expirevar = $$var;
+                               }
                        }
+                       
+                       
+                       $sql = "UPDATE $table SET expiry = ".$conn->Param('0').",expireref=".$conn->Param('1')." WHERE $binary sesskey = ".$conn->Param('2')." AND expiry >= ".$conn->Param('3');
+                       $rs =& $conn->Execute($sql,array($expiry,$expirevar,$key,time()));
                        return true;
                }
                $val = rawurlencode($val);
@@ -673,7 +696,7 @@ class ADODB_Session {
                if (!$clob) {   // no lobs, simply use replace()
                        $arr[$data] = $conn->qstr($val);
                        $rs = $conn->Replace($table, $arr, 'sesskey', $autoQuote = true);
-                       ADODB_Session::_dumprs($rs);
+                       
                } else {
                        // what value shall we insert/update for lob row?
                        switch ($driver) {
@@ -691,13 +714,13 @@ class ADODB_Session {
                                        break;
                        }
                        
+                       $expiryref = $conn->qstr($arr['expireref']);
                        // do we insert or update? => as for sesskey
                        $rs =& $conn->Execute("SELECT COUNT(*) AS cnt FROM $table WHERE $binary sesskey = $qkey");
-                       ADODB_Session::_dumprs($rs);
                        if ($rs && reset($rs->fields) > 0) {
-                               $sql = "UPDATE $table SET expiry = $expiry, $data = $lob_value WHERE  sesskey = $qkey";
+                               $sql = "UPDATE $table SET expiry = $expiry, $data = $lob_value, expireref=$expiryref WHERE  sesskey = $qkey";
                        } else {
-                               $sql = "INSERT INTO $table (expiry, $data, sesskey) VALUES ($expiry, $lob_value, $qkey)";
+                               $sql = "INSERT INTO $table (expiry, $data, sesskey,expireref) VALUES ($expiry, $lob_value, $qkey,$expiryref)";
                        }
                        if ($rs) {
                                $rs->Close();
@@ -705,12 +728,11 @@ class ADODB_Session {
 
                        $err = '';
                        $rs1 =& $conn->Execute($sql);
-                       ADODB_Session::_dumprs($rs1);
                        if (!$rs1) {
                                $err = $conn->ErrorMsg()."\n";
                        }
                        $rs2 =& $conn->UpdateBlob($table, $data, $val, " sesskey=$qkey", strtoupper($clob));
-                       ADODB_Session::_dumprs($rs2);
+                       
                        if (!$rs2) {
                                $err .= $conn->ErrorMsg()."\n";
                        }
@@ -901,7 +923,8 @@ class ADODB_Session {
 }
 
 ADODB_Session::_init();
-register_shutdown_function('session_write_close');
+if (empty($ADODB_SESSION_READONLY))
+       register_shutdown_function('session_write_close');
 
 // for backwards compatability only
 function adodb_sess_open($save_path, $session_name, $persist = true) {
@@ -914,4 +937,4 @@ function adodb_sess_gc($t)
        return ADODB_Session::gc($t);
 }
 
-?>
+?>
\ No newline at end of file
index 0b4f3f3..7b68044 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /*
-V4.81 3 May 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
+V4.90 8 June 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence.
index a44e135..0067886 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /*
-  V4.81 3 May 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
+  V4.90 8 June 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence.
index f800d28..413171f 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /*
-V4.81 3 May 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
+V4.90 8 June 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence.
index a64f43d..72168d8 100644 (file)
@@ -29,10 +29,12 @@ if  (!$db)  die('failed');
 
 
 
+
 $rec = new ADODB_Active_Record('photos');
 
 $rec = new ADODB_Active_Record('products');
 
+
 adodb_pr($rec->getAttributeNames());
 
 echo "<hr>";
index 2752959..a8fcb97 100644 (file)
@@ -747,7 +747,14 @@ END Adodb;
                where id=".$db->Param('zid')." and created>=".$db->Param('ZDATE')."",
                $array);
        if ($id != 1) Err("Bad bind; id=$id");
-       else echo "<br>Bind date/integer passed";
+       else echo "<br>Bind date/integer 1 passed";
+       
+       $array =array(1,$db->BindDate(time()));
+       $id = $db->GetOne("select id from ADOXYZ 
+               where id=".$db->Param('0')." and created>=".$db->Param('1')."",
+               $array);
+       if ($id != 1) Err("Bad bind; id=$id");
+       else echo "<br>Bind date/integer 2 passed";
        
        $db->debug = false;
        $ADODB_FETCH_MODE = ADODB_FETCH_ASSOC;
@@ -1327,13 +1334,16 @@ END Adodb;
        $date = $db->SQLDate('d-m-M-Y-\QQ h:i:s A',$db->DBDate("1974-02-25"));
        $sql = "SELECT $date from ADOXYZ";
        print "<p>Test SQLDate: ".htmlspecialchars($sql)."</p>";
+       $db->debug=1;
        $rs = $db->SelectLimit($sql,1);
        $ts = ADOConnection::UnixDate('1974-02-25');
        $d = date('d-m-M-Y-',$ts).'Q'.(ceil(date('m',$ts)/3.0)).date(' h:i:s A',$ts);
        if (!$rs) {
                Err("SQLDate query returned no recordset");
                echo $db->ErrorMsg(),'<br>';
-       } else if ($d != $rs->fields[0]) Err("SQLDate 2 failed expected: <br>act:$d <br>sql:".$rs->fields[0]);
+       } else if ($d != reset($rs->fields)) {
+               Err("SQLDate 2 failed expected: <br>act:$d <br>sql:".$rs->fields[0].' <br>'.$db->ErrorMsg());
+       }
        
        
        print "<p>Test Filter</p>";
@@ -1504,9 +1514,11 @@ END Adodb;
        flush();
        
        if ($db->hasTransactions) {
-               //$db->debug=1;
+               $db->debug=1;
                echo "<p>Testing StartTrans CompleteTrans</p>";
                $db->raiseErrorFn = false;
+               
+               $db->SetTransactionMode('SERIALIZABLE');
                $db->StartTrans();
                $rs = $db->Execute('select * from notable');
                        $db->StartTrans();
@@ -1515,6 +1527,8 @@ END Adodb;
                                $db->CommitTrans();
                        $db->CompleteTrans();
                $rez = $db->CompleteTrans();
+               $db->SetTransactionMode('');
+               $db->debug=0;
                if ($rez !== false) {
                        if (is_null($rez)) Err("Error: _transOK not modified");
                        else Err("Error: CompleteTrans (1) should have failed");
index 466d335..fb3ab4d 100644 (file)
@@ -314,17 +314,28 @@ if (false && !empty($testoracle)) {
 
 }
 
-ADOLoadCode("db2"); // no longer supported
-if (!empty($testdb2)) { 
-       $db = ADONewConnection();
-       print "<h1>Connecting $db->databaseType...</h1>";
-       
-       $dsn = "db2_sample";
-       $dsn = "driver={IBM db2 odbc DRIVER};Database=sample;hostname=localhost;port=50000;protocol=TCPIP; uid=root; pwd=natsoft";
-       if ($db->Connect($dsn)) {
-       //      testdb($db,"create table ADOXYZ (id int, firstname varchar(24), lastname varchar(24),created date)");
-       } else print "ERROR: DB2 test requires an server setup with odbc data source db2_sample".'<BR>'.$db->ErrorMsg();
-
+ADOLoadCode("odbc_db2"); // no longer supported
+if (!empty($testdb2)) {
+       if (PHP_VERSION>=5.1) {
+               $db = ADONewConnection("db2");
+               print "<h1>Connecting $db->databaseType...</h1>";
+               
+               #$db->curMode = SQL_CUR_USE_ODBC;
+               #$dsn = "driver={IBM db2 odbc DRIVER};Database=test;hostname=localhost;port=50000;protocol=TCPIP; uid=natsoft; pwd=guest";
+               if ($db->Connect('localhost','natsoft','guest','test')) {
+                       testdb($db,"create table ADOXYZ (id int, firstname varchar(24), lastname varchar(24),created date)");
+               } else print "ERROR: DB2 test requires an server setup with odbc data source db2_sample".'<BR>'.$db->ErrorMsg();
+       } else { 
+               $db = ADONewConnection("odbc_db2");
+               print "<h1>Connecting $db->databaseType...</h1>";
+               
+               $dsn = "db2test";
+               #$db->curMode = SQL_CUR_USE_ODBC;
+               #$dsn = "driver={IBM db2 odbc DRIVER};Database=test;hostname=localhost;port=50000;protocol=TCPIP; uid=natsoft; pwd=guest";
+               if ($db->Connect($dsn)) {
+                       testdb($db,"create table ADOXYZ (id int, firstname varchar(24), lastname varchar(24),created date)");
+               } else print "ERROR: DB2 test requires an server setup with odbc data source db2_sample".'<BR>'.$db->ErrorMsg();
+       }
 echo "<hr />";
 flush();
        $dsn = "driver={IBM db2 odbc DRIVER};Database=sample;hostname=localhost;port=50000;protocol=TCPIP; uid=root; pwd=natsoft";
index 6c66d2b..a1d1f1c 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 
 /** 
- * @version V4.81 3 May 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
+ * @version V4.90 8 June 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
  * Released under both BSD license and Lesser GPL library license. 
  * Whenever there is any discrepancy between the two licenses, 
  * the BSD license will take precedence. 
index b05b3f9..43b2d59 100644 (file)
@@ -1,6 +1,6 @@
 <?php 
 /*
-  V4.81 3 May 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
+  V4.90 8 June 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence.
@@ -95,7 +95,7 @@ GLOBAL $gSQLMaxRows,$gSQLBlockRows,$ADODB_ROUND;
                        break;
                        
                        case 'N':
-                               if (abs($v) - round($v,0) < 0.00000001)
+                               if (abs(abs($v) - round($v,0)) < 0.00000001)
                                        $v = round($v);
                                else
                                        $v = round($v,$ADODB_ROUND);
index acb0454..e4b214e 100644 (file)
@@ -43,7 +43,7 @@
 
        // Build TYPO3 enviroment:
 $BACK_PATH='../../../typo3/';
-define('TYPO3_MOD_PATH', '../typo3conf/ext/adodb/');
+define('TYPO3_MOD_PATH', 'sysext/adodb/');
 require ($BACK_PATH.'init.php');
 require ($BACK_PATH.'template.php');
 
@@ -129,4 +129,4 @@ $SOBE = t3lib_div::makeInstance('tx_adodb_checkconnectionwizard');
 
 $SOBE->main();
 
-?>
\ No newline at end of file
+?>
index 07370f7..852d456 100644 (file)
@@ -3,6 +3,7 @@
 *  Copyright notice
 *
 *  (c) 2004 Robert Lemke (robert@typo3.org)
+*  (c) 2006 Karsten Dambekalns (karsten@typo3.org)
 *  All rights reserved
 *
 *  This script is part of the TYPO3 project. The TYPO3 project is
@@ -24,6 +25,7 @@
 
 /**
  * @author     Robert Lemke <robert@typo3.org>
+ * @author     Karsten Dambekalns <karsten@typo3.org>
  */
 class tx_adodb_tceforms {
 
@@ -32,6 +34,7 @@ class tx_adodb_tceforms {
                if (is_callable('odbc_error')) $params['items'][] = array ('ODBC', 'odbc');
                if (is_callable('mysql_error')) $params['items'][] = array ('MySQL', 'mysql');
                if (is_callable('mssql_connect')) $params['items'][] = array ('MSSQL', 'mssql');
+               if (is_callable('ocilogon')) $params['items'][] = array ('Oracle', 'oci8');
        }
 }
 
@@ -39,4 +42,4 @@ if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/adodb/c
        include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/adodb/class.tx_adodb_tceforms.php']);
 }
 
-?>
\ No newline at end of file
+?>
diff --git a/typo3/sysext/adodb/doc/490.DBAL.patch b/typo3/sysext/adodb/doc/490.DBAL.patch
new file mode 100644 (file)
index 0000000..3c940aa
--- /dev/null
@@ -0,0 +1,88 @@
+diff -urNw adodb490/adodb-lib.inc.php adodb/adodb-lib.inc.php
+--- adodb490/adodb-lib.inc.php 2006-06-08 08:20:17.000000000 +0200
++++ adodb/adodb-lib.inc.php    2006-06-26 16:52:28.000000000 +0200
+@@ -790,7 +790,7 @@
+       $values = substr($values, 0, -2);
+       // Append the fields and their values to the insert query.
+-      return 'INSERT INTO '.$tableName.' ( '.$fields.' ) VALUES ( '.$values.' )';
++      return 'INSERT INTO '.$zthis->nameQuote.$tableName.$zthis->nameQuote.' ( '.$fields.' ) VALUES ( '.$values.' )';
+ }
+diff -urNw adodb490/datadict/datadict-oci8.inc.php adodb/datadict/datadict-oci8.inc.php
+--- adodb490/datadict/datadict-oci8.inc.php    2006-06-08 08:19:58.000000000 +0200
++++ adodb/datadict/datadict-oci8.inc.php       2006-06-26 16:52:28.000000000 +0200
+@@ -251,8 +251,8 @@
+               }
+               
+               if ( is_array($flds) )
+-                      $flds = implode(', ',$flds);
+-              $s = 'CREATE' . $unique . ' INDEX ' . $idxname . ' ON ' . $tabname . ' (' . $flds . ')';
++                      $flds = implode('", "',$flds);
++              $s = 'CREATE' . $unique . ' INDEX "' . $idxname . '" ON "' .$tabname . '" ("' . $flds . '")';
+               
+               if ( isset($idxoptions[$this->upperName]) )
+                       $s .= $idxoptions[$this->upperName];
+diff -urNw adodb490/datadict/datadict-postgres.inc.php adodb/datadict/datadict-postgres.inc.php
+--- adodb490/datadict/datadict-postgres.inc.php        2006-06-08 08:19:57.000000000 +0200
++++ adodb/datadict/datadict-postgres.inc.php   2006-06-26 16:52:28.000000000 +0200
+@@ -342,7 +342,7 @@
+               
+               $unique = isset($idxoptions['UNIQUE']) ? ' UNIQUE' : '';
+               
+-              $s = 'CREATE' . $unique . ' INDEX ' . $idxname . ' ON ' . $tabname . ' ';
++              $s = 'CREATE' . $unique . ' INDEX "' . $idxname . '" ON "' . $tabname . '" ';
+               
+               if (isset($idxoptions['HASH']))
+                       $s .= 'USING HASH ';
+@@ -351,8 +351,8 @@
+                       $s .= $idxoptions[$this->upperName];
+               
+               if ( is_array($flds) )
+-                      $flds = implode(', ',$flds);
+-              $s .= '(' . $flds . ')';
++                      $flds = implode('", "',$flds);
++              $s .= '("' . $flds . '")';
+               $sql[] = $s;
+               
+               return $sql;
+diff -urNw adodb490/drivers/adodb-oci8.inc.php adodb/drivers/adodb-oci8.inc.php
+--- adodb490/drivers/adodb-oci8.inc.php        2006-06-08 08:20:15.000000000 +0200
++++ adodb/drivers/adodb-oci8.inc.php   2006-06-26 16:52:28.000000000 +0200
+@@ -104,7 +104,7 @@
+               $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
+               if ($this->fetchMode !== false) $savem = $this->SetFetchMode(false);
+               
+-              $rs = $this->Execute(sprintf($this->metaColumnsSQL,strtoupper($table)));
++              $rs = $this->Execute(sprintf($this->metaColumnsSQL,$table));
+               
+               if (isset($savem)) $this->SetFetchMode($savem);
+ q             $ADODB_FETCH_MODE = $save;
+diff -urNw adodb/datadict/datadict-oci8.inc.php adodb490/datadict/datadict-oci8.inc.php
+--- adodb490/datadict/datadict-oci8.inc.php    2006-06-26 17:05:13.000000000 +0200
++++ adodb/datadict/datadict-oci8.inc.php       2006-06-26 17:15:52.000000000 +0200
+@@ -109,7 +109,6 @@
+       function AddColumnSQL($tabname, $flds)
+       {
++              $tabname = $this->TableName ($tabname);
+               $f = array();
+               list($lines,$pkey) = $this->_GenFields($flds);
+               $s = "ALTER TABLE $tabname ADD (";
+@@ -124,7 +123,6 @@
+       function AlterColumnSQL($tabname, $flds)
+       {
++              $tabname = $this->TableName ($tabname);
+               $f = array();
+               list($lines,$pkey) = $this->_GenFields($flds);
+               $s = "ALTER TABLE $tabname MODIFY(";
+@@ -138,7 +136,6 @@
+       function DropColumnSQL($tabname, $flds)
+       {
++              $tabname = $this->TableName ($tabname);
+               if (!is_array($flds)) $flds = explode(',',$flds);
+               foreach ($flds as $k => $v) $flds[$k] = $this->NameQuote($v);
index 3f90649..49d5814 100644 (file)
@@ -3,7 +3,7 @@
 ########################################################################
 # Extension Manager/Repository config file for ext: "adodb"
 #
-# Auto generated 15-05-2006 14:25
+# Auto generated 26-06-2006 17:21
 #
 # Manual updates:
 # Only the data in the array - anything else is removed by next write.
@@ -32,8 +32,8 @@ $EM_CONF[$_EXTKEY] = array(
        'author_company' => 'TYPO3 Association',
        'CGLcompliance' => '',
        'CGLcompliance_note' => '',
-       'version' => '4.81.0',
-       '_md5_values_when_last_written' => 'a:251:{s:25:"checkconnectionwizard.php";s:4:"795b";s:27:"class.tx_adodb_tceforms.php";s:4:"e53a";s:26:"datasource_flexform_ds.xml";s:4:"96fb";s:12:"ext_icon.gif";s:4:"c778";s:17:"ext_localconf.php";s:4:"b58b";s:31:"locallang_datasource_config.xml";s:4:"0e21";s:20:"locallang_wizard.xml";s:4:"0e65";s:11:"CVS/Entries";s:4:"df35";s:14:"CVS/Repository";s:4:"bccf";s:8:"CVS/Root";s:4:"63b1";s:33:"adodb/adodb-active-record.inc.php";s:4:"c05d";s:26:"adodb/adodb-csvlib.inc.php";s:4:"4b7f";s:28:"adodb/adodb-datadict.inc.php";s:4:"a5d4";s:25:"adodb/adodb-error.inc.php";s:4:"60f7";s:32:"adodb/adodb-errorhandler.inc.php";s:4:"8729";s:29:"adodb/adodb-errorpear.inc.php";s:4:"6a84";s:30:"adodb/adodb-exceptions.inc.php";s:4:"6522";s:28:"adodb/adodb-iterator.inc.php";s:4:"8a4f";s:23:"adodb/adodb-lib.inc.php";s:4:"8a46";s:25:"adodb/adodb-pager.inc.php";s:4:"b03c";s:24:"adodb/adodb-pear.inc.php";s:4:"33c8";s:24:"adodb/adodb-perf.inc.php";s:4:"0174";s:24:"adodb/adodb-php4.inc.php";s:4:"fc43";s:24:"adodb/adodb-time.inc.php";s:4:"896a";s:29:"adodb/adodb-xmlschema.inc.php";s:4:"e457";s:31:"adodb/adodb-xmlschema03.inc.php";s:4:"e21a";s:19:"adodb/adodb.inc.php";s:4:"3cc6";s:17:"adodb/license.txt";s:4:"8bd7";s:24:"adodb/pivottable.inc.php";s:4:"c7b7";s:16:"adodb/readme.txt";s:4:"856d";s:22:"adodb/rsfilter.inc.php";s:4:"4353";s:16:"adodb/server.php";s:4:"e2de";s:22:"adodb/toexport.inc.php";s:4:"b7c2";s:20:"adodb/tohtml.inc.php";s:4:"ab36";s:19:"adodb/xmlschema.dtd";s:4:"26f3";s:21:"adodb/xmlschema03.dtd";s:4:"1cd4";s:17:"adodb/CVS/Entries";s:4:"4107";s:20:"adodb/CVS/Repository";s:4:"cd1a";s:14:"adodb/CVS/Root";s:4:"63b1";s:30:"adodb/contrib/toxmlrpc.inc.php";s:4:"4c40";s:25:"adodb/contrib/CVS/Entries";s:4:"553b";s:28:"adodb/contrib/CVS/Repository";s:4:"3c38";s:22:"adodb/contrib/CVS/Root";s:4:"63b1";s:35:"adodb/cute_icons_for_site/adodb.gif";s:4:"9430";s:36:"adodb/cute_icons_for_site/adodb2.gif";s:4:"f540";s:37:"adodb/cute_icons_for_site/CVS/Entries";s:4:"0c93";s:40:"adodb/cute_icons_for_site/CVS/Repository";s:4:"10d9";s:34:"adodb/cute_icons_for_site/CVS/Root";s:4:"63b1";s:38:"adodb/datadict/datadict-access.inc.php";s:4:"96c4";s:35:"adodb/datadict/datadict-db2.inc.php";s:4:"d6a7";s:40:"adodb/datadict/datadict-firebird.inc.php";s:4:"c446";s:39:"adodb/datadict/datadict-generic.inc.php";s:4:"0d0e";s:37:"adodb/datadict/datadict-ibase.inc.php";s:4:"e4fe";s:40:"adodb/datadict/datadict-informix.inc.php";s:4:"17eb";s:37:"adodb/datadict/datadict-mssql.inc.php";s:4:"43a0";s:37:"adodb/datadict/datadict-mysql.inc.php";s:4:"7c40";s:36:"adodb/datadict/datadict-oci8.inc.php";s:4:"45fb";s:40:"adodb/datadict/datadict-postgres.inc.php";s:4:"2c6f";s:37:"adodb/datadict/datadict-sapdb.inc.php";s:4:"50fa";s:38:"adodb/datadict/datadict-sybase.inc.php";s:4:"4d6d";s:26:"adodb/datadict/CVS/Entries";s:4:"c503";s:29:"adodb/datadict/CVS/Repository";s:4:"9e19";s:23:"adodb/datadict/CVS/Root";s:4:"63b1";s:33:"adodb/docs/docs-active-record.htm";s:4:"5736";s:25:"adodb/docs/docs-adodb.htm";s:4:"2afa";s:28:"adodb/docs/docs-datadict.htm";s:4:"c401";s:26:"adodb/docs/docs-oracle.htm";s:4:"fc24";s:24:"adodb/docs/docs-perf.htm";s:4:"d9a4";s:27:"adodb/docs/docs-session.htm";s:4:"eed6";s:28:"adodb/docs/old-changelog.htm";s:4:"3158";s:21:"adodb/docs/readme.htm";s:4:"9a0e";s:32:"adodb/docs/tips_portable_sql.htm";s:4:"4027";s:19:"adodb/docs/tute.htm";s:4:"691e";s:22:"adodb/docs/CVS/Entries";s:4:"0c7b";s:25:"adodb/docs/CVS/Repository";s:4:"ad28";s:19:"adodb/docs/CVS/Root";s:4:"63b1";s:34:"adodb/drivers/adodb-access.inc.php";s:4:"9902";s:31:"adodb/drivers/adodb-ado.inc.php";s:4:"425b";s:32:"adodb/drivers/adodb-ado5.inc.php";s:4:"5d6b";s:38:"adodb/drivers/adodb-ado_access.inc.php";s:4:"694f";s:37:"adodb/drivers/adodb-ado_mssql.inc.php";s:4:"1403";s:41:"adodb/drivers/adodb-borland_ibase.inc.php";s:4:"6ceb";s:31:"adodb/drivers/adodb-csv.inc.php";s:4:"ab4d";s:31:"adodb/drivers/adodb-db2.inc.php";s:4:"0c1f";s:33:"adodb/drivers/adodb-fbsql.inc.php";s:4:"eef7";s:36:"adodb/drivers/adodb-firebird.inc.php";s:4:"dca7";s:33:"adodb/drivers/adodb-ibase.inc.php";s:4:"8ce9";s:36:"adodb/drivers/adodb-informix.inc.php";s:4:"3d6e";s:38:"adodb/drivers/adodb-informix72.inc.php";s:4:"850a";s:32:"adodb/drivers/adodb-ldap.inc.php";s:4:"4f32";s:33:"adodb/drivers/adodb-mssql.inc.php";s:4:"32d3";s:35:"adodb/drivers/adodb-mssqlpo.inc.php";s:4:"fd33";s:33:"adodb/drivers/adodb-mysql.inc.php";s:4:"6fb5";s:34:"adodb/drivers/adodb-mysqli.inc.php";s:4:"7b56";s:34:"adodb/drivers/adodb-mysqlt.inc.php";s:4:"783c";s:35:"adodb/drivers/adodb-netezza.inc.php";s:4:"9a67";s:32:"adodb/drivers/adodb-oci8.inc.php";s:4:"27dc";s:34:"adodb/drivers/adodb-oci805.inc.php";s:4:"f820";s:34:"adodb/drivers/adodb-oci8po.inc.php";s:4:"5640";s:32:"adodb/drivers/adodb-odbc.inc.php";s:4:"7530";s:36:"adodb/drivers/adodb-odbc_db2.inc.php";s:4:"09d3";s:38:"adodb/drivers/adodb-odbc_mssql.inc.php";s:4:"2a62";s:39:"adodb/drivers/adodb-odbc_oracle.inc.php";s:4:"5678";s:33:"adodb/drivers/adodb-odbtp.inc.php";s:4:"8623";s:41:"adodb/drivers/adodb-odbtp_unicode.inc.php";s:4:"85eb";s:34:"adodb/drivers/adodb-oracle.inc.php";s:4:"6c98";s:31:"adodb/drivers/adodb-pdo.inc.php";s:4:"a14d";s:37:"adodb/drivers/adodb-pdo_mssql.inc.php";s:4:"347f";s:37:"adodb/drivers/adodb-pdo_mysql.inc.php";s:4:"c264";s:35:"adodb/drivers/adodb-pdo_oci.inc.php";s:4:"4467";s:37:"adodb/drivers/adodb-pdo_pgsql.inc.php";s:4:"3755";s:36:"adodb/drivers/adodb-postgres.inc.php";s:4:"b01a";s:38:"adodb/drivers/adodb-postgres64.inc.php";s:4:"21b0";s:37:"adodb/drivers/adodb-postgres7.inc.php";s:4:"d71f";s:37:"adodb/drivers/adodb-postgres8.inc.php";s:4:"ec1e";s:33:"adodb/drivers/adodb-proxy.inc.php";s:4:"c87a";s:33:"adodb/drivers/adodb-sapdb.inc.php";s:4:"fd6b";s:39:"adodb/drivers/adodb-sqlanywhere.inc.php";s:4:"0cba";s:34:"adodb/drivers/adodb-sqlite.inc.php";s:4:"e15e";s:36:"adodb/drivers/adodb-sqlitepo.inc.php";s:4:"6dba";s:34:"adodb/drivers/adodb-sybase.inc.php";s:4:"18e6";s:38:"adodb/drivers/adodb-sybase_ase.inc.php";s:4:"32bc";s:31:"adodb/drivers/adodb-vfp.inc.php";s:4:"efff";s:25:"adodb/drivers/CVS/Entries";s:4:"916d";s:28:"adodb/drivers/CVS/Repository";s:4:"7121";s:22:"adodb/drivers/CVS/Root";s:4:"63b1";s:27:"adodb/lang/adodb-ar.inc.php";s:4:"6f2a";s:27:"adodb/lang/adodb-bg.inc.php";s:4:"666d";s:31:"adodb/lang/adodb-bgutf8.inc.php";s:4:"6316";s:27:"adodb/lang/adodb-ca.inc.php";s:4:"96da";s:27:"adodb/lang/adodb-cn.inc.php";s:4:"155e";s:27:"adodb/lang/adodb-cz.inc.php";s:4:"6964";s:27:"adodb/lang/adodb-da.inc.php";s:4:"2ea2";s:27:"adodb/lang/adodb-de.inc.php";s:4:"26c5";s:27:"adodb/lang/adodb-en.inc.php";s:4:"0820";s:27:"adodb/lang/adodb-es.inc.php";s:4:"de07";s:34:"adodb/lang/adodb-esperanto.inc.php";s:4:"32b9";s:27:"adodb/lang/adodb-fr.inc.php";s:4:"dd47";s:27:"adodb/lang/adodb-hu.inc.php";s:4:"f308";s:27:"adodb/lang/adodb-it.inc.php";s:4:"15e2";s:27:"adodb/lang/adodb-nl.inc.php";s:4:"ed3d";s:27:"adodb/lang/adodb-pl.inc.php";s:4:"333e";s:30:"adodb/lang/adodb-pt-br.inc.php";s:4:"e973";s:27:"adodb/lang/adodb-ro.inc.php";s:4:"779e";s:31:"adodb/lang/adodb-ru1251.inc.php";s:4:"e828";s:27:"adodb/lang/adodb-sv.inc.php";s:4:"81fa";s:31:"adodb/lang/adodb-uk1251.inc.php";s:4:"3203";s:22:"adodb/lang/CVS/Entries";s:4:"9b74";s:25:"adodb/lang/CVS/Repository";s:4:"a65e";s:19:"adodb/lang/CVS/Root";s:4:"63b1";s:26:"adodb/pear/readme.Auth.txt";s:4:"4970";s:22:"adodb/pear/CVS/Entries";s:4:"3007";s:25:"adodb/pear/CVS/Repository";s:4:"a002";s:19:"adodb/pear/CVS/Root";s:4:"63b1";s:27:"adodb/pear/Auth/CVS/Entries";s:4:"38cc";s:30:"adodb/pear/Auth/CVS/Repository";s:4:"b224";s:24:"adodb/pear/Auth/CVS/Root";s:4:"63b1";s:35:"adodb/pear/Auth/Container/ADOdb.php";s:4:"50f8";s:37:"adodb/pear/Auth/Container/CVS/Entries";s:4:"60ab";s:40:"adodb/pear/Auth/Container/CVS/Repository";s:4:"4fb1";s:34:"adodb/pear/Auth/Container/CVS/Root";s:4:"63b1";s:27:"adodb/perf/perf-db2.inc.php";s:4:"530b";s:32:"adodb/perf/perf-informix.inc.php";s:4:"fa26";s:29:"adodb/perf/perf-mssql.inc.php";s:4:"df8b";s:29:"adodb/perf/perf-mysql.inc.php";s:4:"f532";s:28:"adodb/perf/perf-oci8.inc.php";s:4:"1f4c";s:32:"adodb/perf/perf-postgres.inc.php";s:4:"f1d5";s:22:"adodb/perf/CVS/Entries";s:4:"97b2";s:25:"adodb/perf/CVS/Repository";s:4:"dbc5";s:19:"adodb/perf/CVS/Root";s:4:"63b1";s:38:"adodb/session/adodb-compress-bzip2.php";s:4:"c087";s:37:"adodb/session/adodb-compress-gzip.php";s:4:"6153";s:36:"adodb/session/adodb-cryptsession.php";s:4:"22c6";s:38:"adodb/session/adodb-encrypt-mcrypt.php";s:4:"d482";s:35:"adodb/session/adodb-encrypt-md5.php";s:4:"8992";s:38:"adodb/session/adodb-encrypt-secret.php";s:4:"788b";s:36:"adodb/session/adodb-encrypt-sha1.php";s:4:"5c92";s:28:"adodb/session/adodb-sess.txt";s:4:"260b";s:36:"adodb/session/adodb-session-clob.php";s:4:"a297";s:31:"adodb/session/adodb-session.php";s:4:"c496";s:38:"adodb/session/adodb-sessions.mysql.sql";s:4:"42fe";s:44:"adodb/session/adodb-sessions.oracle.clob.sql";s:4:"3c64";s:39:"adodb/session/adodb-sessions.oracle.sql";s:4:"08d0";s:27:"adodb/session/crypt.inc.php";s:4:"4dad";s:32:"adodb/session/session_schema.xml";s:4:"6443";s:25:"adodb/session/CVS/Entries";s:4:"1a0f";s:28:"adodb/session/CVS/Repository";s:4:"7999";s:22:"adodb/session/CVS/Root";s:4:"63b1";s:40:"adodb/session/old/adodb-cryptsession.php";s:4:"0baa";s:40:"adodb/session/old/adodb-session-clob.php";s:4:"88e1";s:35:"adodb/session/old/adodb-session.php";s:4:"764b";s:31:"adodb/session/old/crypt.inc.php";s:4:"5a4e";s:29:"adodb/session/old/CVS/Entries";s:4:"5bc7";s:32:"adodb/session/old/CVS/Repository";s:4:"0805";s:26:"adodb/session/old/CVS/Root";s:4:"63b1";s:25:"adodb/tests/benchmark.php";s:4:"0c86";s:22:"adodb/tests/client.php";s:4:"bcce";s:19:"adodb/tests/pdo.php";s:4:"9688";s:18:"adodb/tests/rr.htm";s:4:"abeb";s:34:"adodb/tests/test-active-record.php";s:4:"c3ad";s:33:"adodb/tests/test-active-recs2.php";s:4:"ce96";s:29:"adodb/tests/test-datadict.php";s:4:"1c50";s:25:"adodb/tests/test-perf.php";s:4:"b95e";s:27:"adodb/tests/test-pgblob.php";s:4:"62b6";s:25:"adodb/tests/test-php5.php";s:4:"b804";s:30:"adodb/tests/test-xmlschema.php";s:4:"b467";s:20:"adodb/tests/test.php";s:4:"8b18";s:21:"adodb/tests/test2.php";s:4:"384b";s:21:"adodb/tests/test3.php";s:4:"dd69";s:21:"adodb/tests/test4.php";s:4:"5604";s:21:"adodb/tests/test5.php";s:4:"023a";s:29:"adodb/tests/test_rs_array.php";s:4:"1ccf";s:25:"adodb/tests/testcache.php";s:4:"1ff5";s:33:"adodb/tests/testdatabases.inc.php";s:4:"eacc";s:25:"adodb/tests/testgenid.php";s:4:"1576";s:25:"adodb/tests/testmssql.php";s:4:"42d3";s:24:"adodb/tests/testoci8.php";s:4:"e01d";s:30:"adodb/tests/testoci8cursor.php";s:4:"cf50";s:26:"adodb/tests/testpaging.php";s:4:"5e94";s:24:"adodb/tests/testpear.php";s:4:"83e8";s:28:"adodb/tests/testsessions.php";s:4:"3430";s:20:"adodb/tests/time.php";s:4:"b158";s:22:"adodb/tests/tmssql.php";s:4:"3d7a";s:31:"adodb/tests/xmlschema-mssql.xml";s:4:"5c70";s:25:"adodb/tests/xmlschema.xml";s:4:"19ca";s:23:"adodb/tests/CVS/Entries";s:4:"2685";s:26:"adodb/tests/CVS/Repository";s:4:"5257";s:20:"adodb/tests/CVS/Root";s:4:"63b1";s:29:"adodb/xsl/convert-0.1-0.2.xsl";s:4:"29d9";s:29:"adodb/xsl/convert-0.1-0.3.xsl";s:4:"6aad";s:29:"adodb/xsl/convert-0.2-0.1.xsl";s:4:"5d27";s:29:"adodb/xsl/convert-0.2-0.3.xsl";s:4:"4098";s:24:"adodb/xsl/remove-0.2.xsl";s:4:"0b2b";s:24:"adodb/xsl/remove-0.3.xsl";s:4:"678d";s:21:"adodb/xsl/CVS/Entries";s:4:"92f9";s:24:"adodb/xsl/CVS/Repository";s:4:"3cb3";s:18:"adodb/xsl/CVS/Root";s:4:"63b1";s:18:"doc/481.DBAL.patch";s:4:"19fa";s:10:"doc/README";s:4:"40a5";s:25:"doc/mssql-error-fix.patch";s:4:"8757";s:15:"doc/CVS/Entries";s:4:"4812";s:18:"doc/CVS/Repository";s:4:"f6db";s:12:"doc/CVS/Root";s:4:"63b1";s:26:"pi1/class.tx_adodb_pi1.php";s:4:"0414";s:15:"pi1/CVS/Entries";s:4:"b111";s:18:"pi1/CVS/Repository";s:4:"745a";s:12:"pi1/CVS/Root";s:4:"63b1";s:23:"res/checkconnection.gif";s:4:"1760";s:15:"res/CVS/Entries";s:4:"229e";s:18:"res/CVS/Repository";s:4:"442c";s:12:"res/CVS/Root";s:4:"63b1";}',
+       'version' => '4.90.0',
+       '_md5_values_when_last_written' => 'a:251:{s:25:"checkconnectionwizard.php";s:4:"795b";s:27:"class.tx_adodb_tceforms.php";s:4:"e53a";s:26:"datasource_flexform_ds.xml";s:4:"96fb";s:12:"ext_icon.gif";s:4:"c778";s:17:"ext_localconf.php";s:4:"b58b";s:31:"locallang_datasource_config.xml";s:4:"0e21";s:20:"locallang_wizard.xml";s:4:"0e65";s:11:"CVS/Entries";s:4:"91f3";s:14:"CVS/Repository";s:4:"bccf";s:8:"CVS/Root";s:4:"63b1";s:33:"adodb/adodb-active-record.inc.php";s:4:"f199";s:26:"adodb/adodb-csvlib.inc.php";s:4:"a61e";s:28:"adodb/adodb-datadict.inc.php";s:4:"a0c9";s:25:"adodb/adodb-error.inc.php";s:4:"aa4e";s:32:"adodb/adodb-errorhandler.inc.php";s:4:"d4aa";s:29:"adodb/adodb-errorpear.inc.php";s:4:"29e7";s:30:"adodb/adodb-exceptions.inc.php";s:4:"39c3";s:28:"adodb/adodb-iterator.inc.php";s:4:"b257";s:23:"adodb/adodb-lib.inc.php";s:4:"0826";s:25:"adodb/adodb-pager.inc.php";s:4:"1a5e";s:24:"adodb/adodb-pear.inc.php";s:4:"d3fa";s:24:"adodb/adodb-perf.inc.php";s:4:"1788";s:24:"adodb/adodb-php4.inc.php";s:4:"5a1f";s:24:"adodb/adodb-time.inc.php";s:4:"896a";s:29:"adodb/adodb-xmlschema.inc.php";s:4:"e457";s:31:"adodb/adodb-xmlschema03.inc.php";s:4:"e21a";s:19:"adodb/adodb.inc.php";s:4:"2313";s:17:"adodb/license.txt";s:4:"8bd7";s:24:"adodb/pivottable.inc.php";s:4:"b694";s:16:"adodb/readme.txt";s:4:"856d";s:22:"adodb/rsfilter.inc.php";s:4:"4ef2";s:16:"adodb/server.php";s:4:"751f";s:22:"adodb/toexport.inc.php";s:4:"db65";s:20:"adodb/tohtml.inc.php";s:4:"4483";s:19:"adodb/xmlschema.dtd";s:4:"26f3";s:21:"adodb/xmlschema03.dtd";s:4:"1cd4";s:17:"adodb/CVS/Entries";s:4:"c41e";s:20:"adodb/CVS/Repository";s:4:"cd1a";s:14:"adodb/CVS/Root";s:4:"63b1";s:30:"adodb/contrib/toxmlrpc.inc.php";s:4:"4c40";s:25:"adodb/contrib/CVS/Entries";s:4:"5bc1";s:28:"adodb/contrib/CVS/Repository";s:4:"3c38";s:22:"adodb/contrib/CVS/Root";s:4:"63b1";s:35:"adodb/cute_icons_for_site/adodb.gif";s:4:"9430";s:36:"adodb/cute_icons_for_site/adodb2.gif";s:4:"f540";s:37:"adodb/cute_icons_for_site/CVS/Entries";s:4:"0aa2";s:40:"adodb/cute_icons_for_site/CVS/Repository";s:4:"10d9";s:34:"adodb/cute_icons_for_site/CVS/Root";s:4:"63b1";s:38:"adodb/datadict/datadict-access.inc.php";s:4:"f2f0";s:35:"adodb/datadict/datadict-db2.inc.php";s:4:"fbb5";s:40:"adodb/datadict/datadict-firebird.inc.php";s:4:"9093";s:39:"adodb/datadict/datadict-generic.inc.php";s:4:"8e91";s:37:"adodb/datadict/datadict-ibase.inc.php";s:4:"61a6";s:40:"adodb/datadict/datadict-informix.inc.php";s:4:"becc";s:37:"adodb/datadict/datadict-mssql.inc.php";s:4:"dae6";s:37:"adodb/datadict/datadict-mysql.inc.php";s:4:"2c7b";s:36:"adodb/datadict/datadict-oci8.inc.php";s:4:"f6b4";s:40:"adodb/datadict/datadict-postgres.inc.php";s:4:"320b";s:37:"adodb/datadict/datadict-sapdb.inc.php";s:4:"50fa";s:38:"adodb/datadict/datadict-sybase.inc.php";s:4:"902c";s:26:"adodb/datadict/CVS/Entries";s:4:"db9c";s:29:"adodb/datadict/CVS/Repository";s:4:"9e19";s:23:"adodb/datadict/CVS/Root";s:4:"63b1";s:33:"adodb/docs/docs-active-record.htm";s:4:"4ec5";s:25:"adodb/docs/docs-adodb.htm";s:4:"640d";s:28:"adodb/docs/docs-datadict.htm";s:4:"97d6";s:26:"adodb/docs/docs-oracle.htm";s:4:"2c7d";s:24:"adodb/docs/docs-perf.htm";s:4:"45d8";s:27:"adodb/docs/docs-session.htm";s:4:"f2d6";s:28:"adodb/docs/old-changelog.htm";s:4:"3158";s:21:"adodb/docs/readme.htm";s:4:"9a0e";s:32:"adodb/docs/tips_portable_sql.htm";s:4:"4027";s:19:"adodb/docs/tute.htm";s:4:"691e";s:22:"adodb/docs/CVS/Entries";s:4:"5054";s:25:"adodb/docs/CVS/Repository";s:4:"ad28";s:19:"adodb/docs/CVS/Root";s:4:"63b1";s:34:"adodb/drivers/adodb-access.inc.php";s:4:"7c8c";s:31:"adodb/drivers/adodb-ado.inc.php";s:4:"0aa0";s:32:"adodb/drivers/adodb-ado5.inc.php";s:4:"0852";s:38:"adodb/drivers/adodb-ado_access.inc.php";s:4:"fee1";s:37:"adodb/drivers/adodb-ado_mssql.inc.php";s:4:"3fda";s:41:"adodb/drivers/adodb-borland_ibase.inc.php";s:4:"2de7";s:31:"adodb/drivers/adodb-csv.inc.php";s:4:"e453";s:31:"adodb/drivers/adodb-db2.inc.php";s:4:"614b";s:33:"adodb/drivers/adodb-fbsql.inc.php";s:4:"c2c1";s:36:"adodb/drivers/adodb-firebird.inc.php";s:4:"ffaa";s:33:"adodb/drivers/adodb-ibase.inc.php";s:4:"dc96";s:36:"adodb/drivers/adodb-informix.inc.php";s:4:"6890";s:38:"adodb/drivers/adodb-informix72.inc.php";s:4:"6fc9";s:32:"adodb/drivers/adodb-ldap.inc.php";s:4:"43d7";s:33:"adodb/drivers/adodb-mssql.inc.php";s:4:"adc3";s:35:"adodb/drivers/adodb-mssqlpo.inc.php";s:4:"a29a";s:33:"adodb/drivers/adodb-mysql.inc.php";s:4:"e9aa";s:34:"adodb/drivers/adodb-mysqli.inc.php";s:4:"2686";s:34:"adodb/drivers/adodb-mysqlt.inc.php";s:4:"ac71";s:35:"adodb/drivers/adodb-netezza.inc.php";s:4:"bcec";s:32:"adodb/drivers/adodb-oci8.inc.php";s:4:"7354";s:34:"adodb/drivers/adodb-oci805.inc.php";s:4:"545b";s:34:"adodb/drivers/adodb-oci8po.inc.php";s:4:"372e";s:32:"adodb/drivers/adodb-odbc.inc.php";s:4:"1970";s:36:"adodb/drivers/adodb-odbc_db2.inc.php";s:4:"182b";s:38:"adodb/drivers/adodb-odbc_mssql.inc.php";s:4:"ca70";s:39:"adodb/drivers/adodb-odbc_oracle.inc.php";s:4:"3500";s:33:"adodb/drivers/adodb-odbtp.inc.php";s:4:"655a";s:41:"adodb/drivers/adodb-odbtp_unicode.inc.php";s:4:"29b5";s:34:"adodb/drivers/adodb-oracle.inc.php";s:4:"2b2a";s:31:"adodb/drivers/adodb-pdo.inc.php";s:4:"8883";s:37:"adodb/drivers/adodb-pdo_mssql.inc.php";s:4:"7ddc";s:37:"adodb/drivers/adodb-pdo_mysql.inc.php";s:4:"a2c7";s:35:"adodb/drivers/adodb-pdo_oci.inc.php";s:4:"e96d";s:37:"adodb/drivers/adodb-pdo_pgsql.inc.php";s:4:"df33";s:36:"adodb/drivers/adodb-postgres.inc.php";s:4:"f2ae";s:38:"adodb/drivers/adodb-postgres64.inc.php";s:4:"9813";s:37:"adodb/drivers/adodb-postgres7.inc.php";s:4:"220e";s:37:"adodb/drivers/adodb-postgres8.inc.php";s:4:"4af9";s:33:"adodb/drivers/adodb-proxy.inc.php";s:4:"1461";s:33:"adodb/drivers/adodb-sapdb.inc.php";s:4:"5727";s:39:"adodb/drivers/adodb-sqlanywhere.inc.php";s:4:"e638";s:34:"adodb/drivers/adodb-sqlite.inc.php";s:4:"a79c";s:36:"adodb/drivers/adodb-sqlitepo.inc.php";s:4:"a3a7";s:34:"adodb/drivers/adodb-sybase.inc.php";s:4:"fae1";s:38:"adodb/drivers/adodb-sybase_ase.inc.php";s:4:"8f64";s:31:"adodb/drivers/adodb-vfp.inc.php";s:4:"3510";s:25:"adodb/drivers/CVS/Entries";s:4:"a874";s:28:"adodb/drivers/CVS/Repository";s:4:"7121";s:22:"adodb/drivers/CVS/Root";s:4:"63b1";s:27:"adodb/lang/adodb-ar.inc.php";s:4:"6f2a";s:27:"adodb/lang/adodb-bg.inc.php";s:4:"666d";s:31:"adodb/lang/adodb-bgutf8.inc.php";s:4:"6316";s:27:"adodb/lang/adodb-ca.inc.php";s:4:"96da";s:27:"adodb/lang/adodb-cn.inc.php";s:4:"155e";s:27:"adodb/lang/adodb-cz.inc.php";s:4:"6964";s:27:"adodb/lang/adodb-da.inc.php";s:4:"2ea2";s:27:"adodb/lang/adodb-de.inc.php";s:4:"26c5";s:27:"adodb/lang/adodb-en.inc.php";s:4:"0820";s:27:"adodb/lang/adodb-es.inc.php";s:4:"de07";s:34:"adodb/lang/adodb-esperanto.inc.php";s:4:"32b9";s:27:"adodb/lang/adodb-fr.inc.php";s:4:"dd47";s:27:"adodb/lang/adodb-hu.inc.php";s:4:"f308";s:27:"adodb/lang/adodb-it.inc.php";s:4:"15e2";s:27:"adodb/lang/adodb-nl.inc.php";s:4:"ed3d";s:27:"adodb/lang/adodb-pl.inc.php";s:4:"333e";s:30:"adodb/lang/adodb-pt-br.inc.php";s:4:"e973";s:27:"adodb/lang/adodb-ro.inc.php";s:4:"779e";s:31:"adodb/lang/adodb-ru1251.inc.php";s:4:"e828";s:27:"adodb/lang/adodb-sv.inc.php";s:4:"81fa";s:31:"adodb/lang/adodb-uk1251.inc.php";s:4:"3203";s:22:"adodb/lang/CVS/Entries";s:4:"dfda";s:25:"adodb/lang/CVS/Repository";s:4:"a65e";s:19:"adodb/lang/CVS/Root";s:4:"63b1";s:26:"adodb/pear/readme.Auth.txt";s:4:"4970";s:22:"adodb/pear/CVS/Entries";s:4:"ccc4";s:25:"adodb/pear/CVS/Repository";s:4:"a002";s:19:"adodb/pear/CVS/Root";s:4:"63b1";s:27:"adodb/pear/Auth/CVS/Entries";s:4:"38cc";s:30:"adodb/pear/Auth/CVS/Repository";s:4:"b224";s:24:"adodb/pear/Auth/CVS/Root";s:4:"63b1";s:35:"adodb/pear/Auth/Container/ADOdb.php";s:4:"50f8";s:37:"adodb/pear/Auth/Container/CVS/Entries";s:4:"3b34";s:40:"adodb/pear/Auth/Container/CVS/Repository";s:4:"4fb1";s:34:"adodb/pear/Auth/Container/CVS/Root";s:4:"63b1";s:27:"adodb/perf/perf-db2.inc.php";s:4:"26b7";s:32:"adodb/perf/perf-informix.inc.php";s:4:"8948";s:29:"adodb/perf/perf-mssql.inc.php";s:4:"94ff";s:29:"adodb/perf/perf-mysql.inc.php";s:4:"6273";s:28:"adodb/perf/perf-oci8.inc.php";s:4:"7104";s:32:"adodb/perf/perf-postgres.inc.php";s:4:"e010";s:22:"adodb/perf/CVS/Entries";s:4:"daba";s:25:"adodb/perf/CVS/Repository";s:4:"dbc5";s:19:"adodb/perf/CVS/Root";s:4:"63b1";s:38:"adodb/session/adodb-compress-bzip2.php";s:4:"0971";s:37:"adodb/session/adodb-compress-gzip.php";s:4:"7497";s:36:"adodb/session/adodb-cryptsession.php";s:4:"ef9f";s:38:"adodb/session/adodb-encrypt-mcrypt.php";s:4:"99ba";s:35:"adodb/session/adodb-encrypt-md5.php";s:4:"e61d";s:38:"adodb/session/adodb-encrypt-secret.php";s:4:"f28d";s:36:"adodb/session/adodb-encrypt-sha1.php";s:4:"5c92";s:28:"adodb/session/adodb-sess.txt";s:4:"260b";s:36:"adodb/session/adodb-session-clob.php";s:4:"ba1b";s:31:"adodb/session/adodb-session.php";s:4:"ab3e";s:38:"adodb/session/adodb-sessions.mysql.sql";s:4:"42fe";s:44:"adodb/session/adodb-sessions.oracle.clob.sql";s:4:"3c64";s:39:"adodb/session/adodb-sessions.oracle.sql";s:4:"08d0";s:27:"adodb/session/crypt.inc.php";s:4:"4dad";s:32:"adodb/session/session_schema.xml";s:4:"6443";s:25:"adodb/session/CVS/Entries";s:4:"3fe7";s:28:"adodb/session/CVS/Repository";s:4:"7999";s:22:"adodb/session/CVS/Root";s:4:"63b1";s:40:"adodb/session/old/adodb-cryptsession.php";s:4:"506f";s:40:"adodb/session/old/adodb-session-clob.php";s:4:"4dc3";s:35:"adodb/session/old/adodb-session.php";s:4:"3680";s:31:"adodb/session/old/crypt.inc.php";s:4:"5a4e";s:29:"adodb/session/old/CVS/Entries";s:4:"7114";s:32:"adodb/session/old/CVS/Repository";s:4:"0805";s:26:"adodb/session/old/CVS/Root";s:4:"63b1";s:25:"adodb/tests/benchmark.php";s:4:"0c86";s:22:"adodb/tests/client.php";s:4:"bcce";s:19:"adodb/tests/pdo.php";s:4:"9688";s:18:"adodb/tests/rr.htm";s:4:"abeb";s:34:"adodb/tests/test-active-record.php";s:4:"c3ad";s:33:"adodb/tests/test-active-recs2.php";s:4:"2f5e";s:29:"adodb/tests/test-datadict.php";s:4:"1c50";s:25:"adodb/tests/test-perf.php";s:4:"b95e";s:27:"adodb/tests/test-pgblob.php";s:4:"62b6";s:25:"adodb/tests/test-php5.php";s:4:"b804";s:30:"adodb/tests/test-xmlschema.php";s:4:"b467";s:20:"adodb/tests/test.php";s:4:"14ea";s:21:"adodb/tests/test2.php";s:4:"384b";s:21:"adodb/tests/test3.php";s:4:"dd69";s:21:"adodb/tests/test4.php";s:4:"5604";s:21:"adodb/tests/test5.php";s:4:"023a";s:29:"adodb/tests/test_rs_array.php";s:4:"1ccf";s:25:"adodb/tests/testcache.php";s:4:"1ff5";s:33:"adodb/tests/testdatabases.inc.php";s:4:"82f6";s:25:"adodb/tests/testgenid.php";s:4:"1576";s:25:"adodb/tests/testmssql.php";s:4:"42d3";s:24:"adodb/tests/testoci8.php";s:4:"e01d";s:30:"adodb/tests/testoci8cursor.php";s:4:"cf50";s:26:"adodb/tests/testpaging.php";s:4:"5e94";s:24:"adodb/tests/testpear.php";s:4:"83e8";s:28:"adodb/tests/testsessions.php";s:4:"3430";s:20:"adodb/tests/time.php";s:4:"b158";s:22:"adodb/tests/tmssql.php";s:4:"3d7a";s:31:"adodb/tests/xmlschema-mssql.xml";s:4:"5c70";s:25:"adodb/tests/xmlschema.xml";s:4:"19ca";s:23:"adodb/tests/CVS/Entries";s:4:"9cd8";s:26:"adodb/tests/CVS/Repository";s:4:"5257";s:20:"adodb/tests/CVS/Root";s:4:"63b1";s:29:"adodb/xsl/convert-0.1-0.2.xsl";s:4:"29d9";s:29:"adodb/xsl/convert-0.1-0.3.xsl";s:4:"6aad";s:29:"adodb/xsl/convert-0.2-0.1.xsl";s:4:"5d27";s:29:"adodb/xsl/convert-0.2-0.3.xsl";s:4:"4098";s:24:"adodb/xsl/remove-0.2.xsl";s:4:"0b2b";s:24:"adodb/xsl/remove-0.3.xsl";s:4:"678d";s:21:"adodb/xsl/CVS/Entries";s:4:"3b49";s:24:"adodb/xsl/CVS/Repository";s:4:"3cb3";s:18:"adodb/xsl/CVS/Root";s:4:"63b1";s:18:"doc/490.DBAL.patch";s:4:"2037";s:10:"doc/README";s:4:"40a5";s:25:"doc/mssql-error-fix.patch";s:4:"8757";s:15:"doc/CVS/Entries";s:4:"08e8";s:18:"doc/CVS/Repository";s:4:"f6db";s:12:"doc/CVS/Root";s:4:"63b1";s:26:"pi1/class.tx_adodb_pi1.php";s:4:"0414";s:15:"pi1/CVS/Entries";s:4:"b111";s:18:"pi1/CVS/Repository";s:4:"745a";s:12:"pi1/CVS/Root";s:4:"63b1";s:23:"res/checkconnection.gif";s:4:"1760";s:15:"res/CVS/Entries";s:4:"229e";s:18:"res/CVS/Repository";s:4:"442c";s:12:"res/CVS/Root";s:4:"63b1";}',
        'constraints' => array(
                'depends' => array(
                        'php' => '4.1.0-',
index 64d7c89..7b660ea 100644 (file)
@@ -1,16 +1,13 @@
 <?php
 if (!defined ('TYPO3_MODE'))   die ('Access denied.');
 
-t3lib_extMgm::addPItoST43($_EXTKEY,'pi1/class.tx_adodb_pi1.php','_pi1','',1);
-
 require_once (t3lib_extMgm::extPath('adodb').'class.tx_adodb_tceforms.php');
 
        // Register as a data source application if the extension datasources is loaded:
 if (t3lib_extMgm::isLoaded ('datasources')) {
        require_once (t3lib_extMgm::extPath('datasources').'class.tx_datasources_main.php');
        $dataSourcesMainObj = &t3lib_div::getUserObj('EXT:datasources/class.tx_datasources_main.php:&tx_datasources_main');
-       $dataSourcesMainObj->registerApplication ('ADO DB', 'adodb');
+       $dataSourcesMainObj->registerApplication ('ADOdb', 'adodb');
 }
 
-
-?>
\ No newline at end of file
+?>
index a85c5a0..1301796 100644 (file)
@@ -1,3 +1,10 @@
+2006-06-16  Karsten Dambekalns <karsten@typo3.org>
+
+       * Implemented support for t3lib_div::sysLog() on connection failure
+       * DBAL now honours the no_pconnect setting
+       * XCLASSed t3lib_pageSelect to fix fe_group check on Oracle, using IS NULL
+       * For handlers in native mode the setDBinit queries are executed upon connection
+
 2006-01-19  Karsten Dambekalns <karsten@typo3.org>
 
        * Changes to connection handling, detecting failed connections.
@@ -55,7 +62,7 @@
        * Fixed a bug in t3lib_page, getMultipleGroupsWhereClause()
        where double quotes were used to quote a literal for use in
        SQL. THIS IS MYSQL-ONLY! NEVER DO THIS! ALWAYS USE SINGLE
-       QUOTES! 
+       QUOTES!
 
 2005-06-07  Karsten Dambekalns <karsten@typo3.org>
 
index f029b76..628ed65 100644 (file)
@@ -2,7 +2,7 @@
 /***************************************************************
 *  Copyright notice
 *
-*  (c) 2004 Kasper Skaarhoj (kasper@typo3.com)
+*  (c) 2004-2006 Kasper Skaarhoj (kasperYYYY@typo3.com)
 *  All rights reserved
 *
 *  This script is part of the TYPO3 project. The TYPO3 project is
 
 require_once(PATH_t3lib.'class.t3lib_sqlengine.php');
 require_once(PATH_t3lib.'class.t3lib_install.php');
-//require_once(t3lib_extMgm::extPath('install').'mod/class.tx_install.php');
 
 /**
  * TYPO3 database abstraction layer
@@ -127,23 +126,24 @@ require_once(PATH_t3lib.'class.t3lib_install.php');
 class ux_t3lib_DB extends t3lib_DB {
 
        // Internal, static:
-       var $printErrors = FALSE;                       // Enable output of SQL errors after query executions. Set through TYPO3_CONF_VARS, see init()
-       var $debug = FALSE;                                     // Enable debug mode. Set through TYPO3_CONF_VARS, see init()
-       var $conf = array();                            // Configuration array, copied from TYPO3_CONF_VARS in constructor.
+       var $printErrors = false;               // Enable output of SQL errors after query executions. Set through TYPO3_CONF_VARS, see init()
+       var $debug = false;                     // Enable debug mode. Set through TYPO3_CONF_VARS, see init()
+       var $conf = array();                    // Configuration array, copied from TYPO3_CONF_VARS in constructor.
 
-       var $mapping = array();                         // See manual.
+       var $mapping = array();                 // See manual.
        var $table2handlerKeys = array();       // See manual.
-       var $handlerCfg = array (                       // See manual.
-       '_DEFAULT' => array (
-       'type' => 'native',
-       'config' => array(
-       'username' => '',               // Set by default (overridden)
-       'password' => '',               // Set by default (overridden)
-       'host' => '',                   // Set by default (overridden)
-       'database' => '',               // Set by default (overridden)
-       'driver' => '',                 // ONLY "adodb" type; eg. "mysql"
-       )
-       ),
+       var $handlerCfg = array (               // See manual.
+           '_DEFAULT' => array (
+                               'type' => 'native',
+                               'config' => array(
+                                   'username' => '',           // Set by default (overridden)
+                                   'password' => '',           // Set by default (overridden)
+                                   'host' => '',               // Set by default (overridden)
+                                   'database' => '',           // Set by default (overridden)
+                                   'driver' => '',             // ONLY "adodb" type; eg. "mysql"
+                                   'sequenceStart' => 1 // ONLY "adodb", first number in sequences/serials/...
+                               )
+           ),
        );
 
 
@@ -151,7 +151,7 @@ class ux_t3lib_DB extends t3lib_DB {
        var $handlerInstance = array();                         // Contains instance of the handler objects as they are created. Exception is the native mySQL calls which are registered as an array with keys "handlerType" = "native" and "link" pointing to the link resource for the connection.
        var $lastHandlerKey = '';                                       // Storage of the handler key of last ( SELECT) query - used for subsequent fetch-row calls etc.
        var $lastQuery = '';                                            // Storage of last SELECT query
-       var $lastParsedAndMappedQueryArray=array();     // Query array, the last one parsed
+       var $lastParsedAndMappedQueryArray = array();   // Query array, the last one parsed
 
        var $resourceIdToTableNameMap = array();        // Mapping of resource ids to table names.
 
@@ -164,8 +164,6 @@ class ux_t3lib_DB extends t3lib_DB {
 
 
 
-
-
        /**
         * Constructor.
         * Creates SQL parser object and imports configuration from $TYPO3_CONF_VARS['EXTCONF']['dbal']
@@ -366,8 +364,8 @@ class ux_t3lib_DB extends t3lib_DB {
                                }
                                break;
                        case 'adodb':
-                               // auto generate ID for auto_increment fields if not present (static import needs this!)
-                               // should we check the table name here (static_*)?
+                                       // auto generate ID for auto_increment fields if not present (static import needs this!)
+                                       // should we check the table name here (static_*)?
                                if(isset($this->cache_autoIncFields[$table])) {
                                        if(isset($fields_values[$this->cache_autoIncFields[$table]])) {
                                                $new_id = $fields_values[$this->cache_autoIncFields[$table]];
@@ -375,7 +373,7 @@ class ux_t3lib_DB extends t3lib_DB {
                                                        $this->handlerInstance[$this->lastHandlerKey]->last_insert_id = $new_id;
                                                }
                                        } else {
-                                               $new_id = $this->handlerInstance[$this->lastHandlerKey]->GenID($table.'_'.$this->cache_autoIncFields[$table]);
+                                               $new_id = $this->handlerInstance[$this->lastHandlerKey]->GenID($table.'_'.$this->cache_autoIncFields[$table], $this->handlerInstance[$this->lastHandlerKey]->sequenceStart);
                                                $fields_values[$this->cache_autoIncFields[$table]] = $new_id;
                                                if($table !== 'tx_dbal_debuglog') {
                                                        $this->handlerInstance[$this->lastHandlerKey]->last_insert_id = $new_id;
@@ -388,7 +386,8 @@ class ux_t3lib_DB extends t3lib_DB {
                                        $sqlResult = $this->handlerInstance[$this->lastHandlerKey]->_query($this->lastQuery,false);
                                } else {
                                        $this->handlerInstance[$this->lastHandlerKey]->StartTrans();
-                                       $sqlResult = $this->handlerInstance[$this->lastHandlerKey]->_query($this->lastQuery[0],false);
+                                       if(strlen($this->lastQuery[0]))
+                                               $sqlResult = $this->handlerInstance[$this->lastHandlerKey]->_query($this->lastQuery[0],false);
                                        foreach($this->lastQuery[1] as $field => $content) {
                                                if(empty($content)) continue;
 
@@ -421,16 +420,16 @@ class ux_t3lib_DB extends t3lib_DB {
 
                if ($this->debug)       {
                        $this->debugHandler(
-                       'exec_INSERTquery',
-                       t3lib_div::milliseconds()-$pt,
-                       array(
-                       'handlerType' => $hType,
-                       'args' => array($table,$fields_values),
-                       'ORIG_tablename' => $ORIG_tableName
-                       )
+                               'exec_INSERTquery',
+                               t3lib_div::milliseconds()-$pt,
+                               array(
+                                       'handlerType' => $hType,
+                                       'args' => array($table,$fields_values),
+                                       'ORIG_tablename' => $ORIG_tableName
+                               )
                        );
                }
-               // Return output:
+                       // Return output:
                return $sqlResult;
        }
 
@@ -486,7 +485,8 @@ class ux_t3lib_DB extends t3lib_DB {
                                        $sqlResult = $this->handlerInstance[$this->lastHandlerKey]->_query($this->lastQuery,false);
                                } else {
                                        $this->handlerInstance[$this->lastHandlerKey]->StartTrans();
-                                       $sqlResult = $this->handlerInstance[$this->lastHandlerKey]->_query($this->lastQuery[0],false);
+                                       if(strlen($this->lastQuery[0]))
+                                               $sqlResult = $this->handlerInstance[$this->lastHandlerKey]->_query($this->lastQuery[0],false);
                                        foreach($this->lastQuery[1] as $field => $content) {
                                                $this->handlerInstance[$this->lastHandlerKey]->UpdateBlob($this->quoteFromTables($table),$field,$content,$this->quoteWhereClause($where));
                                        }
@@ -504,17 +504,17 @@ class ux_t3lib_DB extends t3lib_DB {
 
                if ($this->debug)       {
                        $this->debugHandler(
-                       'exec_UPDATEquery',
-                       t3lib_div::milliseconds()-$pt,
-                       array(
-                       'handlerType' => $hType,
-                       'args' => array($table,$where, $fields_values),
-                       'ORIG_from_table' => $ORIG_tableName
-                       )
+                               'exec_UPDATEquery',
+                               t3lib_div::milliseconds()-$pt,
+                               array(
+                                       'handlerType' => $hType,
+                                       'args' => array($table,$where, $fields_values),
+                                       'ORIG_from_table' => $ORIG_tableName
+                               )
                        );
                }
 
-               // Return result:
+                       // Return result:
                return $sqlResult;
        }
 
@@ -529,22 +529,22 @@ class ux_t3lib_DB extends t3lib_DB {
 
                if ($this->debug)       $pt = t3lib_div::milliseconds();
 
-               // Do table/field mapping:
+                       // Do table/field mapping:
                $ORIG_tableName = $table;
                if ($tableArray = $this->map_needMapping($table))       {
 
-                       // Where clause:
+                               // Where clause:
                        $whereParts = $this->SQLparser->parseWhereClause($where);
                        $this->map_sqlParts($whereParts,$tableArray[0]['table']);
                        $where = $this->SQLparser->compileWhereClause($whereParts);
 
-                       // Table name:
+                               // Table name:
                        if ($this->mapping[$table]['mapTableName'])     {
                                $table = $this->mapping[$table]['mapTableName'];
                        }
                }
 
-               // Select API
+                       // Select API
                $this->lastHandlerKey = $this->handler_getFromTableList($ORIG_tableName);
                switch((string)$this->handlerCfg[$this->lastHandlerKey]['type'])        {
                        case 'native':
@@ -566,17 +566,17 @@ class ux_t3lib_DB extends t3lib_DB {
 
                if ($this->debug)       {
                        $this->debugHandler(
-                       'exec_DELETEquery',
-                       t3lib_div::milliseconds()-$pt,
-                       array(
-                       'handlerType' => $hType,
-                       'args' => array($table,$where),
-                       'ORIG_from_table' => $ORIG_tableName
-                       )
+                               'exec_DELETEquery',
+                               t3lib_div::milliseconds()-$pt,
+                               array(
+                                       'handlerType' => $hType,
+                                       'args' => array($table,$where),
+                                       'ORIG_from_table' => $ORIG_tableName
+                               )
                        );
                }
 
-               // Return result:
+                       // Return result:
                return $sqlResult;
        }
 
@@ -595,13 +595,13 @@ class ux_t3lib_DB extends t3lib_DB {
 
                if ($this->debug)       $pt = t3lib_div::milliseconds();
 
-               // Map table / field names if needed:
+                       // Map table / field names if needed:
                $ORIG_tableName = $from_table;  // Saving table names in $ORIG_from_table since $from_table is transformed beneath:
                if ($tableArray = $this->map_needMapping($ORIG_tableName))      {
                        $this->map_remapSELECTQueryParts($select_fields,$from_table,$where_clause,$groupBy,$orderBy);   // Variables passed by reference!
                }
 
-               // Get handler key and select API:
+                       // Get handler key and select API:
                $this->lastHandlerKey = $this->handler_getFromTableList($ORIG_tableName);
                $hType = (string)$this->handlerCfg[$this->lastHandlerKey]['type'];
                switch($hType)  {
@@ -645,17 +645,17 @@ class ux_t3lib_DB extends t3lib_DB {
 
                if ($this->debug)       {
                        $this->debugHandler(
-                       'exec_SELECTquery',
-                       t3lib_div::milliseconds()-$pt,
-                       array(
-                       'handlerType' => $hType,
-                       'args' => array($from_table,$select_fields,$where_clause,$groupBy,$orderBy,$limit),
-                       'ORIG_from_table' => $ORIG_tableName
-                       )
+                               'exec_SELECTquery',
+                               t3lib_div::milliseconds()-$pt,
+                               array(
+                                       'handlerType' => $hType,
+                                       'args' => array($from_table,$select_fields,$where_clause,$groupBy,$orderBy,$limit),
+                                       'ORIG_from_table' => $ORIG_tableName
+                               )
                        );
                }
 
-               // Return result handler.
+                       // Return result handler.
                return $sqlResult;
        }
 
@@ -674,7 +674,7 @@ class ux_t3lib_DB extends t3lib_DB {
         * @param       string          See exec_INSERTquery()
         * @param       array           See exec_INSERTquery()
         * @param mixed         See exec_INSERTquery()
-        * @return      string          Full SQL query for INSERT (unless $fields_values does not contain any elements in which case it will be false)
+        * @return      mixed           Full SQL query for INSERT as string or array (unless $fields_values does not contain any elements in which case it will be false). If BLOB fields will be affected and one is not running the native type, an array will be returned, where 0 => plain SQL, 1 => fieldname/value pairs of BLOB fields
         * @depreciated                 use exec_INSERTquery() instead if possible!
         */
        function INSERTquery($table,$fields_values,$no_quote_fields='') {
@@ -690,14 +690,8 @@ class ux_t3lib_DB extends t3lib_DB {
                        $blobfields = array();
                        $nArr = array();
                        foreach($fields_values as $k => $v)     {
-                               if($this->sql_field_metatype($table,$k) == 'B') {
-                                       /* // is this really needed for Oracle?
-                                       if($this->handlerInstance[$this->lastHandlerKey]->databaseType == 'oci8')
-                                       $nArr[$this->quoteFieldNames($k)] = 'empty_blob()';
-                                       else
-                                       $nArr[$this->quoteFieldNames($k)] = 'null';
-                                       */
-                                       $nArr[$this->quoteFieldNames($k)] = 'null';
+                               if(!$this->runningNative() && $this->sql_field_metatype($table,$k) == 'B') {
+                                               // we skip the field in the regular INSERT statement, it is only in blobfields
                                        $blobfields[$this->quoteFieldNames($k)] = $v;
                                }
                                else {
@@ -709,17 +703,19 @@ class ux_t3lib_DB extends t3lib_DB {
                                        $nArr[$this->quoteFieldNames($k)] = (!in_array($k,$no_quote_fields)) ? $this->fullQuoteStr($v, $table) : $v;
                                }
                        }
-                       if(((string)$this->handlerCfg[$this->lastHandlerKey]['type']!=='native') && count($blobfields)) {
-                               $query[0] = 'INSERT INTO '.$this->quoteFromTables($table).'
-                               (
-                                       '.implode(',
-                                       ',array_keys($nArr)).'
-                               ) VALUES (
-                                       '.implode(',
-                                       ',$nArr).'
-                               )';
+                       if(count($blobfields)) {
+                               if(count($nArr)) {
+                                       $query[0] = 'INSERT INTO '.$this->quoteFromTables($table).'
+                                       (
+                                               '.implode(',
+                                               ',array_keys($nArr)).'
+                                       ) VALUES (
+                                               '.implode(',
+                                               ',$nArr).'
+                                       )';
+                               }
                                $query[1] = $blobfields;
-                               if ($this->debugOutput) $this->debug_lastBuiltQuery = $query[0];
+                               if ($this->debugOutput || $this->store_lastBuiltQuery) $this->debug_lastBuiltQuery = $query[0];
                        }
                        else {
                                $query = 'INSERT INTO '.$this->quoteFromTables($table).'
@@ -731,7 +727,7 @@ class ux_t3lib_DB extends t3lib_DB {
                                        ',$nArr).'
                                )';
 
-                               if ($this->debugOutput) $this->debug_lastBuiltQuery = $query;
+                               if ($this->debugOutput || $this->store_lastBuiltQuery) $this->debug_lastBuiltQuery = $query;
                        }
 
                        return $query;
@@ -746,7 +742,7 @@ class ux_t3lib_DB extends t3lib_DB {
         * @param       string          See exec_UPDATEquery()
         * @param       array           See exec_UPDATEquery()
         * @param mixed         See exec_UPDATEquery()
-        * @return      string          Full SQL query for UPDATE (unless $fields_values does not contain any elements in which case it will be false)
+        * @return      mixed           Full SQL query for UPDATE as string or array (unless $fields_values does not contain any elements in which case it will be false). If BLOB fields will be affected and one is not running the native type, an array will be returned, where 0 => plain SQL, 1 => fieldname/value pairs of BLOB fields
         * @depreciated                 use exec_UPDATEquery() instead if possible!
         */
        function UPDATEquery($table,$where,$fields_values,$no_quote_fields='')  {
@@ -763,14 +759,13 @@ class ux_t3lib_DB extends t3lib_DB {
                                $blobfields = array();
                                $nArr = array();
                                foreach($fields_values as $k => $v)     {
-                                       if($this->sql_field_metatype($table,$k) == 'B') {
-                                               // do we need empty_blob() for Oracle? see also INSERTquery()
-                                               $nArr[] = $this->quoteFieldNames($k).'=NULL';
+                                       if(!$this->runningNative() && $this->sql_field_metatype($table,$k) == 'B') {
+                                                       // we skip the field in the regular UPDATE statement, it is only in blobfields
                                                $blobfields[$this->quoteFieldNames($k)] = $v;
                                        }
                                        else {
-                                               // Add slashes old-school:
-                                               // cast numeric values
+                                                       // Add slashes old-school:
+                                                       // cast numeric values
                                                $mt = $this->sql_field_metatype($table,$k);
                                                $v = (($mt{0}=='I')||($mt{0}=='F')) ? (int)$v : $v;
                                                $nArr[] = $this->quoteFieldNames($k).'='.((!in_array($k,$no_quote_fields)) ? $this->fullQuoteStr($v, $table) : $v);
@@ -778,15 +773,17 @@ class ux_t3lib_DB extends t3lib_DB {
                                }
 
                                if(count($blobfields)) {
-                                       $query[0] = 'UPDATE '.$this->quoteFromTables($table).'
-                                       SET
-                                               '.implode(',
-                                               ',$nArr).
-                                               (strlen($where)>0 ? '
-                                       WHERE
-                                               '.$this->quoteWhereClause($where) : '');
-                                               $query[1] = $blobfields;
-                                               if ($this->debugOutput) $this->debug_lastBuiltQuery = $query[0];
+                                       if(count($nArr)) {
+                                               $query[0] = 'UPDATE '.$this->quoteFromTables($table).'
+                                               SET
+                                                       '.implode(',
+                                                       ',$nArr).
+                                                       (strlen($where)>0 ? '
+                                               WHERE
+                                                       '.$this->quoteWhereClause($where) : '');
+                                       }
+                                       $query[1] = $blobfields;
+                                       if ($this->debugOutput || $this->store_lastBuiltQuery) $this->debug_lastBuiltQuery = $query[0];
                                }
                                else {
                                        $query = 'UPDATE '.$this->quoteFromTables($table).'
@@ -797,7 +794,7 @@ class ux_t3lib_DB extends t3lib_DB {
                                        WHERE
                                                '.$this->quoteWhereClause($where) : '');
 
-                                               if ($this->debugOutput) $this->debug_lastBuiltQuery = $query;
+                                               if ($this->debugOutput || $this->store_lastBuiltQuery) $this->debug_lastBuiltQuery = $query;
                                }
 
                                return $query;
@@ -824,7 +821,7 @@ class ux_t3lib_DB extends t3lib_DB {
 
                        $query = parent::DELETEquery($table, $where);
 
-                       if ($this->debugOutput) $this->debug_lastBuiltQuery = $query;
+                       if ($this->debugOutput || $this->store_lastBuiltQuery) $this->debug_lastBuiltQuery = $query;
                        return $query;
                } else {
                        die('<strong>TYPO3 Fatal Error:</strong> "Where" clause argument for DELETE query was not a string in $this->DELETEquery() !');
@@ -855,7 +852,7 @@ class ux_t3lib_DB extends t3lib_DB {
                // call parent method to build actual query
                $query = parent::SELECTquery($select_fields,$from_table,$where_clause,$groupBy,$orderBy,$limit);
 
-               if ($this->debugOutput) $this->debug_lastBuiltQuery = $query;
+               if ($this->debugOutput || $this->store_lastBuiltQuery) $this->debug_lastBuiltQuery = $query;
 
                return $query;
        }
@@ -887,6 +884,7 @@ class ux_t3lib_DB extends t3lib_DB {
         */
        function quoteFieldNames($select_fields) {
                if($select_fields == '') return '';
+               if($this->runningNative()) return $select_fields;
 
                $select_fields = $this->SQLparser->parseFieldList($select_fields);
                foreach($select_fields as $k => $v)     {
@@ -922,6 +920,7 @@ class ux_t3lib_DB extends t3lib_DB {
         */
        function quoteFromTables($from_table) {
                if($from_table == '') return '';
+               if($this->runningNative()) return $from_table;
 
                $from_table = $this->SQLparser->parseFromTables($from_table);
                foreach($from_table as $k => $v)        {
@@ -948,6 +947,7 @@ class ux_t3lib_DB extends t3lib_DB {
         */
        function quoteWhereClause($where_clause) {
                if($where_clause == '') return '';
+               if($this->runningNative()) return $where_clause;
 
                $where_clause = $this->SQLparser->parseWhereClause($where_clause);
                $where_clause = $this->_quoteWhereClause($where_clause);
@@ -994,6 +994,7 @@ class ux_t3lib_DB extends t3lib_DB {
         */
        function quoteGroupBy($groupBy) {
                if($groupBy == '') return '';
+               if($this->runningNative()) return $groupBy;
 
                $groupBy = $this->SQLparser->parseFieldList($groupBy);
                foreach($groupBy as $k => $v)   {
@@ -1013,6 +1014,7 @@ class ux_t3lib_DB extends t3lib_DB {
         */
        function quoteOrderBy($orderBy) {
                if($orderBy == '') return '';
+               if($this->runningNative()) return $orderBy;
 
                $orderBy = $this->SQLparser->parseFieldList($orderBy);
                foreach($orderBy as $k => $v)   {
@@ -1084,13 +1086,19 @@ class ux_t3lib_DB extends t3lib_DB {
        function MetaType($type,$table,$max_length=-1)  {
                $this->lastHandlerKey = $this->handler_getFromTableList($table);
                switch((string)$this->handlerCfg[$this->lastHandlerKey]['type'])        {
+                       case 'native':
+                               $str = $type;
+                               break;
                        case 'adodb':
-                       $rs = $this->handlerInstance[$this->lastHandlerKey]->SelectLimit('SELECT * FROM '.$this->quoteFromTables($table),1);
-                       $str = $rs->MetaType($type, $max_length);
-                       break;
+                               $rs = $this->handlerInstance[$this->lastHandlerKey]->SelectLimit('SELECT * FROM '.$this->quoteFromTables($table),1);
+                               $str = $rs->MetaType($type, $max_length);
+                               break;
+                       case 'userdefined':
+                               $str = $this->handlerInstance[$this->lastHandlerKey]->MetaType($str,$table,$max_length);
+                               break;
                        default:
-                       die('No handler found!!!');
-                       break;
+                               die('No handler found!!!');
+                               break;
                }
 
                return $str;
@@ -1112,21 +1120,16 @@ class ux_t3lib_DB extends t3lib_DB {
                        case 'TINYBLOB':
                        case 'TINYTEXT':
                        case 'ENUM':
-                       case 'SET':
-                       return 'C';
+                       case 'SET': return 'C';
 
                        case 'TEXT':
                        case 'LONGTEXT':
-                       case 'MEDIUMTEXT':
-                       return 'X';
+                       case 'MEDIUMTEXT': return 'X';
 
-                       // php_mysql extension always returns 'blob' even if 'text'
-                       // so we have to check whether binary...
                        case 'IMAGE':
                        case 'LONGBLOB':
                        case 'BLOB':
-                       case 'MEDIUMBLOB':
-                       return 'B';
+                       case 'MEDIUMBLOB': return 'B';
 
                        case 'YEAR':
                        case 'DATE': return 'D';
@@ -1136,15 +1139,14 @@ class ux_t3lib_DB extends t3lib_DB {
                        case 'TIMESTAMP': return 'T';
 
                        case 'FLOAT':
-                       case 'DOUBLE':
-                       return 'F';
+                       case 'DOUBLE': return 'F';
 
                        case 'INT':
-                       case 'INTEGER': return 'I';
-                       case 'TINYINT': // MS SQL Server allows only 0..255 for tinyint, so we do not map to I1
-                       case 'SMALLINT': return 'I2';
-                       case 'MEDIUMINT': return 'I4';
-                       case 'BIGINT': return 'I8';
+                       case 'INTEGER':
+                       case 'TINYINT':
+                       case 'SMALLINT':
+                       case 'MEDIUMINT':
+                       case 'BIGINT': return 'I8'; // we always return I8 to be on the safe side. Under some circumstances the fields are to small otherwise...
 
                        default: return 'N';
                }
@@ -1171,16 +1173,16 @@ class ux_t3lib_DB extends t3lib_DB {
                        case 'T': return 'DATETIME';
                        case 'L': return 'TINYINT';
 
-                       case 'I': return 'INT';
-                       case 'I1': // MS SQL Server allows only 0..255 for tinyint, so we do not map to TINYINT
-                       case 'I2': return 'SMALLINT';
-                       case 'I4': return 'MEDIUMINT';
-                       case 'I8': return 'BIGINT';
+                       case 'I':
+                       case 'I1':
+                       case 'I2':
+                       case 'I4':
+                       case 'I8': return 'BIGINT'; // we only have I8 in DBAL, see MySQLMetaType()
 
                        case 'F': return 'DOUBLE';
                        case 'N': return 'NUMERIC';
-                       default:
-                       return $meta;
+
+                       default: return $meta;
                }
        }
 
@@ -1222,6 +1224,7 @@ class ux_t3lib_DB extends t3lib_DB {
         * @return      integer         Number of resulting rows.
         */
        function sql_num_rows(&$res)    {
+               if($res === false) return 0;
 
                $handlerType = is_object($res) ? $res->TYPO3_DBAL_handlerType : 'native';
                switch($handlerType)    {
@@ -1266,7 +1269,7 @@ class ux_t3lib_DB extends t3lib_DB {
                                        if (is_array($output))  {
                                                foreach($output as $key => $value)      {
                                                        if (is_integer($key))   unset($output[$key]);
-                                                       elseif($value===' ' && strstr($GLOBALS['TYPO3_DB']->handlerCfg[$GLOBALS['TYPO3_DB']->lastHandlerKey]['config']['driver'],'mssql')) $output[$key]=''; // MSSQL does not know such thing as an empty string. So it returns one space instead, which we must fix.
+                                                       elseif($value===' ' && $this->runningADOdbDriver('mssql')) $output[$key]=''; // MSSQL does not know such thing as an empty string. So it returns one space instead, which we must fix.
                                                }
                                        }
                                }
@@ -1313,7 +1316,7 @@ class ux_t3lib_DB extends t3lib_DB {
                                        if (is_array($output))  {
                                                foreach($output as $key => $value)      {
                                                        if (!is_integer($key))  unset($output[$key]);
-                                                       elseif($value===' ' && strstr($GLOBALS['TYPO3_DB']->handlerCfg[$GLOBALS['TYPO3_DB']->lastHandlerKey]['config']['driver'],'mssql')) $output[$key]=''; // MSSQL does not know such thing as an empty string. So it returns one space instead, which we must fix.
+                                                       elseif($value===' ' && $this->runningADOdbDriver('mssql')) $output[$key]=''; // MSSQL does not know such thing as an empty string. So it returns one space instead, which we must fix.
                                                }
                                        }
                                }
@@ -1332,6 +1335,7 @@ class ux_t3lib_DB extends t3lib_DB {
         * @return      boolean         Returns TRUE on success or FALSE on failure.
         */
        function sql_free_result(&$res) {
+               if($res===false) return false;
 
                $handlerType = is_object($res) ? $res->TYPO3_DBAL_handlerType :  'native';
                switch($handlerType)    {
@@ -1504,6 +1508,8 @@ class ux_t3lib_DB extends t3lib_DB {
         * Executes query (on DEFAULT handler!)
         * DEPRECIATED - use exec_* functions from this class instead!
         *
+        * If you don't, anything that uses not the _DEFAULT handler will break!
+        *
         * @param       string          Query to execute
         * @return      pointer         Result pointer / DBAL object
         * @depreciated
@@ -1629,7 +1635,10 @@ class ux_t3lib_DB extends t3lib_DB {
         * Returns the list of tables from the system (quering the DBMSs)
         * It looks up all tables from the DBMS of the _DEFAULT handler and then add all tables *configured* to be managed by other handlers
         *
+        * When fetching the tables, it skips tables whose names begin with BIN$, as this is taken as a table coming from the "Recycle Bin" on Oracle.
+        *
         * @return      array           Tables in an array (tablename is in both key and value)
+        * @todo Should the check for Oracle Recycle Bin stuff be moved elsewhere?
         */
        function admin_get_tables()     {
                $whichTables = array();
@@ -1647,6 +1656,7 @@ class ux_t3lib_DB extends t3lib_DB {
                        case 'adodb':
                                $sqlTables = $this->handlerInstance['_DEFAULT']->MetaTables('TABLES');
                                while (list($k, $theTable) = each($sqlTables)) {
+                                       if(preg_match('/BIN\$/', $theTable)) continue; // skip tables from the Oracle 10 Recycle Bin
                                        $whichTables[$theTable] = $theTable;
                                }
                                break;
@@ -1656,7 +1666,7 @@ class ux_t3lib_DB extends t3lib_DB {
                }
 
                // Check mapping:
-               if (is_array($this->mapping)  {
+               if (is_array($this->mapping) && count($this->mapping))  {
 
                        // Mapping table names in reverse, first getting list of real table names:
                        $tMap = array();
@@ -1897,13 +1907,13 @@ class ux_t3lib_DB extends t3lib_DB {
                        $this->lastHandlerKey = $this->handler_getFromTableList($ORIG_table);
                        switch((string)$this->handlerCfg[$this->lastHandlerKey]['type'])        {
                                case 'native':
-                                       // Compiling query:
+                                               // Compiling query:
                                        $compiledQuery =  $this->SQLparser->compileSQL($this->lastParsedAndMappedQueryArray);
 
                                        return mysql_query($compiledQuery[0], $this->link);
                                        break;
                                case 'adodb':
-                                       // Compiling query:
+                                               // Compiling query:
                                        $compiledQuery =  $this->SQLparser->compileSQL($this->lastParsedAndMappedQueryArray);
                                        if($this->lastParsedAndMappedQueryArray['type']=='INSERT') {
                                                return $this->exec_INSERTquery($this->lastParsedAndMappedQueryArray['TABLE'],$compiledQuery);
@@ -1911,7 +1921,7 @@ class ux_t3lib_DB extends t3lib_DB {
                                        return $this->handlerInstance[$this->lastHandlerKey]->DataDictionary->ExecuteSQLArray($compiledQuery);
                                        break;
                                case 'userdefined':
-                                       // Compiling query:
+                                               // Compiling query:
                                        $compiledQuery =  $this->SQLparser->compileSQL($this->lastParsedAndMappedQueryArray);
 
                                        return $this->handlerInstance[$this->lastHandlerKey]->admin_query($compiledQuery);
@@ -1948,18 +1958,18 @@ class ux_t3lib_DB extends t3lib_DB {
 
                if (!isset($this->cache_handlerKeyFromTableList[$key])) {
 
-                       // Get tables separated:
+                               // Get tables separated:
                        $_tableList = $tableList;
                        $tableArray = $this->SQLparser->parseFromTables($_tableList);
 
-                       // If success, traverse the tables:
+                               // If success, traverse the tables:
                        if (is_array($tableArray) && count($tableArray))        {
                                foreach($tableArray as $vArray) {
 
-                                       // Find handler key, select "_DEFAULT" if none is specifically configured:
+                                               // Find handler key, select "_DEFAULT" if none is specifically configured:
                                        $handlerKey = $this->table2handlerKeys[$vArray['table']] ? $this->table2handlerKeys[$vArray['table']] : '_DEFAULT';
 
-                                       // In case of separate handler keys for joined tables:
+                                               // In case of separate handler keys for joined tables:
                                        if ($outputHandlerKey && $handlerKey != $outputHandlerKey)      {
                                                die('DBAL fatal error: Tables in this list "'.$tableList.'" didn\'t use the same DB handler!');
                                        }
@@ -1967,15 +1977,15 @@ class ux_t3lib_DB extends t3lib_DB {
                                        $outputHandlerKey = $handlerKey;
                                }
 
-                               // Check initialized state; if handler is NOT initialized (connected) then we will connect it!
+                                       // Check initialized state; if handler is NOT initialized (connected) then we will connect it!
                                if (!isset($this->handlerInstance[$outputHandlerKey]))  {
                                        $this->handler_init($outputHandlerKey);
                                }
 
-                               // Return handler key:
+                                       // Return handler key:
                                $this->cache_handlerKeyFromTableList[$key] = $outputHandlerKey;
                        } else {
-                               die('DBAL fatal error: No tables found: "'.$tableList.'"');
+                               die('DBAL fatal error: No handler found in handler_getFromTableList() for: "'.$tableList.'" ('.$tableArray.')');
                        }
                }
 
@@ -1991,7 +2001,7 @@ class ux_t3lib_DB extends t3lib_DB {
         */
        function handler_init($handlerKey)      {
 
-               // Find handler configuration:
+                       // Find handler configuration:
                $cfgArray = $this->handlerCfg[$handlerKey];
                $handlerType = (string)$cfgArray['type'];
                $output = FALSE;
@@ -1999,73 +2009,81 @@ class ux_t3lib_DB extends t3lib_DB {
                if (is_array($cfgArray))        {
                        switch($handlerType)    {
                                case 'native':
-                               $link = mysql_pconnect($cfgArray['config']['host'].(isset($cfgArray['config']['port']) ? ':'.$cfgArray['config']['port'] : ''), $cfgArray['config']['username'], $cfgArray['config']['password']);
+                                       if ($GLOBALS['TYPO3_CONF_VARS']['SYS']['no_pconnect'])  {
+                                               $link = mysql_connect($cfgArray['config']['host'].(isset($cfgArray['config']['port']) ? ':'.$cfgArray['config']['port'] : ''), $cfgArray['config']['username'], $cfgArray['config']['password'], true);
+                                       } else {
+                                               $link = mysql_pconnect($cfgArray['config']['host'].(isset($cfgArray['config']['port']) ? ':'.$cfgArray['config']['port'] : ''), $cfgArray['config']['username'], $cfgArray['config']['password']);
+                                       }
 
-                               // Set handler instance:
-                               $this->handlerInstance[$handlerKey] = array('handlerType' => 'native', 'link' => $link);
+                                               // Set handler instance:
+                                       $this->handlerInstance[$handlerKey] = array('handlerType' => 'native', 'link' => $link);
 
-                               // If link succeeded:
-                               if ($link)      {
-                                       // For default, set ->link (see t3lib_DB)
-                                       if ($handlerKey == '_DEFAULT') {
-                                               $this->link = $link;
-                                       }
+                                               // If link succeeded:
+                                       if ($link)      {
+                                                       // For default, set ->link (see t3lib_DB)
+                                               if ($handlerKey == '_DEFAULT') {
+                                                       $this->link = $link;
+                                               }
 
-                                       // Select database as well:
-                                       if (mysql_select_db($cfgArray['config']['database'], $link))    {
-                                               $output = TRUE;
-                                       }
-                                       $setDBinit = t3lib_div::trimExplode(chr(10), $GLOBALS['TYPO3_CONF_VARS']['SYS']['setDBinit']);
-                                       foreach ($setDBinit as $v)      {
-                                               if (mysql_query($v, $this->link) === FALSE)     {
-                                                       t3lib_div::sysLog('Could not initialize DB connection with query "'.$v.'".','Core',3);
+                                                       // Select database as well:
+                                               if (mysql_select_db($cfgArray['config']['database'], $link))    {
+                                                       $output = TRUE;
                                                }
+                                               $setDBinit = t3lib_div::trimExplode(chr(10), $GLOBALS['TYPO3_CONF_VARS']['SYS']['setDBinit'], 1);
+                                               foreach ($setDBinit as $v)      {
+                                                       if (mysql_query($v, $this->link) === FALSE)     {
+                                                               t3lib_div::sysLog('Could not initialize DB connection with query "'.$v.'".','Core',3);
+                                                       }
+                                               }
+                                       } else {
+                                               t3lib_div::sysLog('Could not connect to MySQL server '.$cfgArray['config']['host'].' with user '.$cfgArray['config']['username'].'.','Core',4);
                                        }
-                               }
-                               break;
+                                       break;
                                case 'adodb':
-                               $output = true;
-                               require_once(t3lib_extMgm::extPath('adodb').'adodb/adodb.inc.php');
-                               if(!defined('ADODB_FORCE_NULLS')) define('ADODB_FORCE_NULLS', 1);
-                               $GLOBALS['ADODB_FORCE_TYPE'] = ADODB_FORCE_VALUE;
-                               $GLOBALS['ADODB_FETCH_MODE'] = ADODB_FETCH_BOTH;
-
-                               $this->handlerInstance[$handlerKey] = &ADONewConnection($cfgArray['config']['driver']);
-                               if ($GLOBALS['TYPO3_CONF_VARS']['SYS']['no_pconnect'])  {
-                                       $this->handlerInstance[$handlerKey]->Connect($cfgArray['config']['host'].(isset($cfgArray['config']['port']) ? ':'.$cfgArray['config']['port'] : ''),$cfgArray['config']['username'],$cfgArray['config']['password'],$cfgArray['config']['database']);
-                               } else {
-                                       $this->handlerInstance[$handlerKey]->PConnect($cfgArray['config']['host'].(isset($cfgArray['config']['port']) ? ':'.$cfgArray['config']['port'] : ''),$cfgArray['config']['username'],$cfgArray['config']['password'],$cfgArray['config']['database']);
-                               }
-                               if(!$this->handlerInstance[$handlerKey]->isConnected()) {
-                                       $dsn = $cfgArray['config']['driver'].'://'.$cfgArray['config']['username'].
-                                               (strlen($cfgArray['config']['password']) ? ':XXXX@' : '').
-                                               $cfgArray['config']['host'].(isset($cfgArray['config']['port']) ? ':'.$cfgArray['config']['port'] : '').'/'.$cfgArray['config']['database'].
-                                               ($GLOBALS['TYPO3_CONF_VARS']['SYS']['no_pconnect'] ? '' : '?persistent=1');
-                                       error_log('DBAL error: Connection to '.$dsn.' failed. Maybe PHP doesn\'t support the database?');
-                                       $output = false;
-                               } else {
-                                       $this->handlerInstance[$handlerKey]->DataDictionary  = NewDataDictionary($this->handlerInstance[$handlerKey]);
-                                       $this->handlerInstance[$handlerKey]->last_insert_id = 0;
-                               }
-                               break;
+                                       $output = true;
+                                       require_once(t3lib_extMgm::extPath('adodb').'adodb/adodb.inc.php');
+                                       if(!defined('ADODB_FORCE_NULLS')) define('ADODB_FORCE_NULLS', 1);
+                                       $GLOBALS['ADODB_FORCE_TYPE'] = ADODB_FORCE_VALUE;
+               &n