PDOException: SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'mailto' at row 1: INSERT INTO {mail_logger} (mailkey, mailto, subject, body, mailfrom, headers, date_sent, language) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6, :db_insert_placeholder_7); Array ( [:db_insert_placeholder_0] => workflow_notify_workflow_notify [:db_insert_placeholder_1] => Rebecca Driscoll - Event Creator;Matthew Biewener;Nancy Wichmann;A Proud CAPT Staff Person;Empress Nancy [:db_insert_placeholder_2] => something wicked this way cometh is now "Revisions Needed" [:db_insert_placeholder_3] => This is a multi-part message in MIME format. --3a30bbe224f026e56eaecb52d3cf2d7f304c8bfc1 Content-Type: multipart/alternative; boundary="40b7d85d5ee182c0f057108e64e4a19af9618b610" Content-Transfer-Encoding: 8bit --40b7d85d5ee182c0f057108e64e4a19af9618b610 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit something wicked this way cometh [1] is now "Revisions Needed". [1] http://local.captconnect.edc.org/event/something-wicked-way-cometh --40b7d85d5ee182c0f057108e64e4a19af9618b610 Content-Type: text/html; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8Bit
something wicked this way cometh is now "Revisions Needed".
--40b7d85d5ee182c0f057108e64e4a19af9618b610-- --3a30bbe224f026e56eaecb52d3cf2d7f304c8bfc1-- [:db_insert_placeholder_4] => "CAPT Connect" [:db_insert_placeholder_5] => a:7:{s:12:"MIME-Version";s:3:"1.0";s:12:"Content-Type";s:69:"multipart/mixed; boundary="3a30bbe224f026e56eaecb52d3cf2d7f304c8bfc1"";s:25:"Content-Transfer-Encoding";s:4:"8Bit";s:8:"X-Mailer";s:6:"Drupal";s:11:"Return-Path";s:19:"";s:6:"Sender";s:34:""CAPT Connect" ";s:4:"From";s:34:""CAPT Connect" ";} [:db_insert_placeholder_6] => 1439239991 [:db_insert_placeholder_7] => en ) in mail_logger_mail_alter() (line 110 of C:\wamp\www\Core7\sites\captconnect.edc.org\modules\contrib\mail_logger\mail_logger.module).
Comment | File | Size | Author |
---|---|---|---|
#25 | mail_logger-2549049-25.patch | 587 bytes | Rob C |
#23 | mail_logger-install-hack.patch | 590 bytes | brad.bulger |
#10 | 2549049-10.patch | 1.65 KB | NancyDru |
#3 | 2549049-3.patch | 1.02 KB | NancyDru |
Comments
Comment #2
NancyDruI increased the field to VARCHAR(2047) in the mail_logger.install file and I'm running now.
Comment #3
NancyDruHere's a patch.
Comment #5
NancyDruComment #7
vincenzodb CreditAttribution: vincenzodb as a volunteer commentedThis patch throw an error:
Comment #8
NancyDruHmm, worked fine for me on three different sites.
What version of MySql are you running?
Comment #9
vincenzodb CreditAttribution: vincenzodb as a volunteer commented@NancyDru 5.6.26
according to http://dev.mysql.com/doc/refman/5.6/en/innodb-restrictions.html
to increase index key size it's needed a specific configuration
By default, an index key for a single-column index can be up to 767 bytes. The same length limit applies to any index key prefix. See Section 13.1.12, “CREATE INDEX Syntax”. For example, you might hit this limit with a column prefix index of more than 255 characters on a TEXT or VARCHAR column, assuming a UTF-8 character set and the maximum of 3 bytes for each character. When the innodb_large_prefix configuration option is enabled, this length limit is raised to 3072 bytes, for InnoDB tables that use the DYNAMIC and COMPRESSED row formats.
(also for mysql 5.7)
Comment #10
NancyDruPlease try this patch.
Comment #11
vincenzodb CreditAttribution: vincenzodb as a volunteer commentedIt works, many thanks!
Comment #12
NancyDruGreat. I will go ahead and commit.
Comment #14
NancyDruComment #15
Rob C CreditAttribution: Rob C commentedThis does not seem to solve my problem.
On a site with 1.1 installed i upgraded to revision 779b3d30426e573d9779fbef40543837dbbba830 and executed updates via updates.php. This is what i get:
Failed: PDOException: SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes: ALTER TABLE {mail_logger} CHANGE `mailto` `mailto` VARCHAR(2047) NOT NULL COMMENT 'to whom this mail is going'; Array ( ) in db_change_field() (line 3020 of /public/includes/database/database.inc).
I'm on:
branch 7.x-1.x
779b3d30426e573d9779fbef40543837dbbba830
Comment #16
NancyDruPlease try the latest version, 7.x-1.3.
Comment #17
heatoni CreditAttribution: heatoni commentedI seem to be seeing this same issue with 7.x-1.3:
PDOException: SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes: ALTER TABLE {mail_logger} CHANGE `mailto` `mailto` VARCHAR(2047) NOT NULL COMMENT 'to whom this mail is going'; Array ( ) in db_change_field() (line 3020 of /home/ttivps/public_html/includes/database/database.inc).
Is there some way I can debug this? MySQL version: 5.6.29-log
Comment #18
NancyDruThe index should be meet that limit now. Make sure you ran update.php.
Comment #19
egontinno CreditAttribution: egontinno commentedSame error is displayed when I run update.php.
MySQL 5.6.28
Comment #20
NancyDruAny MySql experts around?
Comment #21
brad.bulger CreditAttribution: brad.bulger commentedalso getting an error with mysql 5.6.28
what's peculiar is that running that same query via drush sql-query works. running db_change_field() from a script fails.
the difference seems to be the value of the variable
sql_mode
- when the query is run from the script, the value isSTRICT_TRANS_TABLES seems to be the culprit. setting that explicitly before running the ALTER TABLE query causes the error.
http://dev.mysql.com/doc/refman/5.6/en/sql-mode.html
http://dev.mysql.com/doc/refman/5.6/en/sql-mode.html#sql-mode-strict
Comment #22
NancyDruIs that something that was changed in 5.6? How might people turn that off? Can it be turned off in the update hook?
Comment #23
brad.bulger CreditAttribution: brad.bulger commentedi changed the sql_mode variable in the install hook and that worked for me. the mysql doc link about strict sql mode says that it didn't used to generate an error, i think. it also implies that without the error it would just fail silently, i think, which isn't great.
Comment #24
NancyDruCould you try it like this, please?
Comment #25
Rob C CreditAttribution: Rob C commented#23 / #24 fixed the problem for me with MySQL 5.6.29.
Comment #27
NancyDruThanks.