Changeset 34 for trunk/phpgwapi/inc/adodb/drivers/adodb-mysqlt.inc.php
- Timestamp:
- 06/29/07 15:17:46 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/phpgwapi/inc/adodb/drivers/adodb-mysqlt.inc.php
r2 r34 2 2 3 3 /* 4 V4. 51 29 July 2004 (c) 2000-2004 John Lim (jlim@natsoft.com.my). All rights reserved.4 V4.94 23 Jan 2007 (c) 2000-2007 John Lim (jlim#natsoft.com.my). All rights reserved. 5 5 Released under both BSD license and Lesser GPL library license. 6 6 Whenever there is any discrepancy between the two licenses, … … 29 29 { 30 30 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); 31 48 } 32 49 … … 60 77 } 61 78 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 62 87 } 63 88 … … 71 96 $mode = $ADODB_FETCH_MODE; 72 97 } 98 73 99 switch ($mode) 74 100 { 75 101 case ADODB_FETCH_NUM: $this->fetchMode = MYSQL_NUM; break; 76 102 case ADODB_FETCH_ASSOC:$this->fetchMode = MYSQL_ASSOC; break; 77 default:103 78 104 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; 80 107 } 81 108 109 $this->adodbFetchMode = $mode; 82 110 $this->ADORecordSet($queryID); 83 111 } … … 85 113 function MoveNext() 86 114 { 87 if (@$this->fields = &mysql_fetch_array($this->_queryID,$this->fetchMode)) {115 if (@$this->fields = mysql_fetch_array($this->_queryID,$this->fetchMode)) { 88 116 $this->_currentRow += 1; 89 117 return true; … … 99 127 class ADORecordSet_ext_mysqlt extends ADORecordSet_mysqlt { 100 128 101 function ADORecordSet_ext_mysql i($queryID,$mode=false)129 function ADORecordSet_ext_mysqlt($queryID,$mode=false) 102 130 { 103 131 if ($mode === false) { … … 109 137 case ADODB_FETCH_NUM: $this->fetchMode = MYSQL_NUM; break; 110 138 case ADODB_FETCH_ASSOC:$this->fetchMode = MYSQL_ASSOC; break; 111 default:139 112 140 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; 114 144 } 115 145 $this->adodbFetchMode = $mode; 116 146 $this->ADORecordSet($queryID); 117 147 }
Note: See TracChangeset
for help on using the changeset viewer.