mirror of
https://github.com/ACSPRI/queXS
synced 2024-04-02 12:12:16 +00:00
Merged from McMasterReports branch
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
|
||||
/*
|
||||
V4.94 23 Jan 2007 (c) 2000-2007 John Lim (jlim#natsoft.com.my). All rights reserved.
|
||||
V5.08 6 Apr 2009 (c) 2000-2009 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.
|
||||
@@ -15,13 +15,17 @@ class ADODB_pdo_mysql extends ADODB_pdo {
|
||||
var $metaColumnsSQL = "SHOW COLUMNS FROM `%s`";
|
||||
var $sysDate = 'CURDATE()';
|
||||
var $sysTimeStamp = 'NOW()';
|
||||
var $hasGenID = true;
|
||||
var $_genIDSQL = "update %s set id=LAST_INSERT_ID(id+1);";
|
||||
var $_dropSeqSQL = "drop table %s";
|
||||
var $fmtTimeStamp = "'Y-m-d, H:i:s'";
|
||||
var $nameQuote = '`';
|
||||
|
||||
function _init($parentDriver)
|
||||
{
|
||||
|
||||
$parentDriver->hasTransactions = false;
|
||||
$parentDriver->_bindInputArray = false;
|
||||
#$parentDriver->_bindInputArray = false;
|
||||
$parentDriver->hasInsertID = true;
|
||||
$parentDriver->_connectionID->setAttribute(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY,true);
|
||||
}
|
||||
@@ -37,6 +41,16 @@ class ADODB_pdo_mysql extends ADODB_pdo {
|
||||
// return "from_unixtime(unix_timestamp($date)+$fraction)";
|
||||
}
|
||||
|
||||
function Concat()
|
||||
{
|
||||
$s = "";
|
||||
$arr = func_get_args();
|
||||
|
||||
// suggestion by andrew005#mnogo.ru
|
||||
$s = implode(',',$arr);
|
||||
if (strlen($s) > 0) return "CONCAT($s)"; return '';
|
||||
}
|
||||
|
||||
function ServerInfo()
|
||||
{
|
||||
$arr['description'] = ADOConnection::GetOne("select version()");
|
||||
@@ -44,7 +58,7 @@ class ADODB_pdo_mysql extends ADODB_pdo {
|
||||
return $arr;
|
||||
}
|
||||
|
||||
function &MetaTables($ttype=false,$showSchema=false,$mask=false)
|
||||
function MetaTables($ttype=false,$showSchema=false,$mask=false)
|
||||
{
|
||||
$save = $this->metaTablesSQL;
|
||||
if ($showSchema && is_string($showSchema)) {
|
||||
@@ -55,7 +69,7 @@ class ADODB_pdo_mysql extends ADODB_pdo {
|
||||
$mask = $this->qstr($mask);
|
||||
$this->metaTablesSQL .= " like $mask";
|
||||
}
|
||||
$ret =& ADOConnection::MetaTables($ttype,$showSchema);
|
||||
$ret = ADOConnection::MetaTables($ttype,$showSchema);
|
||||
|
||||
$this->metaTablesSQL = $save;
|
||||
return $ret;
|
||||
@@ -72,7 +86,7 @@ class ADODB_pdo_mysql extends ADODB_pdo {
|
||||
$this->Execute("SET SESSION TRANSACTION ".$transaction_mode);
|
||||
}
|
||||
|
||||
function &MetaColumns($table)
|
||||
function MetaColumns($table,$normalize=true)
|
||||
{
|
||||
$this->_findschema($table,$schema);
|
||||
if ($schema) {
|
||||
@@ -152,16 +166,16 @@ class ADODB_pdo_mysql extends ADODB_pdo {
|
||||
|
||||
|
||||
// parameters use PostgreSQL convention, not MySQL
|
||||
function &SelectLimit($sql,$nrows=-1,$offset=-1,$inputarr=false,$secs=0)
|
||||
function SelectLimit($sql,$nrows=-1,$offset=-1,$inputarr=false,$secs=0)
|
||||
{
|
||||
$offsetStr =($offset>=0) ? "$offset," : '';
|
||||
// jason judge, see http://phplens.com/lens/lensforum/msgs.php?id=9220
|
||||
if ($nrows < 0) $nrows = '18446744073709551615';
|
||||
|
||||
if ($secs)
|
||||
$rs =& $this->CacheExecute($secs,$sql." LIMIT $offsetStr$nrows",$inputarr);
|
||||
$rs = $this->CacheExecute($secs,$sql." LIMIT $offsetStr$nrows",$inputarr);
|
||||
else
|
||||
$rs =& $this->Execute($sql." LIMIT $offsetStr$nrows",$inputarr);
|
||||
$rs = $this->Execute($sql." LIMIT $offsetStr$nrows",$inputarr);
|
||||
return $rs;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user