I'm working on #1277152: Integration with Filefield Sources and discovered an issue when trying to insert our 4GB .iso file (DVD image) metadata into the table. This error:
PDOException, sqlstate Numeric value out of range: 1264 for filesize column in row 1
and found the solution in this comment: http://drupal.org/node/1003692#comment-6097068
The filesize field for this column is an INT which has a lower ceiling than BIGINT. I think the only drawback would be memory usage, but since Amazon S3 can handle files up to 5TB large, the filesize column should be a BIGINT(14).
After adjusting my schema to use these settings for the filesize field, my metadata insertion works normally.
Comments
Comment #0.0
torgospizzaForgot the issue #
Comment #1
torgospizzaComment #2
justafishComment #3
torgospizzaHere's a patch for the .install, which adds an update hook to alter the table schema and updates the original hook_schema where appropriate.
Comment #4
torgospizzaSorry, here's a better patch that uses a size of 14. In my tests (on mysql) the size of a BIGINT defaults to 20, though, so it may be unnecessary to include a size parameter.
Comment #5
justafishIs this going to work? The filesize column in file_managed is still an int(10), so I think we'd need to wait for http://drupal.org/node/1003692 to be back ported to D7.
Comment #6
torgospizzaYeah, I noticed that in my testing as well, that {file_managed} still will fail. Thanks for posting the reference to #1003692: PDOException: SQLSTATE[22003] after entering large value in integer and decimal field - this will have to go in after that backport.
EDIT: On second thought, that issue appears to be specifically for fields, not for files that are managed by code. I wonder if there needs to be a new issue opened for that?
Comment #7
torgospizzaThis issue also seems relevant: #1163740: PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '' for key 2: INSERT INTO {file_managed}
Comment #8
torgospizzaI created a new Issue for Drupal core: #1815886: Drupal core cannot manage files larger than 4 GB
Comment #8.0
torgospizzaEdit
Comment #9
justafishThanks! I upped this to 20 in line with https://drupal.org/node/1815886
https://github.com/justafish/amazons3/commit/d9b3e8b03011c25a94a9a1e8772...