Fix mysql signed bug by casting to signed

This commit is contained in:
Isaac Connor 2018-04-14 17:25:44 -04:00
parent cad5696b8e
commit 1e3c3643c9
1 changed files with 1 additions and 1 deletions

View File

@ -203,7 +203,7 @@ CREATE TRIGGER event_delete_trigger BEFORE DELETE ON Events
FOR EACH ROW FOR EACH ROW
BEGIN BEGIN
IF ( OLD.DiskSpace ) THEN IF ( OLD.DiskSpace ) THEN
UPDATE Storage SET DiskSpace = COALESCE(DiskSpace,0) - OLD.DiskSpace WHERE Id = OLD.StorageId; UPDATE Storage SET DiskSpace = COALESCE(DiskSpace,0) - CAST(OLD.DiskSpace AS SIGNED) WHERE Id = OLD.StorageId;
END IF; END IF;
DELETE FROM Events_Hour WHERE EventId=OLD.Id; DELETE FROM Events_Hour WHERE EventId=OLD.Id;
DELETE FROM Events_Day WHERE EventId=OLD.Id; DELETE FROM Events_Day WHERE EventId=OLD.Id;