Commit ed20b638 authored by Son Nguyen's avatar Son Nguyen Committed by Gerrit Code Review

Merge changes from topic 'adodb upgrade'

* changes:
  Bug 1539346: Moving the define ADODB_ASSOC_CASE_* calls
  Modified session variable setting in ADOdb adodb-pager.inc.php
  ADODB modification: add __wakeup to connection object
  Check for valid columns in adodb postgres64 driver MetaIndexes fn
  adodb: check for Postgres 8.1
  adodb: RecordSet_postgres7->MoveNext() - remove expensive is_array()
  Bug 1539346: Upgrade ADODB to version 5.20.5
parents 258273c4 741aa7d2
......@@ -2,7 +2,7 @@ adodb
-----
Website: http://adodb.sourceforge.net/
Version: 5.19
Version: 5.20.5
Modifications:
......@@ -12,3 +12,4 @@ Modifications:
- add __wakeup to connection object (417077459037550239fe9b09bd20b50d4c19b57f)
- Deleted many files we're not using, including tests, docs, other drivers, other error langs
- Modified session variable setting from $_SESSION to $SESSION->set/get due to sessions now normally being closed.
- Moved the define ADODB_ASSOC_CASE_* calls as they are needed by ADONewConnection
......@@ -8,7 +8,9 @@ $ADODB_INCLUDED_CSV = 1;
/*
V5.19 23-Apr-2014 (c) 2000-2014 John Lim (jlim#natsoft.com). All rights reserved.
@version v5.20.5 10-Aug-2016
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
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.
......@@ -292,7 +294,7 @@ $ADODB_INCLUDED_CSV = 1;
// the tricky moment
@unlink($filename);
if (!@rename($tmpname,$filename)) {
unlink($tmpname);
@unlink($tmpname);
$ok = 0;
}
if (!$ok) {
......
<?php
/**
V5.19 23-Apr-2014 (c) 2000-2014 John Lim (jlim#natsoft.com). All rights reserved.
@version v5.20.5 10-Aug-2016
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
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.
......
<?php
/**
* @version V5.19 23-Apr-2014 (c) 2000-2014 John Lim (jlim#natsoft.com). All rights reserved.
* @version v5.20.5 10-Aug-2016
* @copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
* @copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
* 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.
......
<?php
/**
* @version V5.19 23-Apr-2014 (c) 2000-2014 John Lim (jlim#natsoft.com). All rights reserved.
* @version v5.20.5 10-Aug-2016
* @copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
* @copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
* 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.
......@@ -31,8 +33,6 @@ if (!defined('ADODB_ERROR_HANDLER')) define('ADODB_ERROR_HANDLER','ADODB_Error_H
function ADODB_Error_Handler($dbms, $fn, $errno, $errmsg, $p1, $p2, &$thisConnection)
{
if (error_reporting() == 0) return; // obey @ protocol
$p1 = is_array($p1) ? recursive_implode($p1) : $p1;
$p2 = is_array($p2) ? recursive_implode($p2) : $p2;
switch($fn) {
case 'EXECUTE':
$sql = $p1;
......
<?php
/**
* @version V5.19 23-Apr-2014 (c) 2000-2014 John Lim (jlim#natsoft.com). All rights reserved.
* @version v5.20.5 10-Aug-2016
* @copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
* @copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
* 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.
......@@ -44,8 +46,6 @@ function ADODB_Error_PEAR($dbms, $fn, $errno, $errmsg, $p1=false, $p2=false)
global $ADODB_Last_PEAR_Error;
if (error_reporting() == 0) return; // obey @ protocol
$p1 = is_array($p1) ? recursive_implode($p1) : $p1;
$p2 = is_array($p2) ? recursive_implode($p2) : $p2;
switch($fn) {
case 'EXECUTE':
$sql = $p1;
......
<?php
/**
* @version V5.19 23-Apr-2014 (c) 2000-2014 John Lim (jlim#natsoft.com). All rights reserved.
* @version v5.20.5 10-Aug-2016
* @copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
* @copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
* 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.
......@@ -27,13 +29,11 @@ var $database = '';
function __construct($dbms, $fn, $errno, $errmsg, $p1, $p2, $thisConnection)
{
$p1 = is_array($p1) ? recursive_implode($p1) : $p1;
$p2 = is_array($p2) ? recursive_implode($p2) : $p2;
switch($fn) {
case 'EXECUTE':
$this->sql = $p1;
$this->sql = is_array($p1) ? $p1[0] : $p1;
$this->params = $p2;
$s = "$dbms error: [$errno: $errmsg] in $fn(\"$p1\")\n";
$s = "$dbms error: [$errno: $errmsg] in $fn(\"$this->sql\")\n";
break;
case 'PCONNECT':
......
<?php
/*
V5.19 23-Apr-2014 (c) 2000-2014 John Lim (jlim#natsoft.com). All rights reserved.
@version v5.20.5 10-Aug-2016
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
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,9 @@ global $ADODB_INCLUDED_LIB;
$ADODB_INCLUDED_LIB = 1;
/*
@version V5.19 23-Apr-2014 (c) 2000-2014 John Lim (jlim#natsoft.com). All rights reserved.
@version v5.20.5 10-Aug-2016
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
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.
......@@ -17,7 +19,7 @@ $ADODB_INCLUDED_LIB = 1;
function adodb_strip_order_by($sql)
{
$rez = preg_match('/(\sORDER\s+BY\s(?:[^)](?!limit))*)(?:\sLIMIT\s+[0-9]+)?/is', $sql, $arr);
$rez = preg_match('/(\sORDER\s+BY\s(?:[^)](?!LIMIT))*)/is', $sql, $arr);
if ($arr)
if (strpos($arr[1], '(') !== false) {
$at = strpos($sql, $arr[1]);
......@@ -38,7 +40,7 @@ function adodb_strip_order_by($sql)
$sql = str_replace($arr[1], '', $sql);
}
return $sql;
}
}
if (false) {
$sql = 'select * from (select a from b order by a(b),b(c) desc)';
......@@ -421,8 +423,11 @@ function _adodb_getcount(&$zthis, $sql,$inputarr=false,$secs2cache=0)
}
} else {
// now replace SELECT ... FROM with SELECT COUNT(*) FROM
$rewritesql = preg_replace(
'/^\s*SELECT\s.*\s+FROM\s/Uis','SELECT COUNT(*) FROM ',$sql);
if ( strpos($sql, '_ADODB_COUNT') !== FALSE ) {
$rewritesql = preg_replace('/^\s*?SELECT\s+_ADODB_COUNT(.*)_ADODB_COUNT\s/is','SELECT COUNT(*) ',$sql);
} else {
$rewritesql = preg_replace('/^\s*SELECT\s.*\s+FROM\s/Uis','SELECT COUNT(*) FROM ',$sql);
}
// fix by alexander zhukov, alex#unipack.ru, because count(*) and 'order by' fails
// with mssql, access and postgresql. Also a good speedup optimization - skips sorting!
// also see http://phplens.com/lens/lensforum/msgs.php?id=12752
......@@ -543,46 +548,86 @@ function _adodb_pageexecute_all_rows(&$zthis, $sql, $nrows, $page,
return $rsreturn;
}
// Ivn Oliva version
// Iván Oliva version
function _adodb_pageexecute_no_last_page(&$zthis, $sql, $nrows, $page, $inputarr=false, $secs2cache=0)
{
$atfirstpage = false;
$atlastpage = false;
if (!isset($page) || $page <= 1) { // If page number <= 1, then we are at the first page
if (!isset($page) || $page <= 1) {
// If page number <= 1, then we are at the first page
$page = 1;
$atfirstpage = true;
}
if ($nrows <= 0) $nrows = 10; // If an invalid nrows is supplied, we assume a default value of 10 rows per page
// ***** Here we check whether $page is the last page or whether we are trying to retrieve a page number greater than
// the last page number.
$pagecounter = $page + 1;
$pagecounteroffset = ($pagecounter * $nrows) - $nrows;
if ($secs2cache>0) $rstest = $zthis->CacheSelectLimit($secs2cache, $sql, $nrows, $pagecounteroffset, $inputarr);
else $rstest = $zthis->SelectLimit($sql, $nrows, $pagecounteroffset, $inputarr, $secs2cache);
if ($rstest) {
while ($rstest && $rstest->EOF && $pagecounter>0) {
$atlastpage = true;
$pagecounter--;
$pagecounteroffset = $nrows * ($pagecounter - 1);
$rstest->Close();
if ($secs2cache>0) $rstest = $zthis->CacheSelectLimit($secs2cache, $sql, $nrows, $pagecounteroffset, $inputarr);
else $rstest = $zthis->SelectLimit($sql, $nrows, $pagecounteroffset, $inputarr, $secs2cache);
}
if ($rstest) $rstest->Close();
if ($nrows <= 0) {
// If an invalid nrows is supplied, we assume a default value of 10 rows per page
$nrows = 10;
}
if ($atlastpage) { // If we are at the last page or beyond it, we are going to retrieve it
$page = $pagecounter;
if ($page == 1) $atfirstpage = true; // We have to do this again in case the last page is the same as the first
//... page, that is, the recordset has only 1 page.
$pagecounteroffset = ($page * $nrows) - $nrows;
// To find out if there are more pages of rows, simply increase the limit or
// nrows by 1 and see if that number of records was returned. If it was,
// then we know there is at least one more page left, otherwise we are on
// the last page. Therefore allow non-Count() paging with single queries
// rather than three queries as was done before.
$test_nrows = $nrows + 1;
if ($secs2cache > 0) {
$rsreturn = $zthis->CacheSelectLimit($secs2cache, $sql, $nrows, $pagecounteroffset, $inputarr);
} else {
$rsreturn = $zthis->SelectLimit($sql, $test_nrows, $pagecounteroffset, $inputarr, $secs2cache);
}
// We get the data we want
$offset = $nrows * ($page-1);
if ($secs2cache > 0) $rsreturn = $zthis->CacheSelectLimit($secs2cache, $sql, $nrows, $offset, $inputarr);
else $rsreturn = $zthis->SelectLimit($sql, $nrows, $offset, $inputarr, $secs2cache);
// Now check to see if the number of rows returned was the higher value we asked for or not.
if ( $rsreturn->_numOfRows == $test_nrows ) {
// Still at least 1 more row, so we are not on last page yet...
// Remove the last row from the RS.
$rsreturn->_numOfRows = ( $rsreturn->_numOfRows - 1 );
} elseif ( $rsreturn->_numOfRows == 0 && $page > 1 ) {
// Likely requested a page that doesn't exist, so need to find the last
// page and return it. Revert to original method and loop through pages
// until we find some data...
$pagecounter = $page + 1;
$pagecounteroffset = ($pagecounter * $nrows) - $nrows;
$rstest = $rsreturn;
if ($rstest) {
while ($rstest && $rstest->EOF && $pagecounter > 0) {
$atlastpage = true;
$pagecounter--;
$pagecounteroffset = $nrows * ($pagecounter - 1);
$rstest->Close();
if ($secs2cache>0) {
$rstest = $zthis->CacheSelectLimit($secs2cache, $sql, $nrows, $pagecounteroffset, $inputarr);
}
else {
$rstest = $zthis->SelectLimit($sql, $nrows, $pagecounteroffset, $inputarr, $secs2cache);
}
}
if ($rstest) $rstest->Close();
}
if ($atlastpage) {
// If we are at the last page or beyond it, we are going to retrieve it
$page = $pagecounter;
if ($page == 1) {
// We have to do this again in case the last page is the same as
// the first page, that is, the recordset has only 1 page.
$atfirstpage = true;
}
}
// We get the data we want
$offset = $nrows * ($page-1);
if ($secs2cache > 0) {
$rsreturn = $zthis->CacheSelectLimit($secs2cache, $sql, $nrows, $offset, $inputarr);
}
else {
$rsreturn = $zthis->SelectLimit($sql, $nrows, $offset, $inputarr, $secs2cache);
}
} elseif ( $rsreturn->_numOfRows < $test_nrows ) {
// Rows is less than what we asked for, so must be at the last page.
$atlastpage = true;
}
// Before returning the RecordSet, we set the pagination properties we need
if ($rsreturn) {
......
......@@ -7,11 +7,13 @@ global $ADODB_INCLUDED_MEMCACHE;
$ADODB_INCLUDED_MEMCACHE = 1;
global $ADODB_INCLUDED_CSV;
if (empty($ADODB_INCLUDED_CSV)) include(ADODB_DIR.'/adodb-csvlib.inc.php');
if (empty($ADODB_INCLUDED_CSV)) include_once(ADODB_DIR.'/adodb-csvlib.inc.php');
/*
V5.19 23-Apr-2014 (c) 2000-2014 John Lim (jlim#natsoft.com). All rights reserved.
@version v5.20.5 10-Aug-2016
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
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.
......@@ -48,7 +50,7 @@ $db->CacheExecute($sql);
var $_connected = false;
var $_memcache = false;
function ADODB_Cache_MemCache(&$obj)
function __construct(&$obj)
{
$this->hosts = $obj->memCacheHost;
$this->port = $obj->memCachePort;
......
<?php
/*
V5.19 23-Apr-2014 (c) 2000-2014 John Lim (jlim#natsoft.com). All rights reserved.
@version v5.20.5 10-Aug-2016
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
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.
......@@ -55,9 +57,9 @@ class ADODB_Pager {
// if you have multiple on 1 page.
// $id should be only be [a-z0-9]*
//
function ADODB_Pager(&$db,$sql,$id = 'adodb', $showPageLinks = false)
function __construct(&$db,$sql,$id = 'adodb', $showPageLinks = false)
{
global $PHP_SELF;
global $PHP_SELF, $SESSION;
$curr_page = $id.'_curr_page';
if (!empty($PHP_SELF)) $PHP_SELF = htmlspecialchars($_SERVER['PHP_SELF']); // htmlspecialchars() to prevent XSS attacks
......@@ -70,11 +72,11 @@ class ADODB_Pager {
$next_page = $id.'_next_page';
if (isset($_GET[$next_page])) {
$SESSION->set($curr_page, (integer) $_GET[$next_page]);
$SESSION->set($curr_page, (integer) $_GET[$next_page]);
}
if (empty($SESSION->get($curr_page))) $SESSION->set($curr_page, 1); ## at first page
if (empty($SESSION->get($curr_page))) $SESSION->set($curr_page, 1); ## at first page
$this->curr_page = $SESSION->get($curr_page);
$this->curr_page = $SESSION->get($curr_page);
}
......
<?php
/**
* @version V5.19 23-Apr-2014 (c) 2000-2014 John Lim (jlim#natsoft.com). All rights reserved.
* @version v5.20.5 10-Aug-2016
* @copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
* @copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
* 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.
......@@ -52,10 +54,6 @@ if (!defined('DB_OK')) {
define("DB_OK", 1);
define("DB_ERROR",-1);
// autoExecute constants
define('DB_AUTOQUERY_INSERT', 1);
define('DB_AUTOQUERY_UPDATE', 2);
/**
* This is a special constant that tells DB the user hasn't specified
* any particular get mode, so the default should be used.
......@@ -144,7 +142,7 @@ class DB
$dsninfo = DB::parseDSN($dsn);
}
switch ($dsninfo["phptype"]) {
case 'pgsql': $type = 'postgres8'; break;
case 'pgsql': $type = 'postgres7'; break;
case 'ifx': $type = 'informix9'; break;
default: $type = $dsninfo["phptype"]; break;
}
......
<?php
/*
V5.19 23-Apr-2014 (c) 2000-2014 John Lim (jlim#natsoft.com). All rights reserved.
@version v5.20.5 10-Aug-2016
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
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.
......
<?php
/**
/*
ADOdb Date Library, part of the ADOdb abstraction library
Download: http://phplens.com/phpeverywhere/
Download: http://adodb.sourceforge.net/#download
@version v5.20.5 10-Aug-2016
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
PHP native date functions use integer timestamps for computations.
Because of this, dates are restricted to the years 1901-2038 on Unix
......
......@@ -118,7 +118,7 @@ class dbObject {
/**
* NOP
*/
function dbObject( &$parent, $attributes = NULL ) {
function __construct( &$parent, $attributes = NULL ) {
$this->parent = $parent;
}
......@@ -157,7 +157,6 @@ class dbObject {
* Destroys the object
*/
function destroy() {
unset( $this );
}
/**
......@@ -248,7 +247,7 @@ class dbTable extends dbObject {
* @param string $prefix DB Object prefix
* @param array $attributes Array of table attributes.
*/
function dbTable( &$parent, $attributes = NULL ) {
function __construct( &$parent, $attributes = NULL ) {
$this->parent = $parent;
$this->name = $this->prefix($attributes['NAME']);
}
......@@ -265,12 +264,14 @@ class dbTable extends dbObject {
switch( $this->currentElement ) {
case 'INDEX':
if( !isset( $attributes['PLATFORM'] ) OR $this->supportedPlatform( $attributes['PLATFORM'] ) ) {
xml_set_object( $parser, $this->addIndex( $attributes ) );
$index = $this->addIndex( $attributes );
xml_set_object( $parser, $index );
}
break;
case 'DATA':
if( !isset( $attributes['PLATFORM'] ) OR $this->supportedPlatform( $attributes['PLATFORM'] ) ) {
xml_set_object( $parser, $this->addData( $attributes ) );
$data = $this->addData( $attributes );
xml_set_object( $parser, $data );
}
break;
case 'DROP':
......@@ -642,7 +643,7 @@ class dbIndex extends dbObject {
*
* @internal
*/
function dbIndex( &$parent, $attributes = NULL ) {
function __construct( &$parent, $attributes = NULL ) {
$this->parent = $parent;
$this->name = $this->prefix ($attributes['NAME']);
......@@ -786,7 +787,7 @@ class dbData extends dbObject {
*
* @internal
*/
function dbData( &$parent, $attributes = NULL ) {
function __construct( &$parent, $attributes = NULL ) {
$this->parent = $parent;
}
......@@ -985,7 +986,7 @@ class dbQuerySet extends dbObject {
* @param object $parent Parent object
* @param array $attributes Attributes
*/
function dbQuerySet( &$parent, $attributes = NULL ) {
function __construct( &$parent, $attributes = NULL ) {
$this->parent = $parent;
// Overrides the manual prefix key
......@@ -1301,7 +1302,7 @@ class adoSchema {
*
* @param object $db ADOdb database connection object.
*/
function adoSchema( $db ) {
function __construct( $db ) {
// Initialize the environment
$this->mgq = get_magic_quotes_runtime();
ini_set("magic_quotes_runtime", 0);
......@@ -2196,7 +2197,6 @@ class adoSchema {
function Destroy() {
ini_set("magic_quotes_runtime", $this->mgq );
#set_magic_quotes_runtime( $this->mgq );
unset( $this );
}
}
......
......@@ -136,7 +136,7 @@ class dbObject {
/**
* NOP
*/
function dbObject( &$parent, $attributes = NULL ) {
function __construct( &$parent, $attributes = NULL ) {
$this->parent = $parent;
}
......@@ -175,7 +175,6 @@ class dbObject {
* Destroys the object
*/
function destroy() {
unset( $this );
}
/**
......@@ -273,7 +272,7 @@ class dbTable extends dbObject {
* @param string $prefix DB Object prefix
* @param array $attributes Array of table attributes.
*/
function dbTable( &$parent, $attributes = NULL ) {
function __construct( &$parent, $attributes = NULL ) {
$this->parent = $parent;
$this->name = $this->prefix($attributes['NAME']);
}
......@@ -290,12 +289,14 @@ class dbTable extends dbObject {
switch( $this->currentElement ) {
case 'INDEX':
if( !isset( $attributes['PLATFORM'] ) OR $this->supportedPlatform( $attributes['PLATFORM'] ) ) {
xml_set_object( $parser, $this->addIndex( $attributes ) );
$index = $this->addIndex( $attributes );
xml_set_object( $parser, $index );
}
break;
case 'DATA':
if( !isset( $attributes['PLATFORM'] ) OR $this->supportedPlatform( $attributes['PLATFORM'] ) ) {
xml_set_object( $parser, $this->addData( $attributes ) );
$data = $this->addData( $attributes );
xml_set_object( $parser, $data );
}
break;
case 'DROP':
......@@ -683,7 +684,7 @@ class dbIndex extends dbObject {
*
* @internal
*/
function dbIndex( &$parent, $attributes = NULL ) {
function __construct( &$parent, $attributes = NULL ) {
$this->parent = $parent;
$this->name = $this->prefix ($attributes['NAME']);
......@@ -828,7 +829,7 @@ class dbData extends dbObject {
*
* @internal
*/
function dbData( &$parent, $attributes = NULL ) {
function __construct( &$parent, $attributes = NULL ) {
$this->parent = $parent;
}
......@@ -1084,7 +1085,7 @@ class dbQuerySet extends dbObject {
* @param object $parent Parent object
* @param array $attributes Attributes
*/
function dbQuerySet( &$parent, $attributes = NULL ) {
function __construct( &$parent, $attributes = NULL ) {
$this->parent = $parent;
// Overrides the manual prefix key
......@@ -1405,7 +1406,7 @@ class adoSchema {
*
* @param object $db ADOdb database connection object.
*/
function adoSchema( $db ) {
function __construct( $db ) {
// Initialize the environment
$this->mgq = get_magic_quotes_runtime();
#set_magic_quotes_runtime(0);
......@@ -2104,11 +2105,12 @@ class adoSchema {
$schema = '<?xml version="1.0"?>' . "\n"
. '<schema version="' . $this->schemaVersion . '">' . "\n";
if( is_array( $tables = $this->db->MetaTables( 'TABLES' , ($prefix) ? $prefix.'%' : '') ) ) {
if( is_array( $tables = $this->db->MetaTables( 'TABLES' ,false ,($prefix) ? str_replace('_','\_',$prefix).'%' : '') ) ) {
foreach( $tables as $table ) {
if ($stripprefix) $table = str_replace(str_replace('\\_', '_', $pfx ), '', $table);
$schema .= $indent . '<table name="' . htmlentities( $table ) . '">' . "\n";
$schema .= $indent
. '<table name="'
. htmlentities( $stripprefix ? str_replace($prefix, '', $table) : $table )
. '">' . "\n";
// grab details from database
$rs = $this->db->Execute( 'SELECT * FROM ' . $table . ' WHERE -1' );
......@@ -2377,7 +2379,6 @@ class adoSchema {
function Destroy() {
ini_set("magic_quotes_runtime", $this->mgq );
#set_magic_quotes_runtime( $this->mgq );
unset( $this );
}
}
......
This diff is collapsed.
<?php
/**
V5.19 23-Apr-2014 (c) 2000-2014 John Lim (jlim#natsoft.com). All rights reserved.
@version v5.20.5 10-Aug-2016
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
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.
......
<?php
/**
V5.19 23-Apr-2014 (c) 2000-2014 John Lim (jlim#natsoft.com). All rights reserved.
@version v5.20.5 10-Aug-2016
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
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.
......@@ -190,8 +192,8 @@ class ADODB2_postgres extends ADODB_DataDict {
$sql = array();
list($lines,$pkey) = $this->_GenFields($flds);
$set_null = false;
$alter = 'ALTER TABLE ' . $tabname . $this->alterCol . ' ';
foreach($lines as $v) {
$alter = 'ALTER TABLE ' . $tabname . $this->alterCol . ' ';
if ($not_null = preg_match('/NOT NULL/i',$v)) {
$v = preg_replace('/NOT NULL/i','',$v);
}
......
<?php
/*
V5.19 23-Apr-2014 (c) 2000-2014 John Lim (jlim#natsoft.com). All rights reserved.
@version v5.20.5 10-Aug-2016
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
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.
......
<?php
/*
V5.19 23-Apr-2014 (c) 2000-2014 John Lim (jlim#natsoft.com). All rights reserved.
@version v5.20.5 10-Aug-2016
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
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.
......
<?php
/*
V5.19 23-Apr-2014 (c) 2000-2014 John Lim (jlim#natsoft.com). All rights reserved.
@version v5.20.5 10-Aug-2016
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
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.
......
This diff is collapsed.
<?php
/**
* @version V5.19 23-Apr-2014 (c) 2000-2014 John Lim (jlim#natsoft.com). All rights reserved.
* @version v5.20.5 10-Aug-2016
* @copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
* @copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
* 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.
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment