There is some a problem when exporting a complex components using Features (e.g. long Entity form with fields which results in 1000 lines) which causing PDOException that the data is too long in system table.
The workaround is to do:
ALTER TABLE `system` CHANGE `info` `info` LONGBLOB /* or MEDIUMBLOB */ NULL DEFAULT NULL
as shown in here:
- #2056263: Branch 2.x results in large info files that exceed the 'info' column limit in the 'system' table,
- #1911022: Exception: PDOException: SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'info' at row 1.
Is there any consideration to increase the size of `info` in Drupal core to MEDIUMBLOB?
--
Example PDOException when there is module present with a large .info file, so this happens on system_rebuild_module_data()
:
Starting Drupal installation. This takes a while. Consider using the [ok]
--notify global option.
exception 'PDOException' with message 'SQLSTATE[22001]: String data, [error]
right truncated: 1406 Data too long for column 'info' at row 167' in
/vagrant/build/docroot/includes/database/database.inc:2171
Stack trace:
#0 /vagrant/build/docroot/includes/database/database.inc(2171):
PDOStatement->execute(Array)
#1 /vagrant/build/docroot/includes/database/database.inc(683):
DatabaseStatementBase->execute(Array, Array)
#2 /vagrant/build/docroot/includes/database/mysql/query.inc(36):
DatabaseConnection->query('INSERT INTO {sy...', Array, Array)
#3 /vagrant/build/docroot/modules/system/system.module(2314):
InsertQuery_mysql->execute()
#4 /vagrant/build/docroot/modules/system/system.module(2467):
system_update_files_database(Array, 'module')
#5 /vagrant/build/docroot/includes/install.inc(747):
system_rebuild_module_data()
#6 /vagrant/build/docroot/includes/install.core.inc(787):
drupal_install_system()
#7 /vagrant/build/docroot/includes/install.core.inc(471):
install_system_module(Array)
#8 /vagrant/build/docroot/includes/install.core.inc(339):
install_run_task(Array, Array)
#9 /vagrant/build/docroot/includes/install.core.inc(77):
install_run_tasks(Array)
#10 /usr/local/share/drush/includes/drush.inc(725):
install_drupal(Array)
#11 /usr/local/share/drush/includes/drush.inc(711):
drush_call_user_func_array('install_drupal', Array)
#12
/usr/local/share/drush/commands/core/drupal/site_install_7.inc(82):
drush_op('install_drupal', Array)
#13 /usr/local/share/drush/commands/core/site_install.drush.inc(247):
drush_core_site_install_version('foo_profile', Array)
#14 [internal function]: drush_core_site_install('foo_profile',
'install_configu...')
#15 /usr/local/share/drush/includes/command.inc(366):
call_user_func_array('drush_core_site...', Array)
#16 /usr/local/share/drush/includes/command.inc(217):
_drush_invoke_hooks(Array, Array)
#17 [internal function]: drush_command('foo_profile',
'install_configu...')
#18 /usr/local/share/drush/includes/command.inc(185):
call_user_func_array('drush_command', Array)
#19 /usr/local/share/drush/lib/Drush/Boot/BaseBoot.php(67):
drush_dispatch(Array)
#20 /usr/local/share/drush/includes/preflight.inc(66):
Drush\Boot\BaseBoot->bootstrap_and_dispatch()
#21 /usr/local/share/drush/drush.php(12): drush_main()
#22 {main}
Command dispatch complete [notice]
Comment | File | Size | Author |
---|---|---|---|
#28 | interdiff-2580473-26-28.txt | 627 bytes | Ronino |
#28 | system--increase-size-field-info-2580473-28.patch | 1.15 KB | Ronino |
#26 | system--increase-size-field-info-2580473-26.patch | 1.17 KB | MaxMendez |
#20 | system--increase-size-field-info-2580473-20.patch | 1.11 KB | init90 |
#20 | interdiff-18-20.txt | 752 bytes | init90 |
Comments
Comment #2
kenorb CreditAttribution: kenorb commentedComment #3
kenorb CreditAttribution: kenorb commentedComment #4
kenorb CreditAttribution: kenorb commentedComment #5
longwaveI am not sure this is useful for 99% of users so does not need to be changed in core, but I think this can be achieved in contrib/custom code by altering the table definition in hook_install() and hook_schema_alter()?
Comment #6
kenorb CreditAttribution: kenorb commentedUploading patch from https://gist.github.com/danielmccosker/3174970
Comment #7
kenorb CreditAttribution: kenorb commentedComment #8
kenorb CreditAttribution: kenorb commentedComment #9
kenorb CreditAttribution: kenorb commentedThis one-time code should work as well:
db_change_field("system", "info", "info", array('type' => 'blob', "size" => "big"));
Related: Features - branch 2.x results in large info files that exceed the 'info' column limit in the 'system' table at DA
Probably the patch needs to include some hook_update_X similar to system_update_7055().
Comment #10
iamEAP CreditAttribution: iamEAP as a volunteer commentedPatch in #6 works for brand new Drupal 7 installs, but a field change update hook will need to be implemented in the System module, as mentioned in #9.
Comment #11
sudaz CreditAttribution: sudaz commentedUpdated patch to add a field change update hook as mentioned in #9 for existing installs
Comment #12
Etroid CreditAttribution: Etroid commentedComment #14
sudaz CreditAttribution: sudaz commentedComment #15
Etroid CreditAttribution: Etroid commentedComment #16
iamEAP CreditAttribution: iamEAP as a volunteer commentedLooks like Drupal does not support
mediumblob
for portability reasons, solargeblob
it is.This issue can crop up from a variety of sources related to Features, but not directly caused by Features itself. With that in mind, I don't see a better place for this to live other than core.
Moving to RTBC.
Comment #17
PolLooks fine to me.
Comment #18
Rob C CreditAttribution: Rob C commentedUpped the update hook, system_update_7082() now exists in core.
Comment #19
init90I've also encountered with such problem when worked with feature which contain huge amount of data.
Reupload patch with some cosmetic corrections.
Comment #20
init90I've recreated patch in proper way.
Comment #21
luismagr CreditAttribution: luismagr as a volunteer and at Code Enigma commentedHi @all
Thanks for the patch @init90. I've checked it locally and it works for me.
Could it be possible to move this issue forward so we can have this patch included in a core update?
Thanks
Comment #22
danyg CreditAttribution: danyg at Cheppers commentedHi, I've tested the patch at #20 and it works like a charm. I'm changing it to RTBC.
@init90 Thanks for the patch!
Comment #23
44sunsets CreditAttribution: 44sunsets commentedWe've been using patch #20 for a while and it's been great, but the recent Drupal 7.70 update broke this due to a system update function number conflict in
/modules/system/system.install
.I have slightly modified and re-rolled patch #20 so that it works with Drupal 7.70.
Comment #24
danyg CreditAttribution: danyg at Cheppers commentedHere is the updated patch for the latest dev (Drupal version is 7.71)
Comment #25
mibfire CreditAttribution: mibfire commentedI ran into this issue too. When can this be released? I am asking because this is a serious issue and should be fixed asap.
Comment #26
MaxMendez CreditAttribution: MaxMendez commentedI ran into this issue to, would be so useful to merge and finally release the fixed of this issue.
Here patch for the latest dev (Drupal version is 7.91)
Comment #27
poker10 CreditAttribution: poker10 at ActivIT s.r.o. commentedThanks for the patch and reviews. I agree with @longwave that it must be considered carefully if this will be usefull for majority of D7 users. The system table should not have thousands of rows so this should not cause performance issues (note that longblob adds 2 bytes of storage for each row in comparission with blob).
But do we need to run the
db_change_field()
for other DB engines (PostgreSQL/SQLite), or only for MySQL? According to this: https://www.drupal.org/docs/7/api/schema-api/data-types/data-types-overview in PostgreSQL and SQLite the normal blob and big blob should be the same datatypes.Comment #28
Ronino CreditAttribution: Ronino commentedAdapted patch #26 for today's release of Drupal 7.93.
To update a running system, reverse #26, apply this new patch, then rerun system_update_7085() which is now supplied by Drupal core: