Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Saw the following notice in my watchdog:
message | PDOException: SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'parent' at row 1: INSERT INTO {browscap_statistics} (parent, counter, is_crawler) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2); Array ( [:db_insert_placeholder_0] => Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; GTB6.6; chromeframe/10.0.648.151; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; eSobiSubscriber 2.0.4.16; .NET CLR 3.5.30729; InfoPath.2; .NET CLR 3.0.30729; .NET CLR 1.1.4322; .NET4.0C; AskTbBLPV5/5.9.1.14019) [:db_insert_placeholder_1] => 1 [:db_insert_placeholder_2] => 1 ) in browscap_exit() (line 98 of /var/www/sites/all/modules/browscap/browscap.module). |
Comments
Comment #1
pillarsdotnet CreditAttribution: pillarsdotnet commentedAttached patch fixes the problem by truncating HTTP_USER_AGENT string to 255 characters.
Comment #2
pillarsdotnet CreditAttribution: pillarsdotnet commentedbump.
Comment #3
troybthompson CreditAttribution: troybthompson commentedConfirmed that this patch fixes the same error one of my users was getting.
Comment #4
bernard63 CreditAttribution: bernard63 commentedHi,
I am a French Drupal beginner (sorry for my language)
I have the same problem with the Agregator module.
Is HTTP_USER_AGENT a phpmyadmin value for browscape.module, or where is it ?
I search in all direction to resolve my problem.
Thank you for a response.
Bernard
Comment #5
Devin Carlson CreditAttribution: Devin Carlson commentedThe patch in #1 applies cleanly and fixes the issue of having user agent names which are longer than the maximum size allowed by the parent column (255 characters).
The issue occurs because
browscap_exit
successfully truncates$browser['parent']
when a default browser is not found but does not truncate$_SERVER['HTTP_USER_AGENT']
when a default browser is found.bernard63, for issues concerning maximum data lengths and the Aggregator module, please see:
Comment #6
Devin Carlson CreditAttribution: Devin Carlson commentedCommitted to 7.x-1.x.
Comment #7
Devin Carlson CreditAttribution: Devin Carlson commentedBackport of #1.
Comment #8
Devin Carlson CreditAttribution: Devin Carlson commentedCommitted to 6.x-1.x.