0012755.patch

Administrator Admin, 2009-11-25 15:58

Download (141 KB)

View differences:

typo3/sysext/adodb/doc/510.DBAL.patch (Arbeitskopie)
1 1
diff -urN adodb508a/adodb-lib.inc.php adodb/adodb-lib.inc.php
2
--- adodb508a/adodb-lib.inc.php	2009-05-16 00:45:10.000000000 +0200
2
--- adodb510/adodb-lib.inc.php	2009-05-16 00:45:10.000000000 +0200
3 3
+++ adodb/adodb-lib.inc.php	2009-05-16 00:45:17.000000000 +0200
4 4
@@ -886,7 +886,7 @@
5 5
 	$values = substr($values, 0, -2);
......
10 10
 }
11 11
 
12 12
 
13
diff -urN adodb508a/datadict/datadict-oci8.inc.php adodb/datadict/datadict-oci8.inc.php
14
--- adodb508a/datadict/datadict-oci8.inc.php	2009-05-16 00:45:10.000000000 +0200
13
diff -urN adodb510/datadict/datadict-oci8.inc.php adodb/datadict/datadict-oci8.inc.php
14
--- adodb510/datadict/datadict-oci8.inc.php	2009-05-16 00:45:10.000000000 +0200
15 15
+++ adodb/datadict/datadict-oci8.inc.php	2009-05-16 00:45:17.000000000 +0200
16 16
@@ -110,6 +110,7 @@
17 17
 	
......
50 50
 		if ( isset($idxoptions[$this->upperName]) )
51 51
 			$s .= $idxoptions[$this->upperName];
52 52
 		
53
diff -urN adodb508a/datadict/datadict-postgres.inc.php adodb/datadict/datadict-postgres.inc.php
54
--- adodb508a/datadict/datadict-postgres.inc.php	2009-05-16 00:45:10.000000000 +0200
53
diff -urN adodb510/datadict/datadict-postgres.inc.php adodb/datadict/datadict-postgres.inc.php
54
--- adodb510/datadict/datadict-postgres.inc.php	2009-05-16 00:45:10.000000000 +0200
55 55
+++ adodb/datadict/datadict-postgres.inc.php	2009-05-16 00:45:17.000000000 +0200
56 56
@@ -418,7 +418,7 @@
57 57
 		
......
73 73
 		$sql[] = $s;
74 74
 		
75 75
 		return $sql;
76
diff -urN adodb508a/drivers/adodb-oci8.inc.php adodb/drivers/adodb-oci8.inc.php
77
--- adodb508a/drivers/adodb-oci8.inc.php	2009-05-16 00:45:11.000000000 +0200
76
diff -urN adodb510/drivers/adodb-oci8.inc.php adodb/drivers/adodb-oci8.inc.php
77
--- adodb510/drivers/adodb-oci8.inc.php	2009-05-16 00:45:11.000000000 +0200
78 78
+++ adodb/drivers/adodb-oci8.inc.php	2009-05-16 00:45:17.000000000 +0200
79 79
@@ -106,7 +106,7 @@
80 80
 		$ADODB_FETCH_MODE = ADODB_FETCH_NUM;
typo3/sysext/adodb/doc/mssql-error-fix.patch (Arbeitskopie)
1
diff -urw adodb.481/drivers/adodb-odbc.inc.php adodb/drivers/adodb-odbc.inc.php
2
--- adodb.481/drivers/adodb-odbc.inc.php	2006-05-03 09:42:44.000000000 +0200
1
diff -urw adodb5/drivers/adodb-odbc.inc.php adodb/drivers/adodb-odbc.inc.php
2
--- adodb5/drivers/adodb-odbc.inc.php	2006-05-03 09:42:44.000000000 +0200
3 3
+++ adodb/drivers/adodb-odbc.inc.php	2006-05-15 13:52:08.000000000 +0200
4 4
@@ -513,6 +513,11 @@
5 5
 					$this->_errorMsg = odbc_errormsg();
typo3/sysext/adodb/doc/508a.DBAL.patch (Arbeitskopie)
1
diff -urN adodb508a/adodb-lib.inc.php adodb/adodb-lib.inc.php
2
--- adodb508a/adodb-lib.inc.php	2009-05-16 00:45:10.000000000 +0200
3
+++ adodb/adodb-lib.inc.php	2009-05-16 00:45:17.000000000 +0200
4
@@ -886,7 +886,7 @@
5
 	$values = substr($values, 0, -2);
6
 
7
 	// Append the fields and their values to the insert query.
8
-	return 'INSERT INTO '.$tableName.' ( '.$fields.' ) VALUES ( '.$values.' )';
9
+	return 'INSERT INTO '.$zthis->nameQuote.$tableName.$zthis->nameQuote.' ( '.$fields.' ) VALUES ( '.$values.' )';
10
 }
11
 
12
 
13
diff -urN adodb508a/datadict/datadict-oci8.inc.php adodb/datadict/datadict-oci8.inc.php
14
--- adodb508a/datadict/datadict-oci8.inc.php	2009-05-16 00:45:10.000000000 +0200
15
+++ adodb/datadict/datadict-oci8.inc.php	2009-05-16 00:45:17.000000000 +0200
16
@@ -110,6 +110,7 @@
17
 	
18
 	function AddColumnSQL($tabname, $flds)
19
 	{
20
+		$tabname = $this->TableName ($tabname);
21
 		$f = array();
22
 		list($lines,$pkey) = $this->_GenFields($flds);
23
 		$s = "ALTER TABLE $tabname ADD (";
24
@@ -124,6 +125,7 @@
25
 	
26
 	function AlterColumnSQL($tabname, $flds)
27
 	{
28
+		$tabname = $this->TableName ($tabname);
29
 		$f = array();
30
 		list($lines,$pkey) = $this->_GenFields($flds);
31
 		$s = "ALTER TABLE $tabname MODIFY(";
32
@@ -137,6 +139,7 @@
33
 	
34
 	function DropColumnSQL($tabname, $flds)
35
 	{
36
+		$tabname = $this->TableName ($tabname);
37
 		if (!is_array($flds)) $flds = explode(',',$flds);
38
 		foreach ($flds as $k => $v) $flds[$k] = $this->NameQuote($v);
39
 		
40
@@ -260,9 +263,9 @@
41
 		}
42
 		
43
 		if ( is_array($flds) )
44
-			$flds = implode(', ',$flds);
45
-		$s = 'CREATE' . $unique . ' INDEX ' . $idxname . ' ON ' . $tabname . ' (' . $flds . ')';
46
-		
47
+			$flds = implode('", "',$flds);
48
+		$s = 'CREATE' . $unique . ' INDEX "' . $idxname . '" ON "' .$tabname . '" ("' . $flds . '")';
49
+
50
 		if ( isset($idxoptions[$this->upperName]) )
51
 			$s .= $idxoptions[$this->upperName];
52
 		
53
diff -urN adodb508a/datadict/datadict-postgres.inc.php adodb/datadict/datadict-postgres.inc.php
54
--- adodb508a/datadict/datadict-postgres.inc.php	2009-05-16 00:45:10.000000000 +0200
55
+++ adodb/datadict/datadict-postgres.inc.php	2009-05-16 00:45:17.000000000 +0200
56
@@ -418,7 +418,7 @@
57
 		
58
 		$unique = isset($idxoptions['UNIQUE']) ? ' UNIQUE' : '';
59
 		
60
-		$s = 'CREATE' . $unique . ' INDEX ' . $idxname . ' ON ' . $tabname . ' ';
61
+		$s = 'CREATE' . $unique . ' INDEX "' . $idxname . '" ON "' . $tabname . '" ';
62
 		
63
 		if (isset($idxoptions['HASH']))
64
 			$s .= 'USING HASH ';
65
@@ -427,8 +427,8 @@
66
 			$s .= $idxoptions[$this->upperName];
67
 		
68
 		if ( is_array($flds) )
69
-			$flds = implode(', ',$flds);
70
-		$s .= '(' . $flds . ')';
71
+			$flds = implode('", "',$flds);
72
+		$s .= '("' . $flds . '")';
73
 		$sql[] = $s;
74
 		
75
 		return $sql;
76
diff -urN adodb508a/drivers/adodb-oci8.inc.php adodb/drivers/adodb-oci8.inc.php
77
--- adodb508a/drivers/adodb-oci8.inc.php	2009-05-16 00:45:11.000000000 +0200
78
+++ adodb/drivers/adodb-oci8.inc.php	2009-05-16 00:45:17.000000000 +0200
79
@@ -106,7 +106,7 @@
80
 		$ADODB_FETCH_MODE = ADODB_FETCH_NUM;
81
 		if ($this->fetchMode !== false) $savem = $this->SetFetchMode(false);
82
 		
83
-		$rs = $this->Execute(sprintf($this->metaColumnsSQL,strtoupper($table)));
84
+		$rs = $this->Execute(sprintf($this->metaColumnsSQL,$table));
85
 		
86
 		if (isset($savem)) $this->SetFetchMode($savem);
87
 		$ADODB_FETCH_MODE = $save;
typo3/sysext/adodb/adodb/adodb-datadict.inc.php (Arbeitskopie)
1 1
<?php
2 2

  
3 3
/**
4
  V5.08 6 Apr 2009   (c) 2000-2009 John Lim (jlim#natsoft.com). All rights reserved.
4
  V5.10 10 Nov 2009   (c) 2000-2009 John Lim (jlim#natsoft.com). 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, 
7 7
  the BSD license will take precedence.
......
519 519
			// genfields can return FALSE at times
520 520
			if ($lines == null) $lines = array();
521 521
			list(,$first) = each($lines);
522
			list(,$column_def) = split("[\t ]+",$first,2);
522
			list(,$column_def) = preg_split("/[\t ]+/",$first,2);
523 523
		}
524 524
		return array(sprintf($this->renameColumn,$tabname,$this->NameQuote($oldcolumn),$this->NameQuote($newcolumn),$column_def));
525 525
	}
typo3/sysext/adodb/adodb/adodb-exceptions.inc.php (Arbeitskopie)
1 1
<?php
2 2

  
3 3
/**
4
 * @version V5.08 6 Apr 2009   (c) 2000-2009 John Lim (jlim#natsoft.com). All rights reserved.
4
 * @version V5.10 10 Nov 2009   (c) 2000-2009 John Lim (jlim#natsoft.com). 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,
7 7
 * the BSD license will take precedence.
typo3/sysext/adodb/adodb/adodb-csvlib.inc.php (Arbeitskopie)
8 8

  
9 9
/* 
10 10

  
11
  V5.08 6 Apr 2009   (c) 2000-2009 John Lim (jlim#natsoft.com). All rights reserved.
11
  V5.10 10 Nov 2009   (c) 2000-2009 John Lim (jlim#natsoft.com). All rights reserved.
12 12
  Released under both BSD license and Lesser GPL library license. 
13 13
  Whenever there is any discrepancy between the two licenses, 
14 14
  the BSD license will take precedence. See License.txt. 
......
71 71
		$savefetch = isset($rs->adodbFetchMode) ? $rs->adodbFetchMode : $rs->fetchMode;
72 72
		$class = $rs->connection->arrayClass;
73 73
		$rs2 = new $class();
74
		$rs2->timeCreated = $rs->timeCreated; # memcache fix
74 75
		$rs2->sql = $rs->sql;
75 76
		$rs2->oldProvider = $rs->dataProvider; 
76 77
		$rs2->InitArrayFields($rows,$flds);
typo3/sysext/adodb/adodb/adodb-errorhandler.inc.php (Arbeitskopie)
1 1
<?php
2 2
/**
3
 * @version V5.08 6 Apr 2009   (c) 2000-2009 John Lim (jlim#natsoft.com). All rights reserved.
3
 * @version V5.10 10 Nov 2009   (c) 2000-2009 John Lim (jlim#natsoft.com). All rights reserved.
4 4
 * Released under both BSD license and Lesser GPL library license.
5 5
 * Whenever there is any discrepancy between the two licenses,
6 6
 * the BSD license will take precedence.
typo3/sysext/adodb/adodb/adodb-active-record.inc.php (Arbeitskopie)
1 1
<?php
2 2
/*
3 3

  
4
@version V5.08 6 Apr 2009   (c) 2000-2009 John Lim (jlim#natsoft.com). All rights reserved.
4
@version V5.10 10 Nov 2009   (c) 2000-2009 John Lim (jlim#natsoft.com). All rights reserved.
5 5
  Latest version is available at http://adodb.sourceforge.net
6 6
 
7 7
  Released under both BSD license and Lesser GPL library license. 
......
26 26
$_ADODB_ACTIVE_DBS = array();
27 27
$ACTIVE_RECORD_SAFETY = true;
28 28
$ADODB_ACTIVE_DEFVALS = false;
29
$ADODB_ACTIVE_CACHESECS = 0;
29 30

  
30 31
class ADODB_Active_DB {
31 32
	var $db; // ADOConnection
......
73 74

  
74 75
class ADODB_Active_Record {
75 76
	static $_changeNames = true; // dynamically pluralize table names
77
	static $_quoteNames = false;
78
	
76 79
	static $_foreignSuffix = '_id'; // 
77 80
	var $_dbat; // associative index pointing to ADODB_Active_DB eg. $ADODB_Active_DBS[_dbat]
78 81
	var $_table; // tablename, if set in class definition then use it as table name
......
655 658
	}
656 659
	
657 660
	
661
	function _QName($n,$db=false)
662
	{
663
		if (!ADODB_Active_Record::$_quoteNames) return $n;
664
		if (!$db) $db = $this->DB(); if (!$db) return false;
665
		return $db->nameQuote.$n.$db->nameQuote;
666
	}
667
	
658 668
	//------------------------------------------------------------ Public functions below
659 669
	
660 670
	function Load($where=null,$bindarr=false)
......
708 718
		return $ok;
709 719
	}
710 720
	
721
	
711 722
	// false on error
712 723
	function Insert()
713 724
	{
......
723 734
			$val = $this->$name;
724 735
			if(!is_array($val) || !is_null($val) || !array_key_exists($name, $table->keys)) {
725 736
				$valarr[] = $val;
726
				$names[] = $name;
737
				$names[] = $this->_QName($name,$db);
727 738
				$valstr[] = $db->Param($cnt);
728 739
				$cnt += 1;
729 740
			}
......
883 894
				continue;
884 895
			}			
885 896
			$valarr[] = $val;
886
			$pairs[] = $name.'='.$db->Param($cnt);
897
			$pairs[] = $this->_QName($name,$db).'='.$db->Param($cnt);
887 898
			$cnt += 1;
888 899
		}
889 900
		
......
922 933
	{
923 934
		$rows = false;
924 935
		if(isset($extra['offset'])) {
925
			$rs = $db->SelectLimit($qry, $extra['limit'], $extra['offset']);
936
			$rs = $db->SelectLimit($qry, $extra['limit'], $extra['offset'],$bindarr);
926 937
		} else {
927
			$rs = $db->SelectLimit($qry, $extra['limit']);
938
			$rs = $db->SelectLimit($qry, $extra['limit'],-1,$bindarr);
928 939
		}
929 940
		if ($rs) {
930 941
			while (!$rs->EOF) {
typo3/sysext/adodb/adodb/adodb-iterator.inc.php (Arbeitskopie)
1 1
<?php
2 2

  
3 3
/*
4
  V5.08 6 Apr 2009   (c) 2000-2009 John Lim (jlim#natsoft.com). All rights reserved.
4
  V5.10 10 Nov 2009   (c) 2000-2009 John Lim (jlim#natsoft.com). 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, 
7 7
  the BSD license will take precedence.
typo3/sysext/adodb/adodb/adodb-time.inc.php (Arbeitskopie)
1214 1214
		
1215 1215
		// for windows, we don't check 1970 because with timezone differences, 
1216 1216
		// 1 Jan 1970 could generate negative timestamp, which is illegal
1217
		$usephpfns = (1971 < $year && $year < 2038
1217
		$usephpfns = (1970 < $year && $year < 2038
1218 1218
			|| !defined('ADODB_NO_NEGATIVE_TS') && (1901 < $year && $year < 2038)
1219 1219
			); 
1220 1220
			
typo3/sysext/adodb/adodb/adodb-pager.inc.php (Arbeitskopie)
1 1
<?php
2 2

  
3 3
/*
4
	V5.08 6 Apr 2009   (c) 2000-2009 John Lim (jlim#natsoft.com). All rights reserved.
4
	V5.10 10 Nov 2009   (c) 2000-2009 John Lim (jlim#natsoft.com). 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, 
7 7
	  the BSD license will take precedence. 
typo3/sysext/adodb/adodb/adodb.inc.php (Arbeitskopie)
14 14
/**
15 15
	\mainpage
16 16
	
17
	 @version V5.08 6 Apr 2009   (c) 2000-2009 John Lim (jlim#natsoft.com). All rights reserved.
17
	 @version V5.10 10 Nov 2009   (c) 2000-2009 John Lim (jlim#natsoft.com). All rights reserved.
18 18

  
19 19
	Released under both BSD license and Lesser GPL library license. You can choose which license
20 20
	you prefer.
......
177 177
		/**
178 178
		 * ADODB version as a string.
179 179
		 */
180
		$ADODB_vers = 'V5.08 6 Apr 2009  (c) 2000-2009 John Lim (jlim#natsoft.com). All rights reserved. Released BSD & LGPL.';
180
		$ADODB_vers = 'V5.10 10 Nov 2009  (c) 2000-2009 John Lim (jlim#natsoft.com). All rights reserved. Released BSD & LGPL.';
181 181
	
182 182
		/**
183 183
		 * Determines whether recordset->RecordCount() is used. 
......
377 377

  
378 378
	var $sysDate = false; /// name of function that returns the current date
379 379
	var $sysTimeStamp = false; /// name of function that returns the current timestamp
380
	var $sysUTimeStamp = false; // name of function that returns the current timestamp accurate to the microsecond or nearest fraction
380 381
	var $arrayClass = 'ADORecordSet_array'; /// name of class used to generate array recordsets, which are pre-downloaded recordsets
381 382
	
382 383
	var $noNullStrings = false; /// oracle specific stuff - if true ensures that '' is converted to ' '
......
515 516
		
516 517
		$this->_isPersistentConnection = false;	
517 518
			
518
		global $ADODB_CACHE;
519
		if (empty($ADODB_CACHE)) $this->_CreateCache();
520
		
521 519
		if ($forceNew) {
522 520
			if ($rez=$this->_nconnect($this->host, $this->user, $this->password, $this->database)) return true;
523 521
		} else {
......
584 582
			
585 583
		$this->_isPersistentConnection = true;	
586 584
		
587
		global $ADODB_CACHE;
588
		if (empty($ADODB_CACHE)) $this->_CreateCache();
589
		
590 585
		if ($rez = $this->_pconnect($this->host, $this->user, $this->password, $this->database)) return true;
591 586
		if (isset($rez)) {
592 587
			$err = $this->ErrorMsg();
......
721 716
	*  @param $table	name of table to lock
722 717
	*  @param $where	where clause to use, eg: "WHERE row=12". If left empty, will escalate to table lock
723 718
	*/
724
	function RowLock($table,$where)
719
	function RowLock($table,$where,$col='1 as ignore')
725 720
	{
726 721
		return false;
727 722
	}
......
1710 1705
	{
1711 1706
	global $ADODB_CACHE_DIR, $ADODB_CACHE;
1712 1707
		
1708
		if (empty($ADODB_CACHE)) return false;
1709
		
1713 1710
		if (!$sql) {
1714 1711
			 $ADODB_CACHE->flushall($this->debug);
1715 1712
	         return;
......
1766 1763
	{
1767 1764
	global $ADODB_CACHE;
1768 1765
	
1766
		if (empty($ADODB_CACHE)) $this->_CreateCache();
1767
		
1769 1768
		if (!is_numeric($secs2cache)) {
1770 1769
			$inputarr = $sql;
1771 1770
			$sql = $secs2cache;
......
1878 1877
		$rs = $this->SelectLimit($sql,1);
1879 1878
		if (!$rs) return $false; // table does not exist
1880 1879
		$rs->tableName = $table;
1880
		$rs->sql = $sql;
1881 1881
		
1882 1882
		switch((string) $mode) {
1883 1883
		case 'UPDATE':
......
2439 2439
		if (empty($d) && $d !== 0) return 'null';
2440 2440
		if ($isfld) return $d;
2441 2441
		
2442
		if (is_object($d)) return $d->format($this->fmtDate);
2443
		
2444
		
2442 2445
		if (is_string($d) && !is_numeric($d)) {
2443 2446
			if ($d === 'null' || strncmp($d,"'",1) === 0) return $d;
2444 2447
			if ($this->isoDates) return "'$d'";
......
2476 2479
	{
2477 2480
		if (empty($ts) && $ts !== 0) return 'null';
2478 2481
		if ($isfld) return $ts;
2482
		if (is_object($ts)) return $ts->format($this->fmtTimeStamp);
2479 2483
		
2480 2484
		# strlen(14) allows YYYYMMDDHHMMSS format
2481 2485
		if (!is_string($ts) || (is_numeric($ts) && strlen($ts)<14)) 
......
2604 2608
		// undo magic quotes for "
2605 2609
		$s = str_replace('\\"','"',$s);
2606 2610
		
2607
		if ($this->replaceQuote == "\\'")  // ' already quoted, no need to change anything
2611
		if ($this->replaceQuote == "\\'" || ini_get('magic_quotes_sybase'))  // ' already quoted, no need to change anything
2608 2612
			return $s;
2609 2613
		else {// change \' to '' for sybase/mssql
2610 2614
			$s = str_replace('\\\\','\\',$s);
......
2638 2642
		// undo magic quotes for "
2639 2643
		$s = str_replace('\\"','"',$s);
2640 2644
		
2641
		if ($this->replaceQuote == "\\'")  // ' already quoted, no need to change anything
2645
		if ($this->replaceQuote == "\\'" || ini_get('magic_quotes_sybase'))  // ' already quoted, no need to change anything
2642 2646
			return "'$s'";
2643 2647
		else {// change \' to '' for sybase/mssql
2644 2648
			$s = str_replace('\\\\','\\',$s);
......
4254 4258
					case 'socket': $obj->socket = $v; break;
4255 4259
					#oci8
4256 4260
					case 'nls_date_format': $obj->NLS_DATE_FORMAT = $v; break;
4261
					case 'cachesecs': $obj->cacheSecs = $v; break;
4262
					case 'memcache': 
4263
						$varr = explode(':',$v);
4264
						$vlen = sizeof($varr);
4265
						if ($vlen == 0) break;	
4266
						$obj->memCache = true;
4267
						$obj->memCacheHost = explode(',',$varr[0]);
4268
						if ($vlen == 1) break;	
4269
						$obj->memCachePort = $varr[1];
4270
						if ($vlen == 2) break;	
4271
						$obj->memCacheCompress = $varr[2] ?  true : false;
4272
						break;
4257 4273
					}
4258 4274
				}
4259 4275
				if (empty($persist))
typo3/sysext/adodb/adodb/adodb-memcache.lib.inc.php (Arbeitskopie)
65 65

  
66 66
			$memcache = new MemCache;
67 67
			
68
			if (!is_array($this->hosts)) $this->hosts = array($hosts);
68
			if (!is_array($this->hosts)) $this->hosts = array($this->hosts);
69 69
		
70 70
			$failcnt = 0;
71 71
			foreach($this->hosts as $host) {
typo3/sysext/adodb/adodb/datadict/datadict-firebird.inc.php (Arbeitskopie)
1 1
<?php
2 2

  
3 3
/**
4
  V5.08 6 Apr 2009   (c) 2000-2009 John Lim (jlim#natsoft.com). All rights reserved.
4
  V5.10 10 Nov 2009   (c) 2000-2009 John Lim (jlim#natsoft.com). 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, 
7 7
  the BSD license will take precedence.
......
30 30
		case 'B': return 'BLOB';
31 31
			
32 32
		case 'D': return 'DATE';
33
		case 'TS':
33 34
		case 'T': return 'TIMESTAMP';
34 35
		
35 36
		case 'L': return 'SMALLINT';
typo3/sysext/adodb/adodb/datadict/datadict-postgres.inc.php (Arbeitskopie)
1 1
<?php
2 2

  
3 3
/**
4
  V5.08 6 Apr 2009   (c) 2000-2009 John Lim (jlim#natsoft.com). All rights reserved.
4
  V5.10 10 Nov 2009   (c) 2000-2009 John Lim (jlim#natsoft.com). 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, 
7 7
  the BSD license will take precedence.
......
100 100
		case 'B': return 'BYTEA';
101 101
			
102 102
		case 'D': return 'DATE';
103
		case 'TS':
103 104
		case 'T': return 'TIMESTAMP';
104 105
		
105 106
		case 'L': return 'BOOLEAN';
typo3/sysext/adodb/adodb/datadict/datadict-sybase.inc.php (Arbeitskopie)
1 1
<?php
2 2

  
3 3
/**
4
  V5.08 6 Apr 2009   (c) 2000-2009 John Lim (jlim#natsoft.com). All rights reserved.
4
  V5.10 10 Nov 2009   (c) 2000-2009 John Lim (jlim#natsoft.com). 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, 
7 7
  the BSD license will take precedence.
......
55 55
		case 'B': return 'IMAGE';
56 56
			
57 57
		case 'D': return 'DATETIME';
58
		case 'TS':
58 59
		case 'T': return 'DATETIME';
59 60
		case 'L': return 'BIT';
60 61
		
typo3/sysext/adodb/adodb/datadict/datadict-mssqlnative.inc.php (Arbeitskopie)
1 1
<?php
2 2

  
3 3
/**
4
  V5.08 6 Apr 2009   (c) 2000-2009 John Lim (jlim#natsoft.com). All rights reserved.
4
  V5.10 10 Nov 2009   (c) 2000-2009 John Lim (jlim#natsoft.com). 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, 
7 7
  the BSD license will take precedence.
typo3/sysext/adodb/adodb/datadict/datadict-db2.inc.php (Arbeitskopie)
1 1
<?php
2 2

  
3 3
/**
4
  V5.08 6 Apr 2009   (c) 2000-2009 John Lim (jlim#natsoft.com). All rights reserved.
4
  V5.10 10 Nov 2009   (c) 2000-2009 John Lim (jlim#natsoft.com). 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, 
7 7
  the BSD license will take precedence.
......
30 30
		case 'B': return 'BLOB';
31 31

  
32 32
		case 'D': return 'DATE';
33
		case 'TS':
33 34
		case 'T': return 'TIMESTAMP';
34 35

  
35 36
		case 'L': return 'SMALLINT';
typo3/sysext/adodb/adodb/datadict/datadict-sapdb.inc.php (Arbeitskopie)
33 33
		case 'B': return 'LONG';
34 34
			
35 35
		case 'D': return 'DATE';
36
		case 'TS':
36 37
		case 'T': return 'TIMESTAMP';
37 38
		
38 39
		case 'L': return 'BOOLEAN';
typo3/sysext/adodb/adodb/datadict/datadict-informix.inc.php (Arbeitskopie)
1 1
<?php
2 2

  
3 3
/**
4
  V5.08 6 Apr 2009   (c) 2000-2009 John Lim (jlim#natsoft.com). All rights reserved.
4
  V5.10 10 Nov 2009   (c) 2000-2009 John Lim (jlim#natsoft.com). 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, 
7 7
  the BSD license will take precedence.
......
32 32
		case 'B': return 'BLOB';
33 33
			
34 34
		case 'D': return 'DATE';
35
		case 'TS':
35 36
		case 'T': return 'DATETIME YEAR TO SECOND';
36 37
		
37 38
		case 'L': return 'SMALLINT';
typo3/sysext/adodb/adodb/datadict/datadict-generic.inc.php (Arbeitskopie)
1 1
<?php
2 2

  
3 3
/**
4
  V5.08 6 Apr 2009   (c) 2000-2009 John Lim (jlim#natsoft.com). All rights reserved.
4
  V5.10 10 Nov 2009   (c) 2000-2009 John Lim (jlim#natsoft.com). 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, 
7 7
  the BSD license will take precedence.
......
32 32
		case 'B': return 'VARCHAR';
33 33
			
34 34
		case 'D': return 'DATE';
35
		case 'TS':
35 36
		case 'T': return 'DATE';
36 37
		
37 38
		case 'L': return 'DECIMAL(1)';
typo3/sysext/adodb/adodb/datadict/datadict-mssql.inc.php (Arbeitskopie)
1 1
<?php
2 2

  
3 3
/**
4
  V5.08 6 Apr 2009   (c) 2000-2009 John Lim (jlim#natsoft.com). All rights reserved.
4
  V5.10 10 Nov 2009   (c) 2000-2009 John Lim (jlim#natsoft.com). 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, 
7 7
  the BSD license will take precedence.
......
89 89
		case 'B': return 'IMAGE';
90 90
			
91 91
		case 'D': return 'DATETIME';
92
		
93
		case 'TS':
92 94
		case 'T': return 'DATETIME';
93 95
		case 'L': return 'BIT';
94 96
		
typo3/sysext/adodb/adodb/datadict/datadict-access.inc.php (Arbeitskopie)
1 1
<?php
2 2

  
3 3
/**
4
  V5.08 6 Apr 2009   (c) 2000-2009 John Lim (jlim#natsoft.com). All rights reserved.
4
  V5.10 10 Nov 2009   (c) 2000-2009 John Lim (jlim#natsoft.com). 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, 
7 7
  the BSD license will take precedence.
......
30 30
		case 'X2': return 'MEMO';
31 31
		
32 32
		case 'B': return 'BINARY';
33
			
33
		
34
		case 'TS':
34 35
		case 'D': return 'DATETIME';
35 36
		case 'T': return 'DATETIME';
36 37
		
typo3/sysext/adodb/adodb/datadict/datadict-oci8.inc.php (Arbeitskopie)
1 1
<?php
2 2

  
3 3
/**
4
  V5.08 6 Apr 2009   (c) 2000-2009 John Lim (jlim#natsoft.com). All rights reserved.
4
  V5.10 10 Nov 2009   (c) 2000-2009 John Lim (jlim#natsoft.com). 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, 
7 7
  the BSD license will take precedence.
......
55 55
		case 'BLOB':
56 56
			return 'B';
57 57
		
58
		case 'TIMESTAMP':
59
			return 'TS';
60
			
58 61
		case 'DATE': 
59 62
			return 'T';
60 63
		
......
79 82
		case 'X2': return 'NVARCHAR2(4000)';
80 83
		
81 84
		case 'B': return 'BLOB';
82
			
85
		
86
		case 'TS':
87
				return 'TIMESTAMP';
88
				
83 89
		case 'D': 
84 90
		case 'T': return 'DATE';
85 91
		case 'L': return 'NUMBER(1)';
typo3/sysext/adodb/adodb/datadict/datadict-ibase.inc.php (Arbeitskopie)
1 1
<?php
2 2

  
3 3
/**
4
  V5.08 6 Apr 2009   (c) 2000-2009 John Lim (jlim#natsoft.com). All rights reserved.
4
  V5.10 10 Nov 2009   (c) 2000-2009 John Lim (jlim#natsoft.com). 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, 
7 7
  the BSD license will take precedence.
......
32 32
		case 'B': return 'BLOB';
33 33
			
34 34
		case 'D': return 'DATE';
35
		case 'TS':
35 36
		case 'T': return 'TIMESTAMP';
36 37
		
37 38
		case 'L': return 'SMALLINT';
typo3/sysext/adodb/adodb/datadict/datadict-mysql.inc.php (Arbeitskopie)
1 1
<?php
2 2

  
3 3
/**
4
  V5.08 6 Apr 2009   (c) 2000-2009 John Lim (jlim#natsoft.com). All rights reserved.
4
  V5.10 10 Nov 2009   (c) 2000-2009 John Lim (jlim#natsoft.com). 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, 
7 7
  the BSD license will take precedence.
......
89 89
		case 'B': return 'LONGBLOB';
90 90
			
91 91
		case 'D': return 'DATE';
92
		case 'TS':
92 93
		case 'T': return 'DATETIME';
93 94
		case 'L': return 'TINYINT';
94 95
		
typo3/sysext/adodb/adodb/drivers/adodb-pdo_oci.inc.php (Arbeitskopie)
2 2

  
3 3

  
4 4
/*
5
V5.08 6 Apr 2009   (c) 2000-2009 John Lim (jlim#natsoft.com). All rights reserved.
5
V5.10 10 Nov 2009   (c) 2000-2009 John Lim (jlim#natsoft.com). All rights reserved.
6 6
  Released under both BSD license and Lesser GPL library license. 
7 7
  Whenever there is any discrepancy between the two licenses, 
8 8
  the BSD license will take precedence.
typo3/sysext/adodb/adodb/drivers/adodb-odbtp_unicode.inc.php (Arbeitskopie)
1 1
<?php
2 2
/*
3
	V5.08 6 Apr 2009   (c) 2000-2009 John Lim (jlim#natsoft.com). All rights reserved.
3
	V5.10 10 Nov 2009   (c) 2000-2009 John Lim (jlim#natsoft.com). All rights reserved.
4 4
  Released under both BSD license and Lesser GPL library license.
5 5
  Whenever there is any discrepancy between the two licenses,
6 6
  the BSD license will take precedence. See License.txt.
typo3/sysext/adodb/adodb/drivers/adodb-ldap.inc.php (Arbeitskopie)
1 1
<?php
2 2
/*
3
  V5.08 6 Apr 2009   (c) 2000-2009 John Lim (jlim#natsoft.com). All rights reserved.
3
  V5.10 10 Nov 2009   (c) 2000-2009 John Lim (jlim#natsoft.com). All rights reserved.
4 4
   Released under both BSD license and Lesser GPL library license. 
5 5
  Whenever there is any discrepancy between the two licenses, 
6 6
  the BSD license will take precedence.
......
61 61
			$conn_info = array( $host,$this->port);
62 62
		
63 63
			if ( strstr( $host, ':' ) ) {
64
			    $conn_info = split( ':', $host );
64
			    $conn_info = explode( ':', $host );
65 65
			} 
66 66
		
67 67
			$this->_connectionID = @ldap_connect( $conn_info[0], $conn_info[1] );
typo3/sysext/adodb/adodb/drivers/adodb-postgres64.inc.php (Arbeitskopie)
1 1
<?php
2 2
/*
3
 V5.08 6 Apr 2009   (c) 2000-2009 John Lim (jlim#natsoft.com). All rights reserved.
3
 V5.10 10 Nov 2009   (c) 2000-2009 John Lim (jlim#natsoft.com). All rights reserved.
4 4
  Released under both BSD license and Lesser GPL library license. 
5 5
  Whenever there is any discrepancy between the two licenses, 
6 6
  the BSD license will take precedence.
......
104 104
	var $random = 'random()';		/// random function
105 105
	var $autoRollback = true; // apparently pgsql does not autorollback properly before php 4.3.4
106 106
							// http://bugs.php.net/bug.php?id=25404
107
							
107
	
108
	var $uniqueIisR = true;
108 109
	var $_bindInputArray = false; // requires postgresql 7.3+ and ability to modify database
109 110
	var $disableBlobs = false; // set to true to disable blob checking, resulting in 2-5% improvement in performance.
110 111
	
......
177 178
		return @pg_Exec($this->_connectionID, "begin ".$this->_transmode);
178 179
	}
179 180
	
180
	function RowLock($tables,$where,$flds='1 as ignore') 
181
	function RowLock($tables,$where,$col='1 as ignore') 
181 182
	{
182 183
		if (!$this->transCnt) $this->BeginTrans();
183
		return $this->GetOne("select $flds from $tables where $where for update");
184
		return $this->GetOne("select $col from $tables where $where for update");
184 185
	}
185 186

  
186 187
	// returns true/false. 
......
459 460
			if (10 <= $len && $len <= 12) $date = 'date '.$date;
460 461
			else $date = 'timestamp '.$date;
461 462
		}
462
		return "($date+interval'$dayFraction days')";
463
		
464
		
465
		return "($date+interval'".($dayFraction * 1440)." minutes')";
466
		#return "($date+interval'$dayFraction days')";
463 467
	}
464 468
	
465 469

  
......
661 665
			if (strlen($db) == 0) $db = 'template1';
662 666
			$db = adodb_addslashes($db);
663 667
		   	if ($str)  {
664
			 	$host = split(":", $str);
668
			 	$host = explode(":", $str);
665 669
				if ($host[0]) $str = "host=".adodb_addslashes($host[0]);
666 670
				else $str = '';
667 671
				if (isset($host[1])) $str .= " port=$host[1]";
......
1052 1056
				case 'INT4':
1053 1057
				case 'INT2':
1054 1058
					if (isset($fieldobj) &&
1055
				empty($fieldobj->primary_key) && empty($fieldobj->unique)) return 'I';
1059
				empty($fieldobj->primary_key) && (!$this->connection->uniqueIisR || empty($fieldobj->unique))) return 'I';
1056 1060
				
1057 1061
				case 'OID':
1058 1062
				case 'SERIAL':
typo3/sysext/adodb/adodb/drivers/adodb-ado_mssql.inc.php (Arbeitskopie)
1 1
<?php
2 2
/* 
3
V5.08 6 Apr 2009   (c) 2000-2009 John Lim (jlim#natsoft.com). All rights reserved.
3
V5.10 10 Nov 2009   (c) 2000-2009 John Lim (jlim#natsoft.com). All rights reserved.
4 4
  Released under both BSD license and Lesser GPL library license. 
5 5
  Whenever there is any discrepancy between the two licenses, 
6 6
  the BSD license will take precedence. 
......
71 71
		return str_replace("\0", "\\\\000", $s);
72 72
	}
73 73
	
74
	function MetaColumns($table)
74
	function MetaColumns($table, $normalize=true)
75 75
	{
76 76
        $table = strtoupper($table);
77 77
        $arr= array();
typo3/sysext/adodb/adodb/drivers/adodb-ibase.inc.php (Arbeitskopie)
1 1
<?php
2 2
/*
3
V5.08 6 Apr 2009   (c) 2000-2009 John Lim (jlim#natsoft.com). All rights reserved.  
3
V5.10 10 Nov 2009   (c) 2000-2009 John Lim (jlim#natsoft.com). All rights reserved.  
4 4
  Released under both BSD license and Lesser GPL library license. 
5 5
  Whenever there is any discrepancy between the two licenses, 
6 6
  the BSD license will take precedence.
......
242 242

  
243 243
	
244 244
	// See http://community.borland.com/article/0,1410,25844,00.html
245
	function RowLock($tables,$where,$col)
245
	function RowLock($tables,$where,$col=false)
246 246
	{
247 247
		if ($this->autoCommit) $this->BeginTrans();
248 248
		$this->Execute("UPDATE $table SET $col=$col WHERE $where "); // is this correct - jlim?
......
476 476
	}
477 477
	//OPN STUFF end
478 478
		// returns array of ADOFieldObjects for current table
479
	function MetaColumns($table) 
479
	function MetaColumns($table, $normalize=true) 
480 480
	{
481 481
	global $ADODB_FETCH_MODE;
482 482
		
typo3/sysext/adodb/adodb/drivers/adodb-borland_ibase.inc.php (Arbeitskopie)
1 1
<?php
2 2
/* 
3
V5.08 6 Apr 2009   (c) 2000-2009 John Lim (jlim#natsoft.com). All rights reserved.
3
V5.10 10 Nov 2009   (c) 2000-2009 John Lim (jlim#natsoft.com). All rights reserved.
4 4
  Released under both BSD license and Lesser GPL library license. 
5 5
  Whenever there is any discrepancy between the two licenses, 
6 6
  the BSD license will take precedence. 
typo3/sysext/adodb/adodb/drivers/adodb-firebird.inc.php (Arbeitskopie)
1 1
<?php
2 2
/* 
3
V5.08 6 Apr 2009   (c) 2000-2009 John Lim (jlim#natsoft.com). All rights reserved.
3
V5.10 10 Nov 2009   (c) 2000-2009 John Lim (jlim#natsoft.com). All rights reserved.
4 4
  Released under both BSD license and Lesser GPL library license. 
5 5
  Whenever there is any discrepancy between the two licenses, 
6 6
  the BSD license will take precedence. 
typo3/sysext/adodb/adodb/drivers/adodb-sybase.inc.php (Arbeitskopie)
1 1
<?php
2 2
/* 
3
V5.08 6 Apr 2009   (c) 2000-2009 John Lim. All rights reserved.
3
V5.10 10 Nov 2009   (c) 2000-2009 John Lim. All rights reserved.
4 4
  Released under both BSD license and Lesser GPL library license. 
5 5
  Whenever there is any discrepancy between the two licenses, 
6 6
  the BSD license will take precedence. 
......
86 86
	}
87 87
	
88 88
	// http://www.isug.com/Sybase_FAQ/ASE/section6.1.html#6.1.4
89
	function RowLock($tables,$where,$flds='top 1 null as ignore') 
89
	function RowLock($tables,$where,$col='top 1 null as ignore') 
90 90
	{
91 91
		if (!$this->_hastrans) $this->BeginTrans();
92 92
		$tables = str_replace(',',' HOLDLOCK,',$tables);
93
		return $this->GetOne("select $flds from $tables HOLDLOCK where $where");
93
		return $this->GetOne("select $col from $tables HOLDLOCK where $where");
94 94
		
95 95
	}	
96 96
		
typo3/sysext/adodb/adodb/drivers/adodb-pdo_pgsql.inc.php (Arbeitskopie)
1 1
<?php
2 2

  
3 3
/*
4
V5.08 6 Apr 2009   (c) 2000-2009 John Lim (jlim#natsoft.com). All rights reserved.
4
V5.10 10 Nov 2009   (c) 2000-2009 John Lim (jlim#natsoft.com). 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, 
7 7
  the BSD license will take precedence.
typo3/sysext/adodb/adodb/drivers/adodb-sapdb.inc.php (Arbeitskopie)
1 1
<?php
2 2
/* 
3
V5.08 6 Apr 2009   (c) 2000-2009 John Lim (jlim#natsoft.com). All rights reserved.
3
V5.10 10 Nov 2009   (c) 2000-2009 John Lim (jlim#natsoft.com). All rights reserved.
4 4
  Released under both BSD license and Lesser GPL library license. 
5 5
  Whenever there is any discrepancy between the two licenses, 
6 6
  the BSD license will take precedence. 
typo3/sysext/adodb/adodb/drivers/adodb-csv.inc.php (Arbeitskopie)
1 1
<?php
2 2
/*
3
V5.08 6 Apr 2009   (c) 2000-2009 John Lim (jlim#natsoft.com). All rights reserved.
3
V5.10 10 Nov 2009   (c) 2000-2009 John Lim (jlim#natsoft.com). All rights reserved.
4 4
  Released under both BSD license and Lesser GPL library license. 
5 5
  Whenever there is any discrepancy between the two licenses, 
6 6
  the BSD license will take precedence.
......
72 72
		return true;
73 73
	}
74 74
	
75
 	function MetaColumns($table) 
75
 	function MetaColumns($table, $normalize=true) 
76 76
	{
77 77
		return false;
78 78
	}
typo3/sysext/adodb/adodb/drivers/adodb-postgres7.inc.php (Arbeitskopie)
1 1
<?php
2 2
/*
3
 V5.08 6 Apr 2009   (c) 2000-2009 John Lim (jlim#natsoft.com). All rights reserved.
3
 V5.10 10 Nov 2009   (c) 2000-2009 John Lim (jlim#natsoft.com). All rights reserved.
4 4
  Released under both BSD license and Lesser GPL library license. 
5 5
  Whenever there is any discrepancy between the two licenses, 
6 6
  the BSD license will take precedence.
typo3/sysext/adodb/adodb/drivers/adodb-postgres8.inc.php (Arbeitskopie)
1 1
<?php
2 2
/*
3
 V5.08 6 Apr 2009   (c) 2000-2009 John Lim (jlim#natsoft.com). All rights reserved.
3
 V5.10 10 Nov 2009   (c) 2000-2009 John Lim (jlim#natsoft.com). All rights reserved.
4 4
  Released under both BSD license and Lesser GPL library license. 
5 5
  Whenever there is any discrepancy between the two licenses, 
6 6
  the BSD license will take precedence.
typo3/sysext/adodb/adodb/drivers/adodb-mssql.inc.php (Arbeitskopie)
1 1
<?php
2 2
/* 
3
V5.08 6 Apr 2009   (c) 2000-2009 John Lim (jlim#natsoft.com). All rights reserved.
3
V5.10 10 Nov 2009   (c) 2000-2009 John Lim (jlim#natsoft.com). All rights reserved.
4 4
  Released under both BSD license and Lesser GPL library license. 
5 5
  Whenever there is any discrepancy between the two licenses, 
6 6
  the BSD license will take precedence. 
......
160 160
		}
161 161
	}
162 162

  
163

  
164

  
165
	/**
166
	* Correctly quotes a string so that all strings are escaped. We prefix and append
167
	* to the string single-quotes.
168
	* An example is  $db->qstr("Don't bother",magic_quotes_runtime());
169
	* 
170
	* @param s         the string to quote
171
	* @param [magic_quotes]    if $s is GET/POST var, set to get_magic_quotes_gpc().
172
	*              This undoes the stupidity of magic quotes for GPC.
173
	*
174
	* @return  quoted string to be sent back to database
175
	*/
176
	function qstr($s,$magic_quotes=false)
177
	{
178
 		if (!$magic_quotes) {
179
 			return  "'".str_replace("'",$this->replaceQuote,$s)."'";
180
		}
181

  
182
 		// undo magic quotes for " unless sybase is on
183
 		$sybase = ini_get('magic_quotes_sybase');
184
 		if (!$sybase) {
185
 			$s = str_replace('\\"','"',$s);
186
 			if ($this->replaceQuote == "\\'")  // ' already quoted, no need to change anything
187
 				return "'$s'";
188
 			else {// change \' to '' for sybase/mssql
189
 				$s = str_replace('\\\\','\\',$s);
190
 				return "'".str_replace("\\'",$this->replaceQuote,$s)."'";
191
 			}
192
 		} else {
193
 			return "'".$s."'";
194
		}
195
	}
196
// moodle change end - see readme_moodle.txt
197

  
163 198
	function _affectedrows()
164 199
	{
165 200
		return $this->GetOne('select @@rowcount');
......
331 366
		
332 367
		See http://www.swynk.com/friends/achigrik/SQL70Locks.asp
333 368
	*/
334
	function RowLock($tables,$where,$flds='top 1 null as ignore') 
369
	function RowLock($tables,$where,$col='top 1 null as ignore') 
335 370
	{
336 371
		if (!$this->transCnt) $this->BeginTrans();
337
		return $this->GetOne("select $flds from $tables with (ROWLOCK,HOLDLOCK) where $where");
372
		return $this->GetOne("select $col from $tables with (ROWLOCK,HOLDLOCK) where $where");
338 373
	}
339 374
	
340 375
	
341
	function MetaIndexes($table,$primary=false)
376
	function MetaIndexes($table,$primary=false, $owner=false)
342 377
	{
343 378
		$table = $this->qstr($table);
344 379

  
typo3/sysext/adodb/adodb/drivers/adodb-sqlitepo.inc.php (Arbeitskopie)
1 1
<?php
2 2
/*
3
V5.08 6 Apr 2009   (c) 2000-2009 John Lim (jlim#natsoft.com). All rights reserved.
3
V5.10 10 Nov 2009   (c) 2000-2009 John Lim (jlim#natsoft.com). All rights reserved.
4 4
  Released under both BSD license and Lesser GPL library license.
5 5
  Whenever there is any discrepancy between the two licenses,
6 6
  the BSD license will take precedence.
typo3/sysext/adodb/adodb/drivers/adodb-access.inc.php (Arbeitskopie)
1 1
<?php
2 2
/* 
3
V5.08 6 Apr 2009   (c) 2000-2009 John Lim (jlim#natsoft.com). All rights reserved.
3
V5.10 10 Nov 2009   (c) 2000-2009 John Lim (jlim#natsoft.com). All rights reserved.
4 4
  Released under both BSD license and Lesser GPL library license. 
5 5
  Whenever there is any discrepancy between the two licenses, 
6 6
  the BSD license will take precedence. See License.txt. 
typo3/sysext/adodb/adodb/drivers/adodb-oci8po.inc.php (Arbeitskopie)
1 1
<?php
2 2
/*
3
V5.08 6 Apr 2009   (c) 2000-2009 John Lim. All rights reserved.
3
V5.10 10 Nov 2009   (c) 2000-2009 John Lim. All rights reserved.
4 4
  Released under both BSD license and Lesser GPL library license. 
5 5
  Whenever there is any discrepancy between the two licenses, 
6 6
  the BSD license will take precedence.
typo3/sysext/adodb/adodb/drivers/adodb-pdo_mssql.inc.php (Arbeitskopie)
2 2

  
3 3

  
4 4
/*
5
V5.08 6 Apr 2009   (c) 2000-2009 John Lim (jlim#natsoft.com). All rights reserved.
5
V5.10 10 Nov 2009   (c) 2000-2009 John Lim (jlim#natsoft.com). All rights reserved.
6 6
  Released under both BSD license and Lesser GPL library license. 
7 7
  Whenever there is any discrepancy between the two licenses, 
8 8
  the BSD license will take precedence.
typo3/sysext/adodb/adodb/drivers/adodb-ado.inc.php (Arbeitskopie)
1 1
<?php
2 2
/* 
3
V5.08 6 Apr 2009   (c) 2000-2009 John Lim (jlim#natsoft.com). All rights reserved.
3
V5.10 10 Nov 2009   (c) 2000-2009 John Lim (jlim#natsoft.com). All rights reserved.
4 4
  Released under both BSD license and Lesser GPL library license. 
5 5
  Whenever there is any discrepancy between the two licenses, 
6 6
  the BSD license will take precedence. 
......
169 169
		return $arr;
170 170
	}
171 171
	
172
	function MetaColumns($table)
172
	function MetaColumns($table, $normalize=true)
173 173
	{
174 174
		$table = strtoupper($table);
175 175
		$arr = array();
typo3/sysext/adodb/adodb/drivers/adodb-mysql.inc.php (Arbeitskopie)
1 1
<?php
2 2
/*
3
V5.08 6 Apr 2009   (c) 2000-2009 John Lim (jlim#natsoft.com). All rights reserved.
3
V5.10 10 Nov 2009   (c) 2000-2009 John Lim (jlim#natsoft.com). All rights reserved.
4 4
  Released under both BSD license and Lesser GPL library license. 
5 5
  Whenever there is any discrepancy between the two licenses, 
6 6
  the BSD license will take precedence.
......
349 349
		if (!$date) $date = $this->sysDate;
350 350
		
351 351
		$fraction = $dayFraction * 24 * 3600;
352
		return $date . ' + INTERVAL ' .	 $fraction.' SECOND';
352
		return '('. $date . ' + INTERVAL ' .	 $fraction.' SECOND)';
353 353
		
354 354
//		return "from_unixtime(unix_timestamp($date)+$fraction)";
355 355
	}
......
394 394
		return $this->_connect($argHostname, $argUsername, $argPassword, $argDatabasename);
395 395
	}
396 396
	
397
 	function MetaColumns($table) 
397
 	function MetaColumns($table, $normalize=true) 
398 398
	{
399 399
		$this->_findschema($table,$schema);
400 400
		if ($schema) {
typo3/sysext/adodb/adodb/drivers/adodb-mssqlnative.inc.php (Arbeitskopie)
1 1
<?php
2 2
/* 
3
V5.08 6 Apr 2009   (c) 2000-2009 John Lim (jlim#natsoft.com). All rights reserved.
3
V5.10 10 Nov 2009   (c) 2000-2009 John Lim (jlim#natsoft.com). All rights reserved.
4 4
  Released under both BSD license and Lesser GPL library license. 
5 5
  Whenever there is any discrepancy between the two licenses, 
6 6
  the BSD license will take precedence. 
......
330 330
		
331 331
		See http://www.swynk.com/friends/achigrik/SQL70Locks.asp
332 332
	*/
333
	function RowLock($tables,$where,$flds='top 1 null as ignore') 
333
	function RowLock($tables,$where,$col='top 1 null as ignore') 
334 334
	{
335 335
		if (!$this->transCnt) $this->BeginTrans();
336
		return $this->GetOne("select $flds from $tables with (ROWLOCK,HOLDLOCK) where $where");
336
		return $this->GetOne("select $col from $tables with (ROWLOCK,HOLDLOCK) where $where");
337 337
	}
338 338
	 
339 339
	function SelectDB($dbName) 
typo3/sysext/adodb/adodb/drivers/adodb-postgres.inc.php (Arbeitskopie)
1 1
<?php
2 2
/*
3
 V5.08 6 Apr 2009   (c) 2000-2009 John Lim (jlim#natsoft.com). All rights reserved.
3
 V5.10 10 Nov 2009   (c) 2000-2009 John Lim (jlim#natsoft.com). All rights reserved.
4 4
  Released under both BSD license and Lesser GPL library license. 
5 5
  Whenever there is any discrepancy between the two licenses, 
6 6
  the BSD license will take precedence.
typo3/sysext/adodb/adodb/drivers/adodb-pdo_mysql.inc.php (Arbeitskopie)
2 2

  
3 3

  
4 4
/*
5
V5.08 6 Apr 2009   (c) 2000-2009 John Lim (jlim#natsoft.com). All rights reserved.
5
V5.10 10 Nov 2009   (c) 2000-2009 John Lim (jlim#natsoft.com). All rights reserved.
6 6
  Released under both BSD license and Lesser GPL library license. 
7 7
  Whenever there is any discrepancy between the two licenses, 
8 8
  the BSD license will take precedence.
typo3/sysext/adodb/adodb/drivers/adodb-fbsql.inc.php (Arbeitskopie)
80 80
		return true;	
81 81
	}
82 82
	
83
 	function MetaColumns($table) 
83
 	function MetaColumns($table, $normalize=true) 
84 84
	{
85 85
		if ($this->metaColumnsSQL) {
86 86
			
typo3/sysext/adodb/adodb/drivers/adodb-db2.inc.php (Arbeitskopie)
24 24
--------------------------------------------------------------------------------------*/
25 25

  
26 26

  
27

  
28

  
29

  
27 30
class ADODB_db2 extends ADOConnection {
28 31
	var $databaseType = "db2";	
29 32
	var $fmtDate = "'Y-m-d'";
......
52 55
	var $uCaseTables = true; // for meta* functions, uppercase table names
53 56
	var $hasInsertID = true;
54 57
	
58
	
55 59
    function _insertid()
56 60
    {
57 61
        return ADOConnection::GetOne('VALUES IDENTITY_VAL_LOCAL()');
......
75 79
		// Replaces the odbc_binmode() call that was in Execute()
76 80
		ini_set('ibm_db2.binmode', $this->binmode);
77 81

  
78
		if ($argDatabasename) {
79
			$this->_connectionID = db2_connect($argDatabasename,$argUsername,$argPassword);
82
		if ($argDatabasename && empty($argDSN)) {
83
		
84
			if (stripos($argDatabasename,'UID=') && stripos($argDatabasename,'PWD=')) $this->_connectionID = db2_connect($argDatabasename,null,null);
85
			else $this->_connectionID = db2_connect($argDatabasename,$argUsername,$argPassword);
80 86
		} else {
81
			$this->_connectionID = db2_connect($argDSN,$argUsername,$argPassword);
87
			if ($argDatabasename) $schema = $argDatabasename;
88
			if (stripos($argDSN,'UID=') && stripos($argDSN,'PWD=')) $this->_connectionID = db2_connect($argDSN,null,null);
89
			else $this->_connectionID = db2_connect($argDSN,$argUsername,$argPassword);
82 90
		}
83 91
		if (isset($php_errormsg)) $php_errormsg = '';
84 92

  
......
86 94
		// an array of valid options.  So far, we don't use them.
87 95

  
88 96
		$this->_errorMsg = @db2_conn_errormsg();
89
 
90 97
		if (isset($this->connectStmt)) $this->Execute($this->connectStmt);
91 98
		
99
		if ($this->_connectionID && isset($schema)) $this->Execute("SET SCHEMA=$schema");
92 100
		return $this->_connectionID != false;
93 101
	}
94 102
	
......
106 114
		if (isset($php_errormsg)) $php_errormsg = '';
107 115
		$this->_errorMsg = isset($php_errormsg) ? $php_errormsg : '';
108 116
		
109
		if ($argDatabasename) {
110
			$this->_connectionID = db2_pconnect($argDatabasename,$argUsername,$argPassword);
117
		if ($argDatabasename && empty($argDSN)) {
118
		
119
			if (stripos($argDatabasename,'UID=') && stripos($argDatabasename,'PWD=')) $this->_connectionID = db2_pconnect($argDatabasename,null,null);
120
			else $this->_connectionID = db2_pconnect($argDatabasename,$argUsername,$argPassword);
111 121
		} else {
112
			$this->_connectionID = db2_pconnect($argDSN,$argUsername,$argPassword);
122
			if ($argDatabasename) $schema = $argDatabasename;
123
			if (stripos($argDSN,'UID=') && stripos($argDSN,'PWD=')) $this->_connectionID = db2_pconnect($argDSN,null,null);
124
			else $this->_connectionID = db2_pconnect($argDSN,$argUsername,$argPassword);
113 125
		}
114 126
		if (isset($php_errormsg)) $php_errormsg = '';
115 127

  
......
117 129
		if ($this->_connectionID && $this->autoRollback) @db2_rollback($this->_connectionID);
118 130
		if (isset($this->connectStmt)) $this->Execute($this->connectStmt);
119 131
		
132
		if ($this->_connectionID && isset($schema)) $this->Execute("SET SCHEMA=$schema");
120 133
		return $this->_connectionID != false;
121 134
	}
122 135

  
......
223 236
			return ADOConnection::ServerInfo();
224 237
		}
225 238
	}
226

  
227 239
	
228 240
	function CreateSequence($seqname='adodbseq',$start=1)
229 241
	{
......
239 251
		return $this->Execute(sprintf($this->_dropSeqSQL,$seqname));
240 252
	}
241 253
	
254
	function SelectLimit($sql,$nrows=-1,$offset=-1,$inputArr=false)
255
	{
256
		$nrows = (integer) $nrows;
257
		if ($offset <= 0) {
258
		// could also use " OPTIMIZE FOR $nrows ROWS "
259
			if ($nrows >= 0) $sql .=  " FETCH FIRST $nrows ROWS ONLY ";
260
			$rs = $this->Execute($sql,$inputArr);
261
		} else {
262
			if ($offset > 0 && $nrows < 0);
263
			else {
264
				$nrows += $offset;
265
				$sql .=  " FETCH FIRST $nrows ROWS ONLY ";
266
			}
267
			$rs = ADOConnection::SelectLimit($sql,-1,$offset,$inputArr);
268
		}
269
		
270
		return $rs;
271
	}
272
	
242 273
	/*
243 274
		This algorithm is not very efficient, but works even if table locking
244 275
		is not available.
......
407 438
		}
408 439
		
409 440
		$arr = $rs->GetArray();
410
		
411 441
		$rs->Close();
412 442
		$arr2 = array();
413 443
		
......
417 447
		for ($i=0; $i < sizeof($arr); $i++) {
418 448
			if (!$arr[$i][2]) continue;
419 449
			$type = $arr[$i][3];
450
			$owner = $arr[$i][1];
420 451
			$schemaval = ($schema) ? $arr[$i][1].'.' : '';
421 452
			if ($ttype) { 
422 453
				if ($isview) {
423 454
					if (strncmp($type,'V',1) === 0) $arr2[] = $schemaval.$arr[$i][2];
424
				} else if (strncmp($type,'SYS',3) !== 0) $arr2[] = $schemaval.$arr[$i][2];
425
			} else if (strncmp($type,'SYS',3) !== 0) $arr2[] = $schemaval.$arr[$i][2];
455
				} else if (strncmp($owner,'SYS',3) !== 0) $arr2[] = $schemaval.$arr[$i][2];
456
			} else if (strncmp($owner,'SYS',3) !== 0) $arr2[] = $schemaval.$arr[$i][2];
426 457
		}
427 458
		return $arr2;
428 459
	}
......
495 526
		}
496 527
	}
497 528
	
498
	function MetaColumns($table)
529
	function MetaColumns($table, $normalize=true)
499 530
	{
500 531
	global $ADODB_FETCH_MODE;
501 532
	
......
591 622
		return $retarr;
592 623
	}
593 624
	
625
		
594 626
	function Prepare($sql)
595 627
	{
596 628
		if (! $this->_bindInputArray) return $sql; // no binding
typo3/sysext/adodb/adodb/drivers/adodb-sybase_ase.inc.php (Arbeitskopie)
1 1
<?php
2 2
/*
3
  V5.08 6 Apr 2009   (c) 2000-2009 John Lim (jlim#natsoft.com). All rights reserved.
3
  V5.10 10 Nov 2009   (c) 2000-2009 John Lim (jlim#natsoft.com). All rights reserved.
4 4
  Released under both BSD license and Lesser GPL library license. 
5 5
  Whenever there is any discrepancy between the two licenses, 
6 6
  the BSD license will take precedence.
typo3/sysext/adodb/adodb/drivers/adodb-mysqli.inc.php (Arbeitskopie)
1 1
<?php
2 2
/*
3
V5.08 6 Apr 2009   (c) 2000-2009 John Lim (jlim#natsoft.com). All rights reserved.
3
V5.10 10 Nov 2009   (c) 2000-2009 John Lim (jlim#natsoft.com). All rights reserved.
4 4
  Released under both BSD license and Lesser GPL library license. 
5 5
  Whenever there is any discrepancy between the two licenses, 
6 6
  the BSD license will take precedence.
......
50 50
	var $_bindInputArray = false;
51 51
	var $nameQuote = '`';		/// string to use to quote identifiers and names
52 52
	var $optionFlags = array(array(MYSQLI_READ_DEFAULT_GROUP,0));
53
  var $arrayClass = 'ADORecordSet_array_mysqli';
53
  	var $arrayClass = 'ADORecordSet_array_mysqli';
54
  	var $multiQuery = false;
54 55
	
55 56
	function ADODB_mysqli() 
56 57
	{			
......
194 195
		return true;
195 196
	}
196 197
	
197
	function RowLock($tables,$where='',$flds='1 as adodb_ignore') 
198
	function RowLock($tables,$where='',$col='1 as adodb_ignore') 
198 199
	{
199 200
		if ($this->transCnt==0) $this->BeginTrans();
200 201
		if ($where) $where = ' where '.$where;
201
		$rs = $this->Execute("select $flds from $tables $where for update");
202
		$rs = $this->Execute("select $col from $tables $where for update");
202 203
		return !empty($rs); 
203 204
	}
204 205
	
......
526 527
	    return  $foreign_keys;
527 528
	}
528 529
	
529
 	function MetaColumns($table) 
530
 	function MetaColumns($table, $normalize=true) 
530 531
	{
531 532
		$false = false;
532 533
		if (!$this->metaColumnsSQL)
......
684 685
		return $mysql_res;
685 686
		*/
686 687
		
687
		if( $rs = mysqli_multi_query($this->_connectionID, $sql.';') )//Contributed by "Geisel Sierote" <geisel#4up.com.br>
688
		{
689
			$rs = ($ADODB_COUNTRECS) ? @mysqli_store_result( $this->_connectionID ) : @mysqli_use_result( $this->_connectionID );
690
			return $rs ? $rs : true; // mysqli_more_results( $this->_connectionID )
688
		if ($this->multiQuery) {
689
			$rs = mysqli_multi_query($this->_connectionID, $sql.';');
690
			if ($rs) {
691
				$rs = ($ADODB_COUNTRECS) ? @mysqli_store_result( $this->_connectionID ) : @mysqli_use_result( $this->_connectionID );
... This diff was truncated because it exceeds the maximum size that can be displayed.