mirror of
https://github.com/rsyslog/loganalyzer.git
synced 2025-09-26 03:09:21 +02:00
Fixed a bug in the pdo logstream class which caused display of empty rows when no records where found.
This commit is contained in:
parent
3f0d45efe9
commit
369cd6cb60
@ -632,7 +632,7 @@ class LogStreamPDO extends LogStream {
|
|||||||
$this->_myDBQuery = $this->_dbhandle->query($szSql);
|
$this->_myDBQuery = $this->_dbhandle->query($szSql);
|
||||||
if ( !$this->_myDBQuery )
|
if ( !$this->_myDBQuery )
|
||||||
{
|
{
|
||||||
$this->PrintDebugError("Invalid SQL: ".$szSql);
|
$this->PrintDebugError( "Invalid SQL: ".$szSql . "<br><br>Errorcode: " . $this->_dbhandle->errorCode() );
|
||||||
return ERROR_DB_QUERYFAILED;
|
return ERROR_DB_QUERYFAILED;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -672,19 +672,23 @@ class LogStreamPDO extends LogStream {
|
|||||||
// return error if there was one!
|
// return error if there was one!
|
||||||
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
|
||||||
|
if ( $this->_myDBQuery->rowCount() == 0 )
|
||||||
|
return ERROR_NOMORERECORDS;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Copy rows into the buffer!
|
// Copy rows into the buffer!
|
||||||
$iBegin = $this->_currentRecordNum;
|
$iBegin = $this->_currentRecordNum;
|
||||||
|
|
||||||
$iCount = 0;
|
$iCount = 0;
|
||||||
while( $this->_logStreamConfigObj->RecordsPerQuery > $iCount )
|
while( $this->_logStreamConfigObj->RecordsPerQuery > $iCount)
|
||||||
{
|
{
|
||||||
//Obtain next record
|
//Obtain next record
|
||||||
$myRow = $this->_myDBQuery->fetch(PDO::FETCH_ASSOC);
|
$myRow = $this->_myDBQuery->fetch(PDO::FETCH_ASSOC);
|
||||||
|
|
||||||
// Check if result was successfull!
|
// Check if result was successfull!
|
||||||
if ( $myRow === FALSE )
|
if ( $myRow === FALSE || !$myRow )
|
||||||
break;
|
break;
|
||||||
|
|
||||||
$this->bufferedRecords[$iBegin] = $myRow;
|
$this->bufferedRecords[$iBegin] = $myRow;
|
||||||
@ -694,16 +698,6 @@ class LogStreamPDO extends LogStream {
|
|||||||
$iCount++;
|
$iCount++;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
// Only obtain count if enabled and not done before
|
|
||||||
if ( $this->_logStreamConfigObj->DBEnableRowCounting && $this->_totalRecordCount == -1 )
|
|
||||||
{
|
|
||||||
$this->_totalRecordCount = $this->GetRowCountFromTable();
|
|
||||||
|
|
||||||
// if ( $this->_totalRecordCount <= 0 )
|
|
||||||
// return ERROR_NOMORERECORDS;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
// return success state if reached this point!
|
// return success state if reached this point!
|
||||||
return SUCCESS;
|
return SUCCESS;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user