phpgroupware-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Phpgroupware-cvs] phpgwapi/inc/adodb adodb-active-record.inc.php ...


From: Sigurd Nes
Subject: [Phpgroupware-cvs] phpgwapi/inc/adodb adodb-active-record.inc.php ...
Date: Mon, 06 Aug 2007 13:10:09 +0000

CVSROOT:        /sources/phpgwapi
Module name:    phpgwapi
Changes by:     Sigurd Nes <sigurdne>   07/08/06 13:10:09

Modified files:
        inc/adodb      : adodb-active-record.inc.php 
                         adodb-datadict.inc.php adodb-lib.inc.php 
                         adodb-xmlschema.inc.php 
                         adodb-xmlschema03.inc.php adodb.inc.php 
        inc/adodb/docs : docs-adodb.htm 
        inc/adodb/drivers: adodb-ado5.inc.php adodb-db2.inc.php 
                           adodb-mysql.inc.php adodb-mysqli.inc.php 
                           adodb-oci8.inc.php adodb-oracle.inc.php 
        inc/adodb/pear/Auth/Container: ADOdb.php 
        inc/adodb/perf : perf-oci8.inc.php 
        inc/adodb/session: adodb-session2.php adodb-sessions.mysql.sql 
                           adodb-sessions.oracle.clob.sql 
                           adodb-sessions.oracle.sql 
        inc/adodb/tests: test.php 

Log message:
        update to release 495a

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/adodb/adodb-active-record.inc.php?cvsroot=phpgwapi&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/adodb/adodb-datadict.inc.php?cvsroot=phpgwapi&r1=1.8&r2=1.9
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/adodb/adodb-lib.inc.php?cvsroot=phpgwapi&r1=1.8&r2=1.9
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/adodb/adodb-xmlschema.inc.php?cvsroot=phpgwapi&r1=1.9&r2=1.10
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/adodb/adodb-xmlschema03.inc.php?cvsroot=phpgwapi&r1=1.6&r2=1.7
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/adodb/adodb.inc.php?cvsroot=phpgwapi&r1=1.8&r2=1.9
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/adodb/docs/docs-adodb.htm?cvsroot=phpgwapi&r1=1.8&r2=1.9
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/adodb/drivers/adodb-ado5.inc.php?cvsroot=phpgwapi&r1=1.8&r2=1.9
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/adodb/drivers/adodb-db2.inc.php?cvsroot=phpgwapi&r1=1.8&r2=1.9
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/adodb/drivers/adodb-mysql.inc.php?cvsroot=phpgwapi&r1=1.8&r2=1.9
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/adodb/drivers/adodb-mysqli.inc.php?cvsroot=phpgwapi&r1=1.8&r2=1.9
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/adodb/drivers/adodb-oci8.inc.php?cvsroot=phpgwapi&r1=1.8&r2=1.9
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/adodb/drivers/adodb-oracle.inc.php?cvsroot=phpgwapi&r1=1.8&r2=1.9
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/adodb/pear/Auth/Container/ADOdb.php?cvsroot=phpgwapi&r1=1.6&r2=1.7
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/adodb/perf/perf-oci8.inc.php?cvsroot=phpgwapi&r1=1.8&r2=1.9
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/adodb/session/adodb-session2.php?cvsroot=phpgwapi&r1=1.3&r2=1.4
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/adodb/session/adodb-sessions.mysql.sql?cvsroot=phpgwapi&r1=1.9&r2=1.10
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/adodb/session/adodb-sessions.oracle.clob.sql?cvsroot=phpgwapi&r1=1.9&r2=1.10
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/adodb/session/adodb-sessions.oracle.sql?cvsroot=phpgwapi&r1=1.9&r2=1.10
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/adodb/tests/test.php?cvsroot=phpgwapi&r1=1.7&r2=1.8

Patches:
Index: adodb-active-record.inc.php
===================================================================
RCS file: /sources/phpgwapi/phpgwapi/inc/adodb/adodb-active-record.inc.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- adodb-active-record.inc.php 16 Mar 2007 08:35:58 -0000      1.5
+++ adodb-active-record.inc.php 6 Aug 2007 13:10:07 -0000       1.6
@@ -18,10 +18,11 @@
 
 global $_ADODB_ACTIVE_DBS;
 global $ADODB_ACTIVE_CACHESECS; // set to true to enable caching of metadata 
such as field info
+global $ACTIVE_RECORD_SAFETY; // set to false to disable safety checks
 
 // array of ADODB_Active_DB's, indexed by ADODB_Active_Record->_dbat
 $_ADODB_ACTIVE_DBS = array();
-
+$ACTIVE_RECORD_SAFETY = true;
 
 class ADODB_Active_DB {
        var $db; // ADOConnection
@@ -322,6 +323,8 @@
        // set a numeric array (using natural table field ordering) as object 
properties
        function Set(&$row)
        {
+       global $ACTIVE_RECORD_SAFETY;
+       
                $db =& $this->DB();
                
                if (!$row) {
@@ -332,7 +335,7 @@
                $this->_saved = true;
                
                $table =& $this->TableInfo();
-               if (sizeof($table->flds) != sizeof($row)) {
+               if ($ACTIVE_RECORD_SAFETY && sizeof($table->flds) != 
sizeof($row)) {
                        $this->Error("Table structure of $this->_table has 
changed","Load");
                        return false;
                }

Index: adodb-datadict.inc.php
===================================================================
RCS file: /sources/phpgwapi/phpgwapi/inc/adodb/adodb-datadict.inc.php,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -b -r1.8 -r1.9
--- adodb-datadict.inc.php      16 Mar 2007 08:35:59 -0000      1.8
+++ adodb-datadict.inc.php      6 Aug 2007 13:10:07 -0000       1.9
@@ -215,9 +215,117 @@
                return $this->connection->MetaIndexes($this->TableName($table), 
$primary, $owner);
        }
        
+
        function MetaType($t,$len=-1,$fieldobj=false)
        {
-               return ADORecordSet::MetaType($t,$len,$fieldobj);
+               static $typeMap = array(
+               'VARCHAR' => 'C',
+               'VARCHAR2' => 'C',
+               'CHAR' => 'C',
+               'C' => 'C',
+               'STRING' => 'C',
+               'NCHAR' => 'C',
+               'NVARCHAR' => 'C',
+               'VARYING' => 'C',
+               'BPCHAR' => 'C',
+               'CHARACTER' => 'C',
+               'INTERVAL' => 'C',  # Postgres
+               'MACADDR' => 'C', # postgres
+               ##
+               'LONGCHAR' => 'X',
+               'TEXT' => 'X',
+               'NTEXT' => 'X',
+               'M' => 'X',
+               'X' => 'X',
+               'CLOB' => 'X',
+               'NCLOB' => 'X',
+               'LVARCHAR' => 'X',
+               ##
+               'BLOB' => 'B',
+               'IMAGE' => 'B',
+               'BINARY' => 'B',
+               'VARBINARY' => 'B',
+               'LONGBINARY' => 'B',
+               'B' => 'B',
+               ##
+               'YEAR' => 'D', // mysql
+               'DATE' => 'D',
+               'D' => 'D',
+               ##
+               'UNIQUEIDENTIFIER' => 'C', # MS SQL Server
+               ##
+               'TIME' => 'T',
+               'TIMESTAMP' => 'T',
+               'DATETIME' => 'T',
+               'TIMESTAMPTZ' => 'T',
+               'T' => 'T',
+               'TIMESTAMP WITHOUT TIME ZONE' => 'T', // postgresql
+               ##
+               'BOOL' => 'L',
+               'BOOLEAN' => 'L', 
+               'BIT' => 'L',
+               'L' => 'L',
+               ##
+               'COUNTER' => 'R',
+               'R' => 'R',
+               'SERIAL' => 'R', // ifx
+               'INT IDENTITY' => 'R',
+               ##
+               'INT' => 'I',
+               'INT2' => 'I',
+               'INT4' => 'I',
+               'INT8' => 'I',
+               'INTEGER' => 'I',
+               'INTEGER UNSIGNED' => 'I',
+               'SHORT' => 'I',
+               'TINYINT' => 'I',
+               'SMALLINT' => 'I',
+               'I' => 'I',
+               ##
+               'LONG' => 'N', // interbase is numeric, oci8 is blob
+               'BIGINT' => 'N', // this is bigger than PHP 32-bit integers
+               'DECIMAL' => 'N',
+               'DEC' => 'N',
+               'REAL' => 'N',
+               'DOUBLE' => 'N',
+               'DOUBLE PRECISION' => 'N',
+               'SMALLFLOAT' => 'N',
+               'FLOAT' => 'N',
+               'NUMBER' => 'N',
+               'NUM' => 'N',
+               'NUMERIC' => 'N',
+               'MONEY' => 'N',
+               
+               ## informix 9.2
+               'SQLINT' => 'I', 
+               'SQLSERIAL' => 'I', 
+               'SQLSMINT' => 'I', 
+               'SQLSMFLOAT' => 'N', 
+               'SQLFLOAT' => 'N', 
+               'SQLMONEY' => 'N', 
+               'SQLDECIMAL' => 'N', 
+               'SQLDATE' => 'D', 
+               'SQLVCHAR' => 'C', 
+               'SQLCHAR' => 'C', 
+               'SQLDTIME' => 'T', 
+               'SQLINTERVAL' => 'N', 
+               'SQLBYTES' => 'B', 
+               'SQLTEXT' => 'X',
+                ## informix 10
+               "SQLINT8" => 'I8',
+               "SQLSERIAL8" => 'I8',
+               "SQLNCHAR" => 'C',
+               "SQLNVCHAR" => 'C',
+               "SQLLVARCHAR" => 'X',
+               "SQLBOOL" => 'L'
+               );
+               
+               if (!$this->connection->IsConnected()) {
+                       $t = strtoupper($t);
+                       if (isset($typeMap[$t])) return $typeMap[$t];
+                       return 'N';
+               }
+               return $this->connection->MetaType($t,$len,$fieldobj);
        }
        
        function NameQuote($name = NULL,$allowBrackets=false)

Index: adodb-lib.inc.php
===================================================================
RCS file: /sources/phpgwapi/phpgwapi/inc/adodb/adodb-lib.inc.php,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -b -r1.8 -r1.9
--- adodb-lib.inc.php   16 Mar 2007 08:35:59 -0000      1.8
+++ adodb-lib.inc.php   6 Aug 2007 13:10:07 -0000       1.9
@@ -968,12 +968,22 @@
                        $val = $zthis->DBDate($arrFields[$fname]);
                        break;
 
+               
                case "T":
                        $val = $zthis->DBTimeStamp($arrFields[$fname]);
                        break;
 
+               case "N":
+                   $val = (float) $arrFields[$fname];
+                   break;
+
+               case "I":
+               case "R":
+                   $val = (int) $arrFields[$fname];
+                   break;
+
                default:
-                       $val = $arrFields[$fname];
+                       $val = str_replace(array("'"," 
","("),"",$arrFields[$fname]); // basic sql injection defence
                        if (empty($val)) $val = '0';
                        break;
        }

Index: adodb-xmlschema.inc.php
===================================================================
RCS file: /sources/phpgwapi/phpgwapi/inc/adodb/adodb-xmlschema.inc.php,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -b -r1.9 -r1.10
--- adodb-xmlschema.inc.php     16 Mar 2007 08:35:59 -0000      1.9
+++ adodb-xmlschema.inc.php     6 Aug 2007 13:10:07 -0000       1.10
@@ -12,7 +12,7 @@
  *
  * Last Editor: $Author: sigurdne $
  * @author Richard Tango-Lowy & Dan Cech
- * @version $Revision: 1.9 $
+ * @version $Revision: 1.10 $
  *
  * @package axmls
  * @tutorial getting_started.pkg
@@ -1209,7 +1209,7 @@
 * @tutorial getting_started.pkg
 *
 * @author Richard Tango-Lowy & Dan Cech
-* @version $Revision: 1.9 $
+* @version $Revision: 1.10 $
 *
 * @package axmls
 */

Index: adodb-xmlschema03.inc.php
===================================================================
RCS file: /sources/phpgwapi/phpgwapi/inc/adodb/adodb-xmlschema03.inc.php,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -b -r1.6 -r1.7
--- adodb-xmlschema03.inc.php   16 Mar 2007 08:35:59 -0000      1.6
+++ adodb-xmlschema03.inc.php   6 Aug 2007 13:10:07 -0000       1.7
@@ -12,7 +12,7 @@
  *
  * Last Editor: $Author: sigurdne $
  * @author Richard Tango-Lowy & Dan Cech
- * @version $Revision: 1.6 $
+ * @version $Revision: 1.7 $
  *
  * @package axmls
  * @tutorial getting_started.pkg
@@ -1309,7 +1309,7 @@
 * @tutorial getting_started.pkg
 *
 * @author Richard Tango-Lowy & Dan Cech
-* @version $Revision: 1.6 $
+* @version $Revision: 1.7 $
 *
 * @package axmls
 */

Index: adodb.inc.php
===================================================================
RCS file: /sources/phpgwapi/phpgwapi/inc/adodb/adodb.inc.php,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -b -r1.8 -r1.9
--- adodb.inc.php       16 Mar 2007 08:35:59 -0000      1.8
+++ adodb.inc.php       6 Aug 2007 13:10:07 -0000       1.9
@@ -2,7 +2,7 @@
 /*
  * Set tabs to 4 for best viewing.
  * 
- * Latest version is available at http://adodb.sourceforge.net
+ * Latest version is available at http://adodb.sourceforge.net/
  * 
  * This is the main include file for ADOdb.
  * Database specific drivers are stored in the adodb/drivers/adodb-*.inc.php
@@ -1576,7 +1576,7 @@
             $dir = $ADODB_CACHE_DIR;
             
          if ($this->debug) {
-            ADOConnection::outp( "CacheFlush: $dir<br><pre>\n", 
$this->_dirFlush($dir),"</pre>");
+            ADOConnection::outp( "CacheFlush: $dir<br><pre>\n". 
$this->_dirFlush($dir)."</pre>");
          } else {
             $this->_dirFlush($dir);
          }
@@ -1599,18 +1599,18 @@
    * Just specify the directory, and tell it if you want to delete the 
directory or just clear it out.
    * Note: $kill_top_level is used internally in the function to flush 
subdirectories.
    */
-   function _dirFlush($dir, $kill_top_level = false) {
+   function _dirFlush($dir, $kill_top_level = false) 
+   {
       if(!$dh = @opendir($dir)) return;
       
       while (($obj = readdir($dh))) {
-         if($obj=='.' || $obj=='..')
-            continue;
+         if($obj=='.' || $obj=='..') continue;
+               $f = $dir.'/'.$obj;
                        
-         if (address@hidden($dir.'/'.$obj))
-                         $this->_dirFlush($dir.'/'.$obj, true);
+               if (strpos($obj,'.cache')) @unlink($f);
+               if (is_dir($f)) $this->_dirFlush($f, true);
       }
-      if ($kill_top_level === true)
-         @rmdir($dir);
+      if ($kill_top_level === true) @rmdir($dir);
       return true;
    }
    

Index: docs/docs-adodb.htm
===================================================================
RCS file: /sources/phpgwapi/phpgwapi/inc/adodb/docs/docs-adodb.htm,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -b -r1.8 -r1.9
--- docs/docs-adodb.htm 16 Mar 2007 08:35:59 -0000      1.8
+++ docs/docs-adodb.htm 6 Aug 2007 13:10:07 -0000       1.9
@@ -2404,8 +2404,8 @@
   this function if a concatenation operator is not used, eg. MySQL.</font></p>
 <p><font>Returns the concatenated string.</font></p>
 <p><font><b>DBDate<a name="dbdate"></a>($date)</b></font></p>
-<p><font>Format the $<b>date</b> in the format the database accepts. This is 
used in 
-  INSERT/UPDATE statements; for SELECT statements, use <a 
href="#sqldate">SQLDate</a>. 
+<p><font>Format the $<b>date</b> in the format the database accepts - the 
return string is also quoted. This is used
+when you are sending dates to the database (eg INSERT, UPDATE or where clause 
of SELECT statement). 
   The $<b>date</b> parameter can be a Unix integer timestamp or an ISO format 
   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>
@@ -2414,6 +2414,7 @@
        $sql = "select * from atable where created > 
".$db->DBDate("$year-$month-$day");
        $db->Execute($sql);
 </pre>
+<p>Note to retrieve a date column in a specific format,  use <a 
href="#sqldate">SQLDate</a>. </p>
 <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.
@@ -2633,8 +2634,9 @@
 <font> </font>
 <p><font><b>SQLDate<a name="sqldate"></a>($dateFormat, 
$basedate=false)</b></font></p>
 <font>Returns a string which contains the native SQL functions
-to format a date or date column $basedate. This is used in SELECT statements.
-For INSERT/UPDATE statements, use <a href="#dbdate">DBDate</a>. It uses a 
case-sensitive
+to format a date or date column $basedate. This is used when retrieving date 
columns in SELECT statements.
+For sending dates to the database (eg. in UPDATE, INSERT or the where clause 
of SELECT statements) 
+use <a href="#dbdate">DBDate</a>. It uses a case-sensitive
 $dateFormat, which supports: </font>
 <pre><font> 
   Y: 4-digit Year
@@ -2925,6 +2927,20 @@
 
 <h2><font>Change Log<a name="Changes"></a><a name="changes"></a><a 
name="changelog"></a></font></h2>
 
+<p><a name="4.95"></a><b>4.95/5.01 17 May 2007</b>
+<p>CacheFlush debug outp() passed in invalid parameters. Fixed.
+<p>Added Thai language file for adodb. Thx Trirat Petchsingh 
rosskouk#gmail.com and Marcos Pont</p>
+<p>Added zerofill checking support to MetaColumns for mysql and mysqli.
+<p>CacheFlush no longer deletes all files/directories. Only *.cache files 
deleted.</p>
+<p>DB2 timestamp format changed to var $fmtTimeStamp = "'Y-m-d-H:i:s'";</p>
+<p>Added some code sanitization to AutoExecute in adodb-lib.inc.php.</p>
+<p>Due to typo, all connections in adodb-oracle.inc.php would become 
persistent, even non-persistent ones. Fixed.</p>
+<P>Oci8 DBTimeStamp uses 24 hour time for input now, so you can perform string 
comparisons between 2 DBTimeStamp values.</P>
+<p>Some PHP4.4 compat issues fixed in adodb-session2.inc.php</p>
+<p>For ADOdb 5.01, fixed some adodb-datadict.inc.php MetaType compat issues 
with PHP5.
+<p>The $argHostname was wiped out in adodb-ado5.inc.php. Fixed.
+<p>Adodb5 version, added iterator support for adodb_recordset_empty.
+
 <p><a name="4.94"></a><b>4.94 23 Jan 2007</b>
 <p>Active Record: $ADODB_ASSOC_CASE=2 did not work properly. Fixed. Thx 
gmane#auxbuss.com.
 <p>mysqli had bugs in BeginTrans() and EndTrans(). Fixed.</p>

Index: drivers/adodb-ado5.inc.php
===================================================================
RCS file: /sources/phpgwapi/phpgwapi/inc/adodb/drivers/adodb-ado5.inc.php,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -b -r1.8 -r1.9
--- drivers/adodb-ado5.inc.php  16 Mar 2007 08:35:59 -0000      1.8
+++ drivers/adodb-ado5.inc.php  6 Aug 2007 13:10:08 -0000       1.9
@@ -101,9 +101,6 @@
                
                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";

Index: drivers/adodb-db2.inc.php
===================================================================
RCS file: /sources/phpgwapi/phpgwapi/inc/adodb/drivers/adodb-db2.inc.php,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -b -r1.8 -r1.9
--- drivers/adodb-db2.inc.php   16 Mar 2007 08:35:59 -0000      1.8
+++ drivers/adodb-db2.inc.php   6 Aug 2007 13:10:08 -0000       1.9
@@ -33,7 +33,7 @@
        var $sysDate = 'CURRENT DATE';
        var $sysTimeStamp = 'CURRENT TIMESTAMP';
        
-       var $fmtTimeStamp = "'Y-m-d-H.i.s'";
+       var $fmtTimeStamp = "'Y-m-d-H:i:s'";
        var $replaceQuote = "''"; // string to use to replace quotes
        var $dataProvider = "db2";
        var $hasAffectedRows = true;

Index: drivers/adodb-mysql.inc.php
===================================================================
RCS file: /sources/phpgwapi/phpgwapi/inc/adodb/drivers/adodb-mysql.inc.php,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -b -r1.8 -r1.9
--- drivers/adodb-mysql.inc.php 16 Mar 2007 08:35:59 -0000      1.8
+++ drivers/adodb-mysql.inc.php 6 Aug 2007 13:10:08 -0000       1.9
@@ -184,6 +184,7 @@
        // Reference on Last_Insert_ID on the recommended way to simulate 
sequences
        var $_genIDSQL = "update %s set id=LAST_INSERT_ID(id+1);";
        var $_genSeqSQL = "create table %s (id int not null)";
+       var $_genSeqCountSQL = "select count(*) from %s";
        var $_genSeq2SQL = "insert into %s values (%s)";
        var $_dropSeqSQL = "drop table %s";
        
@@ -212,12 +213,16 @@
                        if ($holdtransOK) $this->_transOK = true; //if the 
status was ok before reset
                        $u = strtoupper($seqname);
                        $this->Execute(sprintf($this->_genSeqSQL,$seqname));
-                       
$this->Execute(sprintf($this->_genSeq2SQL,$seqname,$startID-1));
+                       $cnt = 
$this->GetOne(sprintf($this->_genSeqCountSQL,$seqname));
+                       if (!$cnt) 
$this->Execute(sprintf($this->_genSeq2SQL,$seqname,$startID-1));
                        $rs = $this->Execute($getnext);
                }
-               $this->genID = mysql_insert_id($this->_connectionID);
                
-               if ($rs) $rs->Close();
+               if ($rs) {
+                       $this->genID = mysql_insert_id($this->_connectionID);
+                       $rs->Close();
+               } else
+                       $this->genID = 0;
                
                $this->_logsql = $savelog;
                return $this->genID;
@@ -443,6 +448,7 @@
                        $fld->auto_increment = (strpos($rs->fields[5], 
'auto_increment') !== false);
                        $fld->binary = (strpos($type,'blob') !== false);
                        $fld->unsigned = (strpos($type,'unsigned') !== false);
+                       $fld->zerofill = (strpos($type,'zerofill') !== false);
                                
                        if (!$fld->binary) {
                                $d = $rs->fields[4];

Index: drivers/adodb-mysqli.inc.php
===================================================================
RCS file: /sources/phpgwapi/phpgwapi/inc/adodb/drivers/adodb-mysqli.inc.php,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -b -r1.8 -r1.9
--- drivers/adodb-mysqli.inc.php        16 Mar 2007 08:35:59 -0000      1.8
+++ drivers/adodb-mysqli.inc.php        6 Aug 2007 13:10:08 -0000       1.9
@@ -273,12 +273,16 @@
                        if ($holdtransOK) $this->_transOK = true; //if the 
status was ok before reset
                        $u = strtoupper($seqname);
                        $this->Execute(sprintf($this->_genSeqSQL,$seqname));
-                       
$this->Execute(sprintf($this->_genSeq2SQL,$seqname,$startID-1));
+                       $cnt = 
$this->GetOne(sprintf($this->_genSeqCountSQL,$seqname));
+                       if (!$cnt) 
$this->Execute(sprintf($this->_genSeq2SQL,$seqname,$startID-1));
                        $rs = $this->Execute($getnext);
                }
-               $this->genID = mysqli_insert_id($this->_connectionID);
                
-               if ($rs) $rs->Close();
+               if ($rs) {
+                       $this->genID = mysqli_insert_id($this->_connectionID);
+                       $rs->Close();
+               } else
+                       $this->genID = 0;
                
                return $this->genID;
        }
@@ -559,6 +563,7 @@
                        $fld->auto_increment = (strpos($rs->fields[5], 
'auto_increment') !== false);
                        $fld->binary = (strpos($type,'blob') !== false);
                        $fld->unsigned = (strpos($type,'unsigned') !== false);
+                       $fld->zerofill = (strpos($type,'zerofill') !== false);
 
                        if (!$fld->binary) {
                                $d = $rs->fields[4];

Index: drivers/adodb-oci8.inc.php
===================================================================
RCS file: /sources/phpgwapi/phpgwapi/inc/adodb/drivers/adodb-oci8.inc.php,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -b -r1.8 -r1.9
--- drivers/adodb-oci8.inc.php  16 Mar 2007 08:35:59 -0000      1.8
+++ drivers/adodb-oci8.inc.php  6 Aug 2007 13:10:08 -0000       1.9
@@ -83,6 +83,7 @@
        var $firstrows = true; // enable first rows optimization on 
SelectLimit()
        var $selectOffsetAlg1 = 100; // when to use 1st algorithm of 
selectlimit.
        var $NLS_DATE_FORMAT = 'YYYY-MM-DD';  // To include time, use 
'RRRR-MM-DD HH24:MI:SS'
+       var $dateformat = 'YYYY-MM-DD'; // for DBDate()
        var $useDBDateFormatForTextInput=false;
        var $datetime = false; // MetaType('DATE') returns 'D' 
(datetime==false) or 'T' (datetime == true)
        var $_refLOBs = array();
@@ -276,7 +277,7 @@
                if (empty($d) && $d !== 0) return 'null';
                
                if (is_string($d)) $d = ADORecordSet::UnixDate($d);
-               return 
"TO_DATE(".adodb_date($this->fmtDate,$d).",'".$this->NLS_DATE_FORMAT."')";
+               return 
"TO_DATE(".adodb_date($this->fmtDate,$d).",'".$this->dateformat."')";
        }
 
        function BindDate($d)
@@ -300,7 +301,7 @@
        {
                if (empty($ts) && $ts !== 0) return 'null';
                if (is_string($ts)) $ts = ADORecordSet::UnixTimeStamp($ts);
-               return 
'TO_DATE('.adodb_date($this->fmtTimeStamp,$ts).",'RRRR-MM-DD, HH:MI:SS AM')";
+               return 'TO_DATE('.adodb_date("'Y-m-d 
H:i:s'",$ts).",'RRRR-MM-DD, HH24:MI:SS')";
        }
        
        function RowLock($tables,$where,$flds='1 as ignore') 

Index: drivers/adodb-oracle.inc.php
===================================================================
RCS file: /sources/phpgwapi/phpgwapi/inc/adodb/drivers/adodb-oracle.inc.php,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -b -r1.8 -r1.9
--- drivers/adodb-oracle.inc.php        16 Mar 2007 08:35:59 -0000      1.8
+++ drivers/adodb-oracle.inc.php        6 Aug 2007 13:10:08 -0000       1.9
@@ -150,7 +150,7 @@
                        if ($argDatabasename) $argUsername .= 
"@$argDatabasename";
 
                //if ($argHostname) print "<p>Connect: 1st argument should be 
left blank for $this->databaseType</p>";
-                       if ($mode = 1)
+                       if ($mode == 1)
                                $this->_connectionID = 
ora_plogon($argUsername,$argPassword);
                        else
                                $this->_connectionID = 
ora_logon($argUsername,$argPassword);

Index: pear/Auth/Container/ADOdb.php
===================================================================
RCS file: /sources/phpgwapi/phpgwapi/inc/adodb/pear/Auth/Container/ADOdb.php,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -b -r1.6 -r1.7
--- pear/Auth/Container/ADOdb.php       16 Mar 2007 08:35:59 -0000      1.6
+++ pear/Auth/Container/ADOdb.php       6 Aug 2007 13:10:08 -0000       1.7
@@ -17,7 +17,7 @@
 // |   Richard Tango-Lowy <address@hidden>                                  |
 // +----------------------------------------------------------------------+
 //
-// $Id: ADOdb.php,v 1.6 2007/03/16 08:35:59 sigurdne Exp $
+// $Id: ADOdb.php,v 1.7 2007/08/06 13:10:08 sigurdne Exp $
 //
 
 require_once 'Auth/Container.php';
@@ -35,7 +35,7 @@
  *
  * @author   Richard Tango-Lowy <address@hidden>
  * @package  Auth
- * @version  $Revision: 1.6 $
+ * @version  $Revision: 1.7 $
  */
 class Auth_Container_ADOdb extends Auth_Container
 {

Index: perf/perf-oci8.inc.php
===================================================================
RCS file: /sources/phpgwapi/phpgwapi/inc/adodb/perf/perf-oci8.inc.php,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -b -r1.8 -r1.9
--- perf/perf-oci8.inc.php      16 Mar 2007 08:36:00 -0000      1.8
+++ perf/perf-oci8.inc.php      6 Aug 2007 13:10:09 -0000       1.9
@@ -110,7 +110,7 @@
                'Percentage of data cache actually in use - should be over 
85%'),
                
                'shared pool utilization ratio' => array('RATIOU',
-               'select round((sga.bytes/p.value)*100,2)
+               'select round((sga.bytes/case when p.value=0 then sga.bytes 
else to_number(p.value) end)*100,2)
                from v$sgastat sga, v$parameter p
                where sga.name = \'free memory\' and sga.pool = \'shared pool\'
                and p.name = \'shared_pool_size\'',

Index: session/adodb-session2.php
===================================================================
RCS file: /sources/phpgwapi/phpgwapi/inc/adodb/session/adodb-session2.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- session/adodb-session2.php  16 Mar 2007 08:36:00 -0000      1.3
+++ session/adodb-session2.php  6 Aug 2007 13:10:09 -0000       1.4
@@ -443,8 +443,14 @@
 
        /*!
        */
-       function &_conn($conn=null) {
-               return $GLOBALS['ADODB_SESS_CONN'];
+       function &_conn($conn=null) 
+       {
+               if (isset($GLOBALS['ADODB_SESS_CONN'])) {
+                       $conn =& $GLOBALS['ADODB_SESS_CONN'];
+                       return $conn;
+               }
+               $false = false;
+               return $false;
        }
 
        /*!
@@ -768,7 +774,7 @@
                        $rs =& $conn->Execute($sql,array($expireref,$key));
                        
                        $qkey = $conn->qstr($key);
-                       $rs2 =& $conn->UpdateBlob($table, 'sessdata', $val, " 
sesskey=$qkey", strtoupper($clob));
+                       $rs2 = $conn->UpdateBlob($table, 'sessdata', $val, " 
sesskey=$qkey", strtoupper($clob));
                        $rs = @$conn->CompleteTrans();
                        
                        

Index: session/adodb-sessions.mysql.sql
===================================================================
RCS file: 
/sources/phpgwapi/phpgwapi/inc/adodb/session/adodb-sessions.mysql.sql,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -b -r1.9 -r1.10
--- session/adodb-sessions.mysql.sql    16 Mar 2007 08:36:00 -0000      1.9
+++ session/adodb-sessions.mysql.sql    6 Aug 2007 13:10:09 -0000       1.10
@@ -1,4 +1,4 @@
--- $CVSHeader: phpgwapi/inc/adodb/session/adodb-sessions.mysql.sql,v 1.9 
2007/03/16 08:36:00 sigurdne Exp $
+-- $CVSHeader: phpgwapi/inc/adodb/session/adodb-sessions.mysql.sql,v 1.10 
2007/08/06 13:10:09 sigurdne Exp $
 
 CREATE DATABASE /*! IF NOT EXISTS */ adodb_sessions;
 

Index: session/adodb-sessions.oracle.clob.sql
===================================================================
RCS file: 
/sources/phpgwapi/phpgwapi/inc/adodb/session/adodb-sessions.oracle.clob.sql,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -b -r1.9 -r1.10
--- session/adodb-sessions.oracle.clob.sql      16 Mar 2007 08:36:00 -0000      
1.9
+++ session/adodb-sessions.oracle.clob.sql      6 Aug 2007 13:10:09 -0000       
1.10
@@ -1,4 +1,4 @@
--- $CVSHeader: phpgwapi/inc/adodb/session/adodb-sessions.oracle.clob.sql,v 1.9 
2007/03/16 08:36:00 sigurdne Exp $
+-- $CVSHeader: phpgwapi/inc/adodb/session/adodb-sessions.oracle.clob.sql,v 
1.10 2007/08/06 13:10:09 sigurdne Exp $
 
 DROP TABLE adodb_sessions;
 

Index: session/adodb-sessions.oracle.sql
===================================================================
RCS file: 
/sources/phpgwapi/phpgwapi/inc/adodb/session/adodb-sessions.oracle.sql,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -b -r1.9 -r1.10
--- session/adodb-sessions.oracle.sql   16 Mar 2007 08:36:00 -0000      1.9
+++ session/adodb-sessions.oracle.sql   6 Aug 2007 13:10:09 -0000       1.10
@@ -1,4 +1,4 @@
--- $CVSHeader: phpgwapi/inc/adodb/session/adodb-sessions.oracle.sql,v 1.9 
2007/03/16 08:36:00 sigurdne Exp $
+-- $CVSHeader: phpgwapi/inc/adodb/session/adodb-sessions.oracle.sql,v 1.10 
2007/08/06 13:10:09 sigurdne Exp $
 
 DROP TABLE adodb_sessions;
 

Index: tests/test.php
===================================================================
RCS file: /sources/phpgwapi/phpgwapi/inc/adodb/tests/test.php,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -b -r1.7 -r1.8
--- tests/test.php      16 Mar 2007 08:36:00 -0000      1.7
+++ tests/test.php      6 Aug 2007 13:10:09 -0000       1.8
@@ -10,7 +10,7 @@
 */
 
 
-if (!defined('E_STRICT')) define('E_STRICT',0);
+if (!defined('E_STRICT')) define('E_STRICT',E_NOTICE);
 error_reporting(E_ALL|E_STRICT);
 
 $ADODB_FLUSH = true;




reply via email to

[Prev in Thread] Current Thread [Next in Thread]