mirror of
https://github.com/rsyslog/loganalyzer.git
synced 2025-09-26 03:09:21 +02:00
The Autoincrement Value is now reset of all data is cleared using the mysql logstream maintenance functions
This commit is contained in:
parent
453b418439
commit
1697083572
@ -567,6 +567,16 @@ class LogStreamDB extends LogStream {
|
|||||||
{
|
{
|
||||||
// Get affected rows and return!
|
// Get affected rows and return!
|
||||||
$rowcount = mysql_affected_rows();
|
$rowcount = mysql_affected_rows();
|
||||||
|
|
||||||
|
// Reset AUTO_INCREMENT if all records were deleted!
|
||||||
|
if ( $nDateTimeStamp == 0 )
|
||||||
|
{
|
||||||
|
$szSql = "ALTER TABLE " . $this->_logStreamConfigObj->DBTableName . " AUTO_INCREMENT=0";
|
||||||
|
$myQuery = mysql_query($szSql, $this->_dbhandle);
|
||||||
|
// error occured, output DEBUG message
|
||||||
|
if (!$myQuery)
|
||||||
|
$this->PrintDebugError("CleanupLogdataByDate failed to reset AUTO_INCREMENT for '" . $this->_logStreamConfigObj->DBTableName . "' table. ");
|
||||||
|
}
|
||||||
|
|
||||||
// Free result not needed here!
|
// Free result not needed here!
|
||||||
//mysql_free_result ($myQuery);
|
//mysql_free_result ($myQuery);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user