From 973880713ea64cdf0d499cd78421e71e9b8e8770 Mon Sep 17 00:00:00 2001 From: Andre Lorbach Date: Wed, 16 Nov 2011 16:36:50 +0100 Subject: [PATCH] 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. --- src/classes/logstreampdo.class.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/classes/logstreampdo.class.php b/src/classes/logstreampdo.class.php index 2e507f5..6e51bfd 100644 --- a/src/classes/logstreampdo.class.php +++ b/src/classes/logstreampdo.class.php @@ -1494,10 +1494,16 @@ class LogStreamPDO extends LogStream { // return error if there was one! if ( ($res = $this->CreateMainSQLQuery($uID)) != SUCCESS ) return $res; - - // return specially with NO RECORDS when 0 records are returned! Otherwise it will be -1 - if ( $this->_myDBQuery->rowCount() == 0 ) - return ERROR_NOMORERECORDS; + + // Check rowcount property only on supported drivers, others may always return 0 like oracle PDO Driver + if ( $this->_logStreamConfigObj->DBType == DB_MYSQL || + $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! $iBegin = $this->_currentRecordNum;