The Autoincrement Value is now reset of all data is cleared using the mysql logstream maintenance functions

This commit is contained in:
Andre Lorbach 2011-02-10 12:53:48 +01:00
parent 453b418439
commit 1697083572

View File

@ -567,6 +567,16 @@ class LogStreamDB extends LogStream {
{
// Get affected rows and return!
$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!
//mysql_free_result ($myQuery);