The only reason why I am using this module is because it is dependent on openlayers (7.x-3.x).
The directory structure of the sub-modules and class files are ridiculously long and can't be stored in core tables like {system} or {registry}.
I have noticied about this issue because I'm porting my site to new development environment, after having converted my database to utf8mb4 (suggested by new drupal 7.50).
In my continuous integration environment I use drush for some maintenance tasks during integration (like clean cache and registry_rebuild for clean class references after code merge). This worked well until now.
Now I'm getting too many errors like this:
#1406 - Data too long for column 'column_name'
error reg PDOException: SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'filename'
ist at row 1: INSERT INTO {registry_file} (filename, hash) VALUES (:db_insert_placeholder_
ry
There are also problems in administrative pages because some of the core process run updates in the system tables or registry, especially when I'm activating/deactivating some module.
The data previouslly data was stored in classic utf8_* tables. {system} table has a filename field as a varchar(255) with a primary key index, {registry} table too.
In order to restore the database dump in a new database, I had to replace varchar(255) by varchar(191) (is a MySQL restriction). Now, strings like file paths of this module can't be stored.
For example.
Tracing ALL queries and running drush, i got this before crash:
WD registry: PDOException: SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'filename' at row 1: [error]
INSERT INTO {registry_file} (filename, hash) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1); Array
(
[:db_insert_placeholder_0] =>
sites/all/modules/contrib/service_container/modules/providers/service_container_annotation_discovery/lib/Drupal/service_container_annotation_discovery/Tests/ServiceContainerAnnotationDiscoveryIntegrationTest.php
[:db_insert_placeholder_1] => 9785260ca850549141784b936ab3b8f29c9d16b768569891ef2c852cb7e26f9a
)
in registry_autoload_registry_files_alter() (line 104 of
/var/www/html/sites/all/modules/contrib/registry_autoload/registry_autoload.module).
PDOException: SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'filename' at row 1 in [error]
/var/www/html/includes/database/database.inc:2204
I need a complete refactor of this module, shorter file names and less directories (or shorter). Also consider removing classes and libraries module or move them outside.
Meanwhile, I had to go roolback my database using old database dumps to run the site.the site.
Comments
Comment #2
sir_gon commentedComment #3
stefan.r commented@sir_gon
In order to use utf8mb4 in drupal 7, you'll need to use InnoDB with innodb_large_prefix turned on (which allows for the full 255 characters and works around the 191 character limitation -- see the requirements listed in settings.php)
Comment #4
fabianx commentedThe character set might be problematic as the registry is not made for it, but yes Stefan is right and it should be able to use the full 255 characters.
So this works as designed.
Comment #5
frank1982 commentedLong Path Tool is useful here