mirror of
https://github.com/rsyslog/loganalyzer.git
synced 2025-09-26 03:09:21 +02:00
Fixed bug that more entries were processed then available inlogstreamdb
This commit is contained in:
parent
791790066a
commit
bbb0ec0f04
@ -185,6 +185,23 @@ class LogStreamDB extends LogStream {
|
|||||||
// No buffer? then read from DB!
|
// No buffer? then read from DB!
|
||||||
if ( $this->bufferedRecords == null )
|
if ( $this->bufferedRecords == null )
|
||||||
$ret = $this->ReadNextRecordsFromDB($uID);
|
$ret = $this->ReadNextRecordsFromDB($uID);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ( !isset($this->bufferedRecords[$this->_currentRecordNum] ) )
|
||||||
|
{
|
||||||
|
// We need to load new records, so clear the old ones first!
|
||||||
|
$this->ResetBufferedRecords();
|
||||||
|
|
||||||
|
// Set new Record start, will be used in the SQL Statement!
|
||||||
|
$this->_currentRecordStart = $this->_currentRecordNum; // + 1;
|
||||||
|
|
||||||
|
// Now read new ones
|
||||||
|
$ret = $this->ReadNextRecordsFromDB($uID);
|
||||||
|
|
||||||
|
if ( !isset($this->bufferedRecords[$this->_currentRecordNum] ) )
|
||||||
|
$ret = ERROR_NOMORERECORDS;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if ( $ret == SUCCESS )
|
if ( $ret == SUCCESS )
|
||||||
{
|
{
|
||||||
@ -215,21 +232,6 @@ class LogStreamDB extends LogStream {
|
|||||||
|
|
||||||
// Increment $_currentRecordNum
|
// Increment $_currentRecordNum
|
||||||
$this->_currentRecordNum++;
|
$this->_currentRecordNum++;
|
||||||
|
|
||||||
if ( !isset($this->bufferedRecords[$this->_currentRecordNum] ) )
|
|
||||||
{
|
|
||||||
// We need to load new records, so clear the old ones first!
|
|
||||||
$this->ResetBufferedRecords();
|
|
||||||
|
|
||||||
// Set new Record start, will be used in the SQL Statement!
|
|
||||||
$this->_currentRecordStart = $this->_currentRecordNum; // + 1;
|
|
||||||
|
|
||||||
// Now read new ones
|
|
||||||
$ret = $this->ReadNextRecordsFromDB($uID);
|
|
||||||
|
|
||||||
// TODO Check and READ next record!
|
|
||||||
// die ("omfg wtf ReadNext " . $this->_currentRecordNum);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// reached here means return result!
|
// reached here means return result!
|
||||||
|
@ -49,7 +49,7 @@ $CFG['UserDBPass'] = "";
|
|||||||
|
|
||||||
// --- Misc Options
|
// --- Misc Options
|
||||||
$CFG['MiscShowDebugMsg'] = 1; // if enabled, you will get additional output on certain places
|
$CFG['MiscShowDebugMsg'] = 1; // if enabled, you will get additional output on certain places
|
||||||
$CFG['MiscShowDebugGridCounter'] = 0; // Only for debugging purposes, will add a counter column into the grid!
|
$CFG['MiscShowDebugGridCounter'] = 1; // Only for debugging purposes, will add a counter column into the grid!
|
||||||
$CFG["MiscShowPageRenderStats"] = 1; // If enabled, you will see Pagerender Settings
|
$CFG["MiscShowPageRenderStats"] = 1; // If enabled, you will see Pagerender Settings
|
||||||
// ---
|
// ---
|
||||||
|
|
||||||
@ -105,7 +105,7 @@ $CFG['Sources'][Source5]['SourceType'] = SOURCE_DB;
|
|||||||
$CFG['Sources'][Source5]['DBTableType'] = "winsyslog";
|
$CFG['Sources'][Source5]['DBTableType'] = "winsyslog";
|
||||||
$CFG['Sources'][Source5]['DBType'] = DB_MYSQL;
|
$CFG['Sources'][Source5]['DBType'] = DB_MYSQL;
|
||||||
$CFG['Sources'][Source5]['DBServer'] = "127.0.0.1";
|
$CFG['Sources'][Source5]['DBServer'] = "127.0.0.1";
|
||||||
$CFG['Sources'][Source5]['DBName'] = "phplogcon";
|
$CFG['Sources'][Source5]['DBName'] = "phplogcon_test";
|
||||||
$CFG['Sources'][Source5]['DBUser'] = "root";
|
$CFG['Sources'][Source5]['DBUser'] = "root";
|
||||||
$CFG['Sources'][Source5]['DBPassword'] = "";
|
$CFG['Sources'][Source5]['DBPassword'] = "";
|
||||||
$CFG['Sources'][Source5]['DBTableName'] = "systemevents";
|
$CFG['Sources'][Source5]['DBTableName'] = "systemevents";
|
||||||
|
@ -380,7 +380,9 @@ if ( isset($content['Sources'][$currentSourceID]) ) // && $content['Sources'][$c
|
|||||||
// Increment Counter
|
// Increment Counter
|
||||||
$counter++;
|
$counter++;
|
||||||
} while ($stream->ReadNext($uID, $logArray) == SUCCESS && $counter < $CFG['ViewEntriesPerPage']);
|
} while ($stream->ReadNext($uID, $logArray) == SUCCESS && $counter < $CFG['ViewEntriesPerPage']);
|
||||||
|
|
||||||
|
//print_r ( $content['syslogmessages'] );
|
||||||
|
|
||||||
if ( $content['main_recordcount'] == -1 || $content['main_recordcount'] > $CFG['ViewEntriesPerPage'] )
|
if ( $content['main_recordcount'] == -1 || $content['main_recordcount'] > $CFG['ViewEntriesPerPage'] )
|
||||||
{
|
{
|
||||||
// Enable Pager in any case here!
|
// Enable Pager in any case here!
|
||||||
|
Loading…
x
Reference in New Issue
Block a user