Ignore:
Timestamp:
06/29/07 15:17:46 (17 years ago)
Author:
niltonneto
Message:

Versão nova do ADODB (4.5 para 4.95)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/phpgwapi/inc/adodb/drivers/adodb-mysqlt.inc.php

    r2 r34  
    22 
    33/* 
    4 V4.51 29 July 2004  (c) 2000-2004 John Lim (jlim@natsoft.com.my). All rights reserved. 
     4V4.94 23 Jan 2007  (c) 2000-2007 John Lim (jlim#natsoft.com.my). All rights reserved. 
    55  Released under both BSD license and Lesser GPL library license.  
    66  Whenever there is any discrepancy between the two licenses,  
     
    2929        {                        
    3030        global $ADODB_EXTENSION; if ($ADODB_EXTENSION) $this->rsPrefix .= 'ext_'; 
     31        } 
     32         
     33        /* set transaction mode 
     34         
     35        SET [GLOBAL | SESSION] TRANSACTION ISOLATION LEVEL 
     36{ READ UNCOMMITTED | READ COMMITTED | REPEATABLE READ | SERIALIZABLE } 
     37 
     38        */ 
     39        function SetTransactionMode( $transaction_mode )  
     40        { 
     41                $this->_transmode  = $transaction_mode; 
     42                if (empty($transaction_mode)) { 
     43                        $this->Execute('SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ'); 
     44                        return; 
     45                } 
     46                if (!stristr($transaction_mode,'isolation')) $transaction_mode = 'ISOLATION LEVEL '.$transaction_mode; 
     47                $this->Execute("SET SESSION TRANSACTION ".$transaction_mode); 
    3148        } 
    3249         
     
    6077        } 
    6178         
     79        function RowLock($tables,$where='',$flds='1 as adodb_ignore')  
     80        { 
     81                if ($this->transCnt==0) $this->BeginTrans(); 
     82                if ($where) $where = ' where '.$where; 
     83                $rs =& $this->Execute("select $flds from $tables $where for update"); 
     84                return !empty($rs);  
     85        } 
     86         
    6287} 
    6388 
     
    7196                        $mode = $ADODB_FETCH_MODE; 
    7297                } 
     98                 
    7399                switch ($mode) 
    74100                { 
    75101                case ADODB_FETCH_NUM: $this->fetchMode = MYSQL_NUM; break; 
    76102                case ADODB_FETCH_ASSOC:$this->fetchMode = MYSQL_ASSOC; break; 
    77                 default: 
     103                 
    78104                case ADODB_FETCH_DEFAULT: 
    79                 case ADODB_FETCH_BOTH:$this->fetchMode = MYSQL_BOTH; break; 
     105                case ADODB_FETCH_BOTH: 
     106                default: $this->fetchMode = MYSQL_BOTH; break; 
    80107                } 
    81108         
     109                $this->adodbFetchMode = $mode; 
    82110                $this->ADORecordSet($queryID);   
    83111        } 
     
    85113        function MoveNext() 
    86114        { 
    87                 if (@$this->fields =& mysql_fetch_array($this->_queryID,$this->fetchMode)) { 
     115                if (@$this->fields = mysql_fetch_array($this->_queryID,$this->fetchMode)) { 
    88116                        $this->_currentRow += 1; 
    89117                        return true; 
     
    99127class ADORecordSet_ext_mysqlt extends ADORecordSet_mysqlt {      
    100128 
    101         function ADORecordSet_ext_mysqli($queryID,$mode=false)  
     129        function ADORecordSet_ext_mysqlt($queryID,$mode=false)  
    102130        { 
    103131                if ($mode === false) {  
     
    109137                case ADODB_FETCH_NUM: $this->fetchMode = MYSQL_NUM; break; 
    110138                case ADODB_FETCH_ASSOC:$this->fetchMode = MYSQL_ASSOC; break; 
    111                 default: 
     139                 
    112140                case ADODB_FETCH_DEFAULT: 
    113                 case ADODB_FETCH_BOTH:$this->fetchMode = MYSQL_BOTH; break; 
     141                case ADODB_FETCH_BOTH: 
     142                default:  
     143                        $this->fetchMode = MYSQL_BOTH; break; 
    114144                } 
    115          
     145                $this->adodbFetchMode = $mode; 
    116146                $this->ADORecordSet($queryID);   
    117147        } 
Note: See TracChangeset for help on using the changeset viewer.