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]
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

kenorb created an issue. See original summary.

kenorb’s picture

Issue summary: View changes
kenorb’s picture

Issue summary: View changes
longwave’s picture

I 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()?

kenorb’s picture

kenorb’s picture

Status: Active » Needs review
kenorb’s picture

Issue summary: View changes
kenorb’s picture

Issue summary: View changes

This 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().

iamEAP’s picture

Status: Needs review » Needs work

Patch 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.

sudaz’s picture

Updated patch to add a field change update hook as mentioned in #9 for existing installs

Etroid’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 11: system--increase-size-field-info-2580473-11.patch, failed testing. View results

sudaz’s picture

Etroid’s picture

Status: Needs work » Needs review
iamEAP’s picture

Category: Feature request » Bug report
Status: Needs review » Reviewed & tested by the community

Looks like Drupal does not support mediumblob for portability reasons, so largeblob 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.

Pol’s picture

Looks fine to me.

Rob C’s picture

Upped the update hook, system_update_7082() now exists in core.

init90’s picture

I've also encountered with such problem when worked with feature which contain huge amount of data.

Reupload patch with some cosmetic corrections.

init90’s picture

I've recreated patch in proper way.

luismagr’s picture

Hi @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

danyg’s picture

Status: Needs review » Reviewed & tested by the community

Hi, I've tested the patch at #20 and it works like a charm. I'm changing it to RTBC.
@init90 Thanks for the patch!

44sunsets’s picture

We'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.

danyg’s picture

Here is the updated patch for the latest dev (Drupal version is 7.71)

mibfire’s picture

I ran into this issue too. When can this be released? I am asking because this is a serious issue and should be fixed asap.

MaxMendez’s picture

I 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)

poker10’s picture

Thanks 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.

Ronino’s picture

Status: Reviewed & tested by the community » Needs review
FileSize
1.15 KB
627 bytes

Adapted 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:

$ drush eval "module_load_include('install', 'system'); system_update_7085();"
$ drush updb