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:
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
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.
|
||||
@@ -35,7 +35,7 @@ class ADODB_odbc_mssql extends ADODB_odbc {
|
||||
var $substr = 'substring';
|
||||
var $length = 'len';
|
||||
var $ansiOuter = true; // for mssql7 or later
|
||||
var $identitySQL = 'select @@IDENTITY'; // 'select SCOPE_IDENTITY'; # for mssql 2000
|
||||
var $identitySQL = 'select @@identity'; // 'select SCOPE_IDENTITY'; # for mssql 2000
|
||||
var $hasInsertID = true;
|
||||
var $connectStmt = 'SET CONCAT_NULL_YIELDS_NULL OFF'; # When SET CONCAT_NULL_YIELDS_NULL is ON,
|
||||
# concatenating a null value with a string yields a NULL result
|
||||
@@ -50,12 +50,11 @@ class ADODB_odbc_mssql extends ADODB_odbc {
|
||||
function ServerInfo()
|
||||
{
|
||||
global $ADODB_FETCH_MODE;
|
||||
$save = $ADODB_FETCH_MODE;
|
||||
$ADODB_FETCH_MODE = ADODB_FETCH_NUM;
|
||||
$save=$this->SetFetchMode(ADODB_FETCH_NUM);
|
||||
$row = $this->GetRow("execute sp_server_info 2");
|
||||
$ADODB_FETCH_MODE = $save;
|
||||
$this->SetFetchMode($save);
|
||||
if (!is_array($row)) return false;
|
||||
@$arr['description'] = $row[2];
|
||||
$arr['description'] = $row[2];
|
||||
$arr['version'] = ADOConnection::_findvers($arr['description']);
|
||||
return $arr;
|
||||
}
|
||||
@@ -93,7 +92,7 @@ from sysforeignkeys
|
||||
where upper(object_name(fkeyid)) = $table
|
||||
order by constraint_name, referenced_table_name, keyno";
|
||||
|
||||
$constraints =& $this->GetArray($sql);
|
||||
$constraints = $this->GetArray($sql);
|
||||
|
||||
$ADODB_FETCH_MODE = $save;
|
||||
|
||||
@@ -115,14 +114,14 @@ order by constraint_name, referenced_table_name, keyno";
|
||||
return $arr2;
|
||||
}
|
||||
|
||||
function &MetaTables($ttype=false,$showSchema=false,$mask=false)
|
||||
function MetaTables($ttype=false,$showSchema=false,$mask=false)
|
||||
{
|
||||
if ($mask) {$this->debug=1;
|
||||
$save = $this->metaTablesSQL;
|
||||
$mask = $this->qstr($mask);
|
||||
$this->metaTablesSQL .= " AND name like $mask";
|
||||
}
|
||||
$ret =& ADOConnection::MetaTables($ttype,$showSchema);
|
||||
$ret = ADOConnection::MetaTables($ttype,$showSchema);
|
||||
|
||||
if ($mask) {
|
||||
$this->metaTablesSQL = $save;
|
||||
@@ -130,14 +129,14 @@ order by constraint_name, referenced_table_name, keyno";
|
||||
return $ret;
|
||||
}
|
||||
|
||||
function &MetaColumns($table)
|
||||
function MetaColumns($table)
|
||||
{
|
||||
$arr = ADOConnection::MetaColumns($table);
|
||||
return $arr;
|
||||
}
|
||||
|
||||
|
||||
function &MetaIndexes($table,$primary=false)
|
||||
function MetaIndexes($table,$primary=false)
|
||||
{
|
||||
$table = $this->qstr($table);
|
||||
|
||||
@@ -177,7 +176,7 @@ order by constraint_name, referenced_table_name, keyno";
|
||||
return $indexes;
|
||||
}
|
||||
|
||||
function _query($sql,$inputarr)
|
||||
function _query($sql,$inputarr=false)
|
||||
{
|
||||
if (is_string($sql)) $sql = str_replace('||','+',$sql);
|
||||
return ADODB_odbc::_query($sql,$inputarr);
|
||||
@@ -196,7 +195,7 @@ order by constraint_name, referenced_table_name, keyno";
|
||||
|
||||
// "Stein-Aksel Basma" <basma@accelero.no>
|
||||
// tested with MSSQL 2000
|
||||
function &MetaPrimaryKeys($table)
|
||||
function MetaPrimaryKeys($table)
|
||||
{
|
||||
global $ADODB_FETCH_MODE;
|
||||
|
||||
@@ -220,14 +219,14 @@ order by constraint_name, referenced_table_name, keyno";
|
||||
return $false;
|
||||
}
|
||||
|
||||
function &SelectLimit($sql,$nrows=-1,$offset=-1, $inputarr=false,$secs2cache=0)
|
||||
function SelectLimit($sql,$nrows=-1,$offset=-1, $inputarr=false,$secs2cache=0)
|
||||
{
|
||||
if ($nrows > 0 && $offset <= 0) {
|
||||
$sql = preg_replace(
|
||||
'/(^\s*select\s+(distinctrow|distinct)?)/i','\\1 '.$this->hasTop." $nrows ",$sql);
|
||||
$rs =& $this->Execute($sql,$inputarr);
|
||||
$rs = $this->Execute($sql,$inputarr);
|
||||
} else
|
||||
$rs =& ADOConnection::SelectLimit($sql,$nrows,$offset,$inputarr,$secs2cache);
|
||||
$rs = ADOConnection::SelectLimit($sql,$nrows,$offset,$inputarr,$secs2cache);
|
||||
|
||||
return $rs;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user