The reason for this is that table 'file' column 'url' is a VARCHAR(255) in MySQL and it silently truncates URLs longer than 255 characters, breaking the url.
The proper fix for this is to improve this column, making its type TEXT, but there are no database changes for 0.8.x, so this is the next best thing for data integrity. A migration script for 0.9.x could be written to audit the database checking for redirects and updating these urls to their proper canonical url.
Some minor database changes for file tables. Namely:
* Added a timestamp to all tables
* Added a filename column for local files
* Change some tables that had unnecessary auto-increment primary
keys when they had another unique column that should act as
the primary key
* Change engine from MyISAM to InnoDB for a couple of files.
Also, rebuilt the DB_DataObject files for all these tables.