MDL-38671 add adodb 5.18
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/*
|
||||
|
||||
@version V5.17 17 May 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@version V5.18 3 Sep 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
Latest version is available at http://adodb.sourceforge.net
|
||||
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
|
||||
@@ -8,7 +8,7 @@ $ADODB_INCLUDED_CSV = 1;
|
||||
|
||||
/*
|
||||
|
||||
V5.17 17 May 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
V5.18 3 Sep 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
Whenever there is any discrepancy between the two licenses,
|
||||
the BSD license will take precedence. See License.txt.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
V5.17 17 May 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
V5.18 3 Sep 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
Whenever there is any discrepancy between the two licenses,
|
||||
the BSD license will take precedence.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/**
|
||||
* @version V5.17 17 May 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
* @version V5.18 3 Sep 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
* Released under both BSD license and Lesser GPL library license.
|
||||
* Whenever there is any discrepancy between the two licenses,
|
||||
* the BSD license will take precedence.
|
||||
@@ -41,6 +41,9 @@ if (!defined("DB_ERROR_SYNTAX")) {
|
||||
define("DB_ERROR_EXTENSION_NOT_FOUND",-25);
|
||||
define("DB_ERROR_NOSUCHDB", -25);
|
||||
define("DB_ERROR_ACCESS_VIOLATION", -26);
|
||||
define("DB_ERROR_DEADLOCK", -27);
|
||||
define("DB_ERROR_STATEMENT_TIMEOUT", -28);
|
||||
define("DB_ERROR_SERIALIZATION_FAILURE", -29);
|
||||
}
|
||||
|
||||
function adodb_errormsg($value)
|
||||
@@ -91,16 +94,19 @@ function adodb_error($provider,$dbType,$errno)
|
||||
function adodb_error_pg($errormsg)
|
||||
{
|
||||
if (is_numeric($errormsg)) return (integer) $errormsg;
|
||||
// Postgres has no lock-wait timeout. The best we could do would be to set a statement timeout.
|
||||
static $error_regexps = array(
|
||||
'/(Table does not exist\.|Relation [\"\'].*[\"\'] does not exist|sequence does not exist|class ".+" not found)$/i' => DB_ERROR_NOSUCHTABLE,
|
||||
'/Relation [\"\'].*[\"\'] already exists|Cannot insert a duplicate key into (a )?unique index.*/i' => DB_ERROR_ALREADY_EXISTS,
|
||||
'/divide by zero$/i' => DB_ERROR_DIVZERO,
|
||||
'/Relation [\"\'].*[\"\'] already exists|Cannot insert a duplicate key into (a )?unique index.*|duplicate key.*violates unique constraint/i' => DB_ERROR_ALREADY_EXISTS,
|
||||
'/database ".+" does not exist$/i' => DB_ERROR_NOSUCHDB,
|
||||
'/(divide|division) by zero$/i' => DB_ERROR_DIVZERO,
|
||||
'/pg_atoi: error in .*: can\'t parse /i' => DB_ERROR_INVALID_NUMBER,
|
||||
'/ttribute [\"\'].*[\"\'] not found|Relation [\"\'].*[\"\'] does not have attribute [\"\'].*[\"\']/i' => DB_ERROR_NOSUCHFIELD,
|
||||
'/parser: parse error at or near \"/i' => DB_ERROR_SYNTAX,
|
||||
'/(parser: parse|syntax) error at or near \"/i' => DB_ERROR_SYNTAX,
|
||||
'/referential integrity violation/i' => DB_ERROR_CONSTRAINT,
|
||||
'/Relation [\"\'].*[\"\'] already exists|Cannot insert a duplicate key into (a )?unique index.*|duplicate key.*violates unique constraint/i'
|
||||
=> DB_ERROR_ALREADY_EXISTS
|
||||
'/deadlock detected$/i' => DB_ERROR_DEADLOCK,
|
||||
'/canceling statement due to statement timeout$/i' => DB_ERROR_STATEMENT_TIMEOUT,
|
||||
'/could not serialize access due to/i' => DB_ERROR_SERIALIZATION_FAILURE
|
||||
);
|
||||
reset($error_regexps);
|
||||
while (list($regexp,$code) = each($error_regexps)) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/**
|
||||
* @version V5.17 17 May 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
* @version V5.18 3 Sep 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
* Released under both BSD license and Lesser GPL library license.
|
||||
* Whenever there is any discrepancy between the two licenses,
|
||||
* the BSD license will take precedence.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/**
|
||||
* @version V5.17 17 May 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
* @version V5.18 3 Sep 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
* Released under both BSD license and Lesser GPL library license.
|
||||
Whenever there is any discrepancy between the two licenses,
|
||||
the BSD license will take precedence.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @version V5.17 17 May 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
* @version V5.18 3 Sep 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
* Released under both BSD license and Lesser GPL library license.
|
||||
* Whenever there is any discrepancy between the two licenses,
|
||||
* the BSD license will take precedence.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
V5.17 17 May 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
V5.18 3 Sep 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
Whenever there is any discrepancy between the two licenses,
|
||||
the BSD license will take precedence.
|
||||
|
||||
@@ -6,7 +6,7 @@ global $ADODB_INCLUDED_LIB;
|
||||
$ADODB_INCLUDED_LIB = 1;
|
||||
|
||||
/*
|
||||
@version V5.17 17 May 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@version V5.18 3 Sep 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
Whenever there is any discrepancy between the two licenses,
|
||||
the BSD license will take precedence. See License.txt.
|
||||
|
||||
@@ -11,7 +11,7 @@ if (empty($ADODB_INCLUDED_CSV)) include(ADODB_DIR.'/adodb-csvlib.inc.php');
|
||||
|
||||
/*
|
||||
|
||||
V5.17 17 May 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
V5.18 3 Sep 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
Whenever there is any discrepancy between the two licenses,
|
||||
the BSD license will take precedence. See License.txt.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
V5.17 17 May 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
V5.18 3 Sep 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
Whenever there is any discrepancy between the two licenses,
|
||||
the BSD license will take precedence.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/**
|
||||
* @version V5.17 17 May 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
* @version V5.18 3 Sep 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
* Released under both BSD license and Lesser GPL library license.
|
||||
* Whenever there is any discrepancy between the two licenses,
|
||||
* the BSD license will take precedence.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
V5.17 17 May 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
V5.18 3 Sep 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
Whenever there is any discrepancy between the two licenses,
|
||||
the BSD license will take precedence. See License.txt.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
V5.17 17 May 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
V5.18 3 Sep 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
Whenever there is any discrepancy between the two licenses,
|
||||
the BSD license will take precedence.
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
/**
|
||||
\mainpage
|
||||
|
||||
@version V5.17 17 May 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@version V5.18 3 Sep 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
|
||||
Released under both BSD license and Lesser GPL library license. You can choose which license
|
||||
you prefer.
|
||||
@@ -177,7 +177,7 @@
|
||||
/**
|
||||
* ADODB version as a string.
|
||||
*/
|
||||
$ADODB_vers = 'V5.17 17 May 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved. Released BSD & LGPL.';
|
||||
$ADODB_vers = 'V5.18 3 Sep 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved. Released BSD & LGPL.';
|
||||
|
||||
/**
|
||||
* Determines whether recordset->RecordCount() is used.
|
||||
@@ -315,10 +315,12 @@
|
||||
// create temp directories
|
||||
function createdir($hash, $debug)
|
||||
{
|
||||
global $ADODB_CACHE_PERMS;
|
||||
|
||||
$dir = $this->getdirname($hash);
|
||||
if ($this->notSafeMode && !file_exists($dir)) {
|
||||
$oldu = umask(0);
|
||||
if (!@mkdir($dir,0771)) if(!is_dir($dir) && $debug) ADOConnection::outp("Cannot create $dir");
|
||||
if (!@mkdir($dir, empty($ADODB_CACHE_PERMS) ? 0771 : $ADODB_CACHE_PERMS)) if(!is_dir($dir) && $debug) ADOConnection::outp("Cannot create $dir");
|
||||
umask($oldu);
|
||||
}
|
||||
|
||||
@@ -2848,6 +2850,7 @@ http://www.stanford.edu/dept/itss/docs/oracle/10g/server.101/b10759/statements_1
|
||||
function FieldCount(){ return 0;}
|
||||
function Init() {}
|
||||
function getIterator() {return new ADODB_Iterator_empty($this);}
|
||||
function GetAssoc() {return array();}
|
||||
}
|
||||
|
||||
//==============================================================================================
|
||||
@@ -3158,7 +3161,7 @@ http://www.stanford.edu/dept/itss/docs/oracle/10g/server.101/b10759/statements_1
|
||||
$false = false;
|
||||
return $false;
|
||||
}
|
||||
$numIndex = isset($this->fields[0]);
|
||||
$numIndex = isset($this->fields[0]) && isset($this->fields[1]);
|
||||
$results = array();
|
||||
|
||||
if (!$first2cols && ($cols > 2 || $force_array)) {
|
||||
@@ -3510,7 +3513,8 @@ http://www.stanford.edu/dept/itss/docs/oracle/10g/server.101/b10759/statements_1
|
||||
$record[$k] = $this->fields[$v];
|
||||
} else if (isset($this->fields[$k])) {
|
||||
$record[$k] = $this->fields[$k];
|
||||
}
|
||||
} else
|
||||
$record[$k] = $this->fields[$v];
|
||||
}
|
||||
return $record;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
V5.17 17 May 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
V5.18 3 Sep 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
Whenever there is any discrepancy between the two licenses,
|
||||
the BSD license will take precedence. See License.txt.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
V5.17 17 May 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
V5.18 3 Sep 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
Whenever there is any discrepancy between the two licenses,
|
||||
the BSD license will take precedence.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
V5.17 17 May 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
V5.18 3 Sep 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
Whenever there is any discrepancy between the two licenses,
|
||||
the BSD license will take precedence.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
V5.17 17 May 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
V5.18 3 Sep 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
Whenever there is any discrepancy between the two licenses,
|
||||
the BSD license will take precedence. See License.txt.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
V5.17 17 May 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
V5.18 3 Sep 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
Whenever there is any discrepancy between the two licenses,
|
||||
the BSD license will take precedence.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
V5.17 17 May 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
V5.18 3 Sep 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
Whenever there is any discrepancy between the two licenses,
|
||||
the BSD license will take precedence.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
V5.17 17 May 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
V5.18 3 Sep 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
Whenever there is any discrepancy between the two licenses,
|
||||
the BSD license will take precedence.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
V5.17 17 May 2012 (c) 2000-2012 (jlim#natsoft.com). All rights reserved.
|
||||
V5.18 3 Sep 2012 (c) 2000-2012 (jlim#natsoft.com). All rights reserved.
|
||||
|
||||
This is a version of the ADODB driver for DB2. It uses the 'ibm_db2' PECL extension
|
||||
for PHP (http://pecl.php.net/package/ibm_db2), which in turn requires DB2 V8.2.2 or
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
V5.17 17 May 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
V5.18 3 Sep 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
Whenever there is any discrepancy between the two licenses,
|
||||
the BSD license will take precedence.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
V5.17 17 May 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
V5.18 3 Sep 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
Whenever there is any discrepancy between the two licenses,
|
||||
the BSD license will take precedence.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
@version V5.17 17 May 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@version V5.18 3 Sep 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
Whenever there is any discrepancy between the two licenses,
|
||||
the BSD license will take precedence.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
V5.17 17 May 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
V5.18 3 Sep 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
Whenever there is any discrepancy between the two licenses,
|
||||
the BSD license will take precedence.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
V5.17 17 May 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
V5.18 3 Sep 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
Whenever there is any discrepancy between the two licenses,
|
||||
the BSD license will take precedence.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/**
|
||||
* @version V5.17 17 May 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
* @version V5.18 3 Sep 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
* Released under both BSD license and Lesser GPL library license.
|
||||
* Whenever there is any discrepancy between the two licenses,
|
||||
* the BSD license will take precedence.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
V5.17 17 May 2012 (c) 2000-2012 John Lim. All rights reserved.
|
||||
V5.18 3 Sep 2012 (c) 2000-2012 John Lim. All rights reserved.
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
Whenever there is any discrepancy between the two licenses,
|
||||
the BSD license will take precedence.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
V5.17 17 May 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
V5.18 3 Sep 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
Whenever there is any discrepancy between the two licenses,
|
||||
the BSD license will take precedence.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
V5.17 17 May 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
V5.18 3 Sep 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
Whenever there is any discrepancy between the two licenses,
|
||||
the BSD license will take precedence.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
V5.17 17 May 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
V5.18 3 Sep 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
Whenever there is any discrepancy between the two licenses,
|
||||
the BSD license will take precedence.
|
||||
@@ -403,6 +403,8 @@ class ADODB_mssqlnative extends ADOConnection {
|
||||
|
||||
function Prepare($sql)
|
||||
{
|
||||
return $sql; // prepare does not work properly with bind parameters as bind parameters are managed by sqlsrv_prepare!
|
||||
|
||||
$stmt = sqlsrv_prepare( $this->_connectionID, $sql);
|
||||
if (!$stmt) return $sql;
|
||||
return array($sql,$stmt);
|
||||
@@ -462,7 +464,8 @@ class ADODB_mssqlnative extends ADOConnection {
|
||||
if (is_array($inputarr)) {
|
||||
$rez = sqlsrv_query($this->_connectionID,$sql,$inputarr);
|
||||
} else if (is_array($sql)) {
|
||||
$rez = sqlsrv_query($this->_connectionID,$sql[1],$inputarr);
|
||||
// $inputarr is prepared in sqlsrv_prepare();
|
||||
$rez = sqlsrv_execute($this->_connectionID,$sql[1]);
|
||||
} else {
|
||||
$rez = sqlsrv_query($this->_connectionID,$sql);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/**
|
||||
* @version V5.17 17 May 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
* @version V5.18 3 Sep 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
* Released under both BSD license and Lesser GPL library license.
|
||||
* Whenever there is any discrepancy between the two licenses,
|
||||
* the BSD license will take precedence.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
V5.17 17 May 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
V5.18 3 Sep 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
Whenever there is any discrepancy between the two licenses,
|
||||
the BSD license will take precedence.
|
||||
@@ -53,7 +53,7 @@ class ADODB_mysql extends ADOConnection {
|
||||
if (!function_exists('mysql_set_charset'))
|
||||
return false;
|
||||
|
||||
if ($this->charSet !== $charset_name) {
|
||||
if ($this->charSet !== $charset_name) {
|
||||
$ok = @mysql_set_charset($charset_name,$this->_connectionID);
|
||||
if ($ok) {
|
||||
$this->charSet = $charset_name;
|
||||
@@ -608,6 +608,8 @@ class ADODB_mysql extends ADOConnection {
|
||||
function _close()
|
||||
{
|
||||
@mysql_close($this->_connectionID);
|
||||
|
||||
$this->charSet = '';
|
||||
$this->_connectionID = false;
|
||||
}
|
||||
|
||||
@@ -722,10 +724,10 @@ class ADORecordSet_mysql extends ADORecordSet{
|
||||
//$o->max_length = -1; // mysql returns the max length less spaces -- so it is unrealiable
|
||||
if ($o) $o->binary = (strpos($f,'binary')!== false);
|
||||
}
|
||||
else if ($fieldOffset == -1) { /* The $fieldOffset argument is not provided thus its -1 */
|
||||
else { /* The $fieldOffset argument is not provided thus its -1 */
|
||||
$o = @mysql_fetch_field($this->_queryID);
|
||||
if ($o) $o->max_length = @mysql_field_len($this->_queryID); // suggested by: Jim Nicholson (jnich#att.com)
|
||||
//$o->max_length = -1; // mysql returns the max length less spaces -- so it is unrealiable
|
||||
//if ($o) $o->max_length = @mysql_field_len($this->_queryID); // suggested by: Jim Nicholson (jnich#att.com)
|
||||
$o->max_length = -1; // mysql returns the max length less spaces -- so it is unrealiable
|
||||
}
|
||||
|
||||
return $o;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
V5.17 17 May 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
V5.18 3 Sep 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
Whenever there is any discrepancy between the two licenses,
|
||||
the BSD license will take precedence.
|
||||
@@ -28,7 +28,7 @@ if (! defined("_ADODB_MYSQLI_LAYER")) {
|
||||
|
||||
class ADODB_mysqli extends ADOConnection {
|
||||
var $databaseType = 'mysqli';
|
||||
var $dataProvider = 'native';
|
||||
var $dataProvider = 'mysql';
|
||||
var $hasInsertID = true;
|
||||
var $hasAffectedRows = true;
|
||||
var $metaTablesSQL = "SELECT TABLE_NAME, CASE WHEN TABLE_TYPE = 'VIEW' THEN 'V' ELSE 'T' END FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA=SCHEMA()";
|
||||
@@ -843,7 +843,7 @@ class ADODB_mysqli extends ADOConnection {
|
||||
|
||||
if ($this->charSet !== $charset_name) {
|
||||
$if = @$this->_connectionID->set_charset($charset_name);
|
||||
if ($if == "0" & $this->GetCharSet() == $charset_name) {
|
||||
if ($if === true & $this->GetCharSet() == $charset_name) {
|
||||
return true;
|
||||
} else return false;
|
||||
} else return true;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
V5.17 17 May 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
V5.18 3 Sep 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
Whenever there is any discrepancy between the two licenses,
|
||||
the BSD license will take precedence.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
V5.17 17 May 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
V5.18 3 Sep 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
Whenever there is any discrepancy between the two licenses,
|
||||
the BSD license will take precedence.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
V5.17 17 May 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
V5.18 3 Sep 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
|
||||
First cut at the Netezza Driver by Josh Eldridge joshuae74#hotmail.com
|
||||
Based on the previous postgres drivers.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/*
|
||||
|
||||
version V5.17 17 May 2012 (c) 2000-2012 John Lim. All rights reserved.
|
||||
version V5.18 3 Sep 2012 (c) 2000-2012 John Lim. All rights reserved.
|
||||
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
Whenever there is any discrepancy between the two licenses,
|
||||
@@ -1385,7 +1385,8 @@ class ADORecordset_oci8 extends ADORecordSet {
|
||||
|
||||
$this->_currentRow = 0;
|
||||
@$this->_initrs();
|
||||
$this->EOF = !$this->_fetch();
|
||||
if ($this->_numOfFields) $this->EOF = !$this->_fetch();
|
||||
else $this->EOF = true;
|
||||
|
||||
/*
|
||||
// based on idea by Gaetano Giunta to detect unusual oracle errors
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/**
|
||||
* @version V5.17 17 May 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
* @version V5.18 3 Sep 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
* Released under both BSD license and Lesser GPL library license.
|
||||
* Whenever there is any discrepancy between the two licenses,
|
||||
* the BSD license will take precedence.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
V5.17 17 May 2012 (c) 2000-2012 John Lim. All rights reserved.
|
||||
V5.18 3 Sep 2012 (c) 2000-2012 John Lim. All rights reserved.
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
Whenever there is any discrepancy between the two licenses,
|
||||
the BSD license will take precedence.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
V5.17 17 May 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
V5.18 3 Sep 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
Whenever there is any discrepancy between the two licenses,
|
||||
the BSD license will take precedence.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
V5.17 17 May 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
V5.18 3 Sep 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
Whenever there is any discrepancy between the two licenses,
|
||||
the BSD license will take precedence.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
V5.17 17 May 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
V5.18 3 Sep 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
Whenever there is any discrepancy between the two licenses,
|
||||
the BSD license will take precedence.
|
||||
@@ -122,7 +122,7 @@ order by constraint_name, referenced_table_name, keyno";
|
||||
|
||||
function MetaTables($ttype=false,$showSchema=false,$mask=false)
|
||||
{
|
||||
if ($mask) {$this->debug=1;
|
||||
if ($mask) {//$this->debug=1;
|
||||
$save = $this->metaTablesSQL;
|
||||
$mask = $this->qstr($mask);
|
||||
$this->metaTablesSQL .= " AND name like $mask";
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
V5.17 17 May 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
V5.18 3 Sep 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
Whenever there is any discrepancy between the two licenses,
|
||||
the BSD license will take precedence.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
V5.17 17 May 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
V5.18 3 Sep 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
Whenever there is any discrepancy between the two licenses,
|
||||
the BSD license will take precedence. See License.txt.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
V5.17 17 May 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
V5.18 3 Sep 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
Whenever there is any discrepancy between the two licenses,
|
||||
the BSD license will take precedence. See License.txt.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
V5.17 17 May 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
V5.18 3 Sep 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
Whenever there is any discrepancy between the two licenses,
|
||||
the BSD license will take precedence.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
V5.17 17 May 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
V5.18 3 Sep 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
Whenever there is any discrepancy between the two licenses,
|
||||
the BSD license will take precedence.
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
|
||||
/*
|
||||
V5.17 17 May 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
V5.18 3 Sep 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
Whenever there is any discrepancy between the two licenses,
|
||||
the BSD license will take precedence.
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
|
||||
/*
|
||||
V5.17 17 May 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
V5.18 3 Sep 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
Whenever there is any discrepancy between the two licenses,
|
||||
the BSD license will take precedence.
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
|
||||
/*
|
||||
V5.17 17 May 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
V5.18 3 Sep 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
Whenever there is any discrepancy between the two licenses,
|
||||
the BSD license will take precedence.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
V5.17 17 May 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
V5.18 3 Sep 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
Whenever there is any discrepancy between the two licenses,
|
||||
the BSD license will take precedence.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
V5.17 17 May 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
V5.18 3 Sep 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
Whenever there is any discrepancy between the two licenses,
|
||||
the BSD license will take precedence. See License.txt.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
V5.17 17 May 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
V5.18 3 Sep 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
Whenever there is any discrepancy between the two licenses,
|
||||
the BSD license will take precedence.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
V5.17 17 May 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
V5.18 3 Sep 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
Whenever there is any discrepancy between the two licenses,
|
||||
the BSD license will take precedence.
|
||||
@@ -240,7 +240,7 @@ select viewname,'V' from pg_views where viewname like $mask";
|
||||
if (is_bool($s)) return $s ? 'true' : 'false';
|
||||
|
||||
if (!$magic_quotes) {
|
||||
if (ADODB_PHPVER >= 0x5200) {
|
||||
if (ADODB_PHPVER >= 0x5200 && $this->_connectionID) {
|
||||
return "'".pg_escape_string($this->_connectionID,$s)."'";
|
||||
}
|
||||
if (ADODB_PHPVER >= 0x4200) {
|
||||
@@ -484,7 +484,7 @@ select viewname,'V' from pg_views where viewname like $mask";
|
||||
if ($this->fetchMode !== false) $savem = $this->SetFetchMode(false);
|
||||
|
||||
if ($schema) $rs = $this->Execute(sprintf($this->metaColumnsSQL1,$table,$table,$schema));
|
||||
else $rs = $this->Execute(sprintf($this->metaColumnsSQL,$table,$table));
|
||||
else $rs = $this->Execute(sprintf($this->metaColumnsSQL,$table,$table,$table));
|
||||
if (isset($savem)) $this->SetFetchMode($savem);
|
||||
$ADODB_FETCH_MODE = $save;
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
V5.17 17 May 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
V5.18 3 Sep 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
Whenever there is any discrepancy between the two licenses,
|
||||
the BSD license will take precedence.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
V5.17 17 May 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
V5.18 3 Sep 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
Whenever there is any discrepancy between the two licenses,
|
||||
the BSD license will take precedence.
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
<?php
|
||||
/*
|
||||
V5.14 8 Sept 2011 (c) 2000-2011 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
Whenever there is any discrepancy between the two licenses,
|
||||
the BSD license will take precedence.
|
||||
Set tabs to 4.
|
||||
|
||||
Postgres9 support.
|
||||
01 Dec 2011: gherteg added support for retrieving insert IDs from tables without OIDs
|
||||
*/
|
||||
|
||||
// security - hide paths
|
||||
if (!defined('ADODB_DIR')) die();
|
||||
|
||||
include_once(ADODB_DIR."/drivers/adodb-postgres7.inc.php");
|
||||
|
||||
class ADODB_postgres9 extends ADODB_postgres7 {
|
||||
var $databaseType = 'postgres9';
|
||||
|
||||
function ADODB_postgres9()
|
||||
{
|
||||
$this->ADODB_postgres7();
|
||||
}
|
||||
|
||||
// Don't use OIDs, as they typically won't be there, and
|
||||
// they're not what the application wants back, anyway.
|
||||
function _insertid($table,$column)
|
||||
{
|
||||
return empty($table) || empty($column)
|
||||
? $this->GetOne("SELECT lastval()")
|
||||
: $this->GetOne("SELECT currval(pg_get_serial_sequence('$table','$column'))");
|
||||
}
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------------------------------
|
||||
Class Name: Recordset
|
||||
--------------------------------------------------------------------------------------*/
|
||||
|
||||
class ADORecordSet_postgres9 extends ADORecordSet_postgres7{
|
||||
var $databaseType = "postgres9";
|
||||
|
||||
function ADORecordSet_postgres9($queryID,$mode=false)
|
||||
{
|
||||
$this->ADORecordSet_postgres7($queryID,$mode);
|
||||
}
|
||||
}
|
||||
|
||||
class ADORecordSet_assoc_postgres9 extends ADORecordSet_postgres7{
|
||||
var $databaseType = "postgres9";
|
||||
|
||||
function ADORecordSet_assoc_postgres9($queryID,$mode=false)
|
||||
{
|
||||
$this->ADORecordSet_postgres7($queryID,$mode);
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
V5.17 17 May 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
V5.18 3 Sep 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
Whenever there is any discrepancy between the two licenses,
|
||||
the BSD license will take precedence.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
V5.17 17 May 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
V5.18 3 Sep 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
Whenever there is any discrepancy between the two licenses,
|
||||
the BSD license will take precedence.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
version V5.17 17 May 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights
|
||||
version V5.18 3 Sep 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights
|
||||
reserved.
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
Whenever there is any discrepancy between the two licenses,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
V5.17 17 May 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
V5.18 3 Sep 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
Whenever there is any discrepancy between the two licenses,
|
||||
the BSD license will take precedence.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
V5.17 17 May 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
V5.18 3 Sep 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
Whenever there is any discrepancy between the two licenses,
|
||||
the BSD license will take precedence.
|
||||
@@ -49,9 +49,9 @@ class ADODB_sqlite3 extends ADOConnection {
|
||||
|
||||
function ServerInfo()
|
||||
{
|
||||
$arr['version'] = sqlite_libversion(); //**tochange
|
||||
$arr['description'] = 'SQLite '; //**tochange
|
||||
$arr['encoding'] = sqlite_libencoding();//**tochange
|
||||
$arr['version'] = $this->_connectionID->version(); //**tochange
|
||||
$arr['description'] = 'SQLite 3'; //**tochange
|
||||
//$arr['encoding'] = sqlite_libencoding();//**tochange
|
||||
return $arr;
|
||||
}
|
||||
|
||||
@@ -128,25 +128,25 @@ class ADODB_sqlite3 extends ADOConnection {
|
||||
function _insertid()
|
||||
{
|
||||
//return sqlite_last_insert_rowid($this->_connectionID)->; //**change
|
||||
$temp = $this->_connectionID;
|
||||
return $temp->lastInsertRowID();
|
||||
return $this->_connectionID->lastInsertRowID();
|
||||
}
|
||||
|
||||
function _affectedrows()
|
||||
{
|
||||
return sqlite3_changes($this->_connectionID); //**tochange
|
||||
return $this->_connectionID->changes();
|
||||
//return sqlite3_changes($this->_connectionID); //**tochange
|
||||
}
|
||||
|
||||
function ErrorMsg()
|
||||
{
|
||||
if ($this->_logsql) return $this->_errorMsg;
|
||||
|
||||
return ($this->_errorNo) ? sqlite_error_string($this->_errorNo) : ''; //**tochange?
|
||||
return ($this->_errorNo) ? $this->ErrorNo() : ''; //**tochange?
|
||||
}
|
||||
|
||||
function ErrorNo()
|
||||
{
|
||||
return $this->_errorNo; //**tochange??
|
||||
return $this->_connectionID->lastErrorCode(); //**tochange??
|
||||
}
|
||||
|
||||
function SQLDate($fmt, $col=false)
|
||||
@@ -169,12 +169,12 @@ class ADODB_sqlite3 extends ADOConnection {
|
||||
// returns true or false
|
||||
function _connect($argHostname, $argUsername, $argPassword, $argDatabasename) //**tochange: all the function need to be changed, just hacks for the moment
|
||||
{
|
||||
$this->_connectionID = new SQLite3('/path/mydb'); // hack
|
||||
if (empty($argHostname) && $argDatabasename) $argHostname = $argDatabasename; // hack
|
||||
if (empty($argHostname) && $argDatabasename) $argHostname = $argDatabasename;
|
||||
$this->_connectionID = new SQLite3($argDatabasename);
|
||||
$this->_createFunctions();
|
||||
|
||||
return true; // hack
|
||||
|
||||
/*
|
||||
if (!function_exists('sqlite_open')) return null;
|
||||
if (empty($argHostname) && $argDatabasename) $argHostname = $argDatabasename;
|
||||
|
||||
@@ -182,6 +182,7 @@ class ADODB_sqlite3 extends ADOConnection {
|
||||
if ($this->_connectionID === false) return false;
|
||||
$this->_createFunctions();
|
||||
return true;
|
||||
*/
|
||||
}
|
||||
|
||||
// returns true or false
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
V5.17 17 May 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
V5.18 3 Sep 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
Whenever there is any discrepancy between the two licenses,
|
||||
the BSD license will take precedence.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
V5.17 17 May 2012 (c) 2000-2012 John Lim. All rights reserved.
|
||||
V5.18 3 Sep 2012 (c) 2000-2012 John Lim. All rights reserved.
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
Whenever there is any discrepancy between the two licenses,
|
||||
the BSD license will take precedence.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
V5.17 17 May 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
V5.18 3 Sep 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
Whenever there is any discrepancy between the two licenses,
|
||||
the BSD license will take precedence.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
V5.17 17 May 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
V5.18 3 Sep 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
Whenever there is any discrepancy between the two licenses,
|
||||
the BSD license will take precedence.
|
||||
|
||||
@@ -28,6 +28,9 @@ $ADODB_LANG_ARRAY = array (
|
||||
DB_ERROR_NEED_MORE_DATA => 'insufficient data supplied',
|
||||
DB_ERROR_EXTENSION_NOT_FOUND=> 'extension not found',
|
||||
DB_ERROR_NOSUCHDB => 'no such database',
|
||||
DB_ERROR_ACCESS_VIOLATION => 'insufficient permissions'
|
||||
DB_ERROR_ACCESS_VIOLATION => 'insufficient permissions',
|
||||
DB_ERROR_DEADLOCK => 'deadlock detected',
|
||||
DB_ERROR_STATEMENT_TIMEOUT => 'statement timeout',
|
||||
DB_ERROR_SERIALIZATION_FAILURE => 'could not serialize access'
|
||||
);
|
||||
?>
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
V5.17 17 May 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
V5.18 3 Sep 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
Whenever there is any discrepancy between the two licenses,
|
||||
the BSD license will take precedence. See License.txt.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
V5.17 17 May 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
V5.18 3 Sep 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
Whenever there is any discrepancy between the two licenses,
|
||||
the BSD license will take precedence. See License.txt.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
V5.17 17 May 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
V5.18 3 Sep 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
Whenever there is any discrepancy between the two licenses,
|
||||
the BSD license will take precedence. See License.txt.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
V5.17 17 May 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
V5.18 3 Sep 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
Whenever there is any discrepancy between the two licenses,
|
||||
the BSD license will take precedence. See License.txt.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
V5.17 17 May 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
V5.18 3 Sep 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
Whenever there is any discrepancy between the two licenses,
|
||||
the BSD license will take precedence. See License.txt.
|
||||
@@ -251,7 +251,7 @@ class perf_mysql extends adodb_perf{
|
||||
$ADODB_FETCH_MODE = ADODB_FETCH_NUM;
|
||||
if ($this->conn->fetchMode !== false) $savem = $this->conn->SetFetchMode(false);
|
||||
|
||||
$rs = $this->conn->Execute('show innodb status');
|
||||
$rs = $this->conn->Execute('show engine innodb status');
|
||||
|
||||
if (isset($savem)) $this->conn->SetFetchMode($savem);
|
||||
$ADODB_FETCH_MODE = $save;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
V5.17 17 May 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
V5.18 3 Sep 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
Whenever there is any discrepancy between the two licenses,
|
||||
the BSD license will take precedence. See License.txt.
|
||||
@@ -192,7 +192,7 @@ FROM v\$parameter v1, v\$parameter v2 WHERE v1.name='log_archive_dest' AND v2.na
|
||||
'Recent RMAN Jobs' => array('BACKUP', "select '-' from dual", "=RMAN"),
|
||||
|
||||
// 'Control File Keep Time' => array('BACKUP', "select value from v\$parameter where name='control_file_record_keep_time'",'No of days to keep RMAN info in control file. I recommend it be set to x2 or x3 times the frequency of your full backup.'),
|
||||
|
||||
'Storage', 'Tablespaces' => array('TABLESPACE', "select '-' from dual", "=TableSpace"),
|
||||
false
|
||||
|
||||
);
|
||||
@@ -270,6 +270,22 @@ order by 3 desc) where rownum <=10");
|
||||
|
||||
}
|
||||
|
||||
function TableSpace()
|
||||
{
|
||||
|
||||
$rs = $this->conn->Execute(
|
||||
"select tablespace_name,round(sum(bytes)/1024/1024) as Used_MB,round(sum(maxbytes)/1024/1024) as Max_MB, round(sum(bytes)/sum(maxbytes),4) * 100 as PCT
|
||||
from dba_data_files
|
||||
group by tablespace_name order by 2 desc");
|
||||
|
||||
$ret = "<p><b>Tablespace</b>".rs2html($rs,false,false,false,false);
|
||||
|
||||
$rs = $this->conn->Execute("select * from dba_data_files order by tablespace_name, 1");
|
||||
$ret .= "<p><b>Datafile</b>".rs2html($rs,false,false,false,false);
|
||||
|
||||
return " <p>".$ret." </p>";
|
||||
}
|
||||
|
||||
function RMAN()
|
||||
{
|
||||
$rs = $this->conn->Execute("select * from (select start_time, end_time, operation, status, mbytes_processed, output_device_type
|
||||
@@ -279,6 +295,7 @@ order by 3 desc) where rownum <=10");
|
||||
return " <p>".$ret." </p>";
|
||||
|
||||
}
|
||||
|
||||
function DynMemoryUsage()
|
||||
{
|
||||
if (@$this->version['version'] >= 11) {
|
||||
@@ -291,14 +308,14 @@ order by 3 desc) where rownum <=10");
|
||||
$ret = rs2html($rs,false,false,false,false);
|
||||
return " <p>".$ret." </p>";
|
||||
}
|
||||
|
||||
|
||||
function FlashUsage()
|
||||
{
|
||||
$rs = $this->conn->Execute("select * from V\$FLASH_RECOVERY_AREA_USAGE");
|
||||
$ret = rs2html($rs,false,false,false,false);
|
||||
return " <p>".$ret." </p>";
|
||||
}
|
||||
|
||||
|
||||
function WarnPageCost($val)
|
||||
{
|
||||
if ($val == 100 && $this->version['version'] < 10) $s = '<font color=red><b>Too High</b>. </font>';
|
||||
@@ -306,7 +323,7 @@ order by 3 desc) where rownum <=10");
|
||||
|
||||
return $s.'Recommended is 20-50 for TP, and 50 for data warehouses. Default is 100. See <a href=http://www.dba-oracle.com/oracle_tips_cost_adj.htm>optimizer_index_cost_adj</a>. ';
|
||||
}
|
||||
|
||||
|
||||
function WarnIndexCost($val)
|
||||
{
|
||||
if ($val == 0 && $this->version['version'] < 10) $s = '<font color=red><b>Too Low</b>. </font>';
|
||||
@@ -322,6 +339,7 @@ order by 3 desc) where rownum <=10");
|
||||
|
||||
//if ($this->version['version'] < 9) return 'Oracle 9i or later required';
|
||||
}
|
||||
|
||||
function PGA_Advice()
|
||||
{
|
||||
$t = "<h3>PGA Advice Estimate</h3>";
|
||||
@@ -348,7 +366,7 @@ order by 3 desc) where rownum <=10");
|
||||
|
||||
return $t.rs2html($rs,false,false,true,false);
|
||||
}
|
||||
|
||||
|
||||
function Explain($sql,$partial=false)
|
||||
{
|
||||
$savelog = $this->conn->LogSQL(false);
|
||||
@@ -427,8 +445,7 @@ CONNECT BY prior id=parent_id and statement_id='$id'");
|
||||
$s .= $this->Tracer($sql,$partial);
|
||||
return $s;
|
||||
}
|
||||
|
||||
|
||||
|
||||
function CheckMemory()
|
||||
{
|
||||
if ($this->version['version'] < 9) return 'Oracle 9i or later required';
|
||||
@@ -460,7 +477,7 @@ select a.name Buffer_Pool, b.size_for_estimate as cache_mb_estimate,
|
||||
}
|
||||
return $s.$this->PGA_Advice();
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
Generate html for suspicious/expensive sql
|
||||
*/
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
V5.17 17 May 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
V5.18 3 Sep 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
Whenever there is any discrepancy between the two licenses,
|
||||
the BSD license will take precedence. See License.txt.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Description of ADODB V5.17 library import into Moodle
|
||||
Description of ADODB V5.18 library import into Moodle
|
||||
|
||||
This library will be probably removed in Moodle 2.1,
|
||||
it is now used only in enrol and auth db plugins.
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<location>adodb</location>
|
||||
<name>AdoDB</name>
|
||||
<license>GPL/BSD</license>
|
||||
<version>5.17</version>
|
||||
<version>5.18</version>
|
||||
<licenseversion>2.1+</licenseversion>
|
||||
</library>
|
||||
<library>
|
||||
|
||||
Reference in New Issue
Block a user