diff --git a/db/zm_create.sql.in b/db/zm_create.sql.in index f9bb3866d..b97c9a282 100644 --- a/db/zm_create.sql.in +++ b/db/zm_create.sql.in @@ -378,14 +378,14 @@ BEGIN DELETE FROM Events_Archived WHERE EventId=OLD.Id; UPDATE Monitors SET ArchivedEvents = ArchivedEvents - 1, - ArchivedEventDiskSpace = ArchivedEventDiskSpace - OLD.DiskSpace, + ArchivedEventDiskSpace = COALESCE(ArchivedEventDiskSpace,0) - COALESCE(OLD.DiskSpace,0), TotalEvents = TotalEvents - 1, - TotalEventDiskSpace = TotalEventDiskSpace - OLD.DiskSpace + TotalEventDiskSpace = COALESCE(TotalEventDiskSpace,0) - COALESCE(OLD.DiskSpace,0) WHERE Id=OLD.MonitorId; ELSE UPDATE Monitors SET TotalEvents = TotalEvents-1, - TotalEventDiskSpace=TotalEventDiskSpace-OLD.DiskSpace + TotalEventDiskSpace=COALESCE(TotalEventDiskSpace,0)-COALESCE(OLD.DiskSpace,0) WHERE Id=OLD.MonitorId; END IF; END; diff --git a/version b/version index 71736e954..da0fc0a15 100644 --- a/version +++ b/version @@ -1 +1 @@ -1.31.32 +1.31.33