Details
-
Bug
-
Resolution: Obsolete
-
Medium
-
None
-
3.10.0, 4.0.0
-
None
Description
when calling eZClusterFileHandler::delete() and the mysql db backend is in use, no files are really deleted, only their timestamps are set to a negative value.
Problems:
- there is a bug in function eZDBFileHandlerMysqlBackend->_exists(): it checks if $row[0][1] is positive, but it should check $row[1] instead
- all the file content fetching functions will happily return contents of a deleted file
- the same is true for getfilelist
- a deleted file cannot be recreated (dup val on unique index)
a possible solution would involve using the 'expired' column as a counter:
- PK is (name_hash, expired)
- every time a file is deleted, its expired column is set to max(expired)+1
- purge deletes all files where expired > 0
- most (all?) functions that operate on the rows in the db use for selecting the combination name_hash, 0 so queries are not slower
it makes deletions a bit slower (since it has to recover last expired vals)