Problem/Motivation
The MySQL limit for INT is 4294967295 (https://dev.mysql.com/doc/refman/5.7/en/integer-types.html)
The PHP (int) data conversion limit is platform-dependent (see http://can handle this changephp.net/manual/en/language.types.integer.php), but can be much higher.
While trying to translate certain blocks the following error can be encountered when clicking the "Save and Translate" button on the block edit form page: -
PDOException: SQLSTATE[22003]: Numeric value out of range: 1264 Out of range value for column 'objectindex' at row 1: .....
Proposed resolution
Change the data type of objectindex to BIGINT
Remaining tasks
Patch the .install file to change the schema and add a hook_update_n to change existing schemas.
Data model changes
Change the data type of objectindex to BIGINT
Comment | File | Size | Author |
---|---|---|---|
#15 | 2200647-db-error-objectindex-15.patch | 1.55 KB | Ivan Berezhnov |
#11 | i2200647-11.patch | 1.98 KB | attiks |
#8 | i18n-string-refresh-for-panels.patch | 560 bytes | nightlife2008 |
Comments
Comment #1
Dubs CreditAttribution: Dubs as a volunteer and at Drupology commentedComment #2
Dubs CreditAttribution: Dubs as a volunteer and at Drupology commentedUpdating issue tags...
Comment #3
Dubs CreditAttribution: Dubs as a volunteer and at Drupology commentedComment #4
Dubs CreditAttribution: Dubs as a volunteer and at Drupology commentedComment #5
Dubs CreditAttribution: Dubs as a volunteer and at Drupology commentedComment #6
Dubs CreditAttribution: Dubs as a volunteer and at Drupology commentedComment #7
nightlife2008 CreditAttribution: nightlife2008 commentedHi,
I have a similar issue when doing a site install where I i18n-string import some panel-related strings, where the i18n_string module also returns an error.
After some debugging and inspecting the DB, it seems that i18n_string converts the panels UUID in "objectid" into an integer to fill in the "objectkey".
I updated the module with a rather weak patch to set the "objectkey" to 0 in case of UUID type strings to solve my problem, but I think there should be better ways to improve this.
Comment #8
nightlife2008 CreditAttribution: nightlife2008 commentedComment #9
GiorgosKmaking the objectindex from int to bigint solves the problem
Comment #10
Dubs CreditAttribution: Dubs as a volunteer and at Drupology commented@GiorgosK - agreed - it should be easy to patch the install file for this. I should probably do this when I have time!
Comment #11
attiks CreditAttribution: attiks at Attiks commentedPatch based on #8
- update column objectindex to bigint
- check if objectid is numeric before converting to objectkey
- make sure objectkey is numeric before saving
Comment #13
Ivan Berezhnov CreditAttribution: Ivan Berezhnov as a volunteer and at Drupal Ukraine Community for FFW commented- update column objectindex length to 20.
Please review my patch.
Comment #14
Ivan Berezhnov CreditAttribution: Ivan Berezhnov as a volunteer and at Drupal Ukraine Community for FFW commented- update column objectindex length to 20.
Please review my second patch.
Comment #15
Ivan Berezhnov CreditAttribution: Ivan Berezhnov as a volunteer and at Drupal Ukraine Community for Levi9 commentedFixed problem in the class.
Comment #16
Ivan Berezhnov CreditAttribution: Ivan Berezhnov as a volunteer and at Drupal Ukraine Community for Levi9 commentedComment #17
attiks CreditAttribution: attiks at Attiks commented#15 Nice catch thanks for rerolling
Comment #18
joseph.olstadAnyone willing to RTBC this patch under oath that it's regression free?
Will this work with postgresql as well?
I imagine the abastraction layer takes care of this to make it compatible with Postgresql using it's driver and mssql using the sqlsrv driver
Comment #19
attiks CreditAttribution: attiks at Attiks commented#18 I ran this on Postgres without a problem
Comment #20
joseph.olstadok, I'll commit this to 7.x-1.x-dev sometime soon thanks.
Comment #21
joseph.olstadThanks again for all the hard work. Without having actually tested it, just reviewing the code visually, the patch looks really well written.
Comment #22
Ivan Berezhnov CreditAttribution: Ivan Berezhnov as a volunteer and at Drupal Ukraine Community for Levi9 commentedYahooo
"ok, I'll commit this to 7.x-1.x-dev sometime soon thanks."
@joseph.olstad Thanks )))
Comment #24
joseph.olstadfixed in 7.x-1.x dev
Please try to break this asap.
We should plan to release this in 2 weeks.
'release' meaning, tag a new release of i18n in 2 weeks.
unless of course someone objects.
Comment #26
joseph.olstadreleased in 7.x-1.22
Comment #27
joseph.olstadThere have been reports of regressions.
#2926290: Database schema inconsistent i18n_string table on clean install i18n module.
I have not seen this myself however enough people have raised issues to make it a valid concern. Trying to determine what versions of database servers and what type of database server (MySQL vX.X / Postgresql X.X / MSSQL Server x.x / sqlite version X, etc)
looking for the version info
followup in
#2926290: Database schema inconsistent i18n_string table on clean install i18n module.