The RowCount Function is now only used with MYSQL, PGSQL and MSSQL in PDO LogStream Driver

Other PDO Drivers may not support the function properly and always return 0 like
Oracle PDO Driver. So the check will not be done in this case.
This commit is contained in:
Andre Lorbach 2011-11-16 16:36:50 +01:00
parent 4f500e16e6
commit 973880713e

View File

@ -1495,9 +1495,15 @@ class LogStreamPDO extends LogStream {
if ( ($res = $this->CreateMainSQLQuery($uID)) != SUCCESS ) if ( ($res = $this->CreateMainSQLQuery($uID)) != SUCCESS )
return $res; return $res;
// return specially with NO RECORDS when 0 records are returned! Otherwise it will be -1 // Check rowcount property only on supported drivers, others may always return 0 like oracle PDO Driver
if ( $this->_myDBQuery->rowCount() == 0 ) if ( $this->_logStreamConfigObj->DBType == DB_MYSQL ||
return ERROR_NOMORERECORDS; $this->_logStreamConfigObj->DBType == DB_MSSQL ||
$this->_logStreamConfigObj->DBType == DB_PGSQL )
{
// return specially with NO RECORDS when 0 records are returned! Otherwise it will be -1
if ( $this->_myDBQuery->rowCount() == 0 )
return ERROR_NOMORERECORDS;
}
// Copy rows into the buffer! // Copy rows into the buffer!
$iBegin = $this->_currentRecordNum; $iBegin = $this->_currentRecordNum;