Fixed the snapshots cleanup to be compliant with MySQL