@anonymous-piwik-user opened this Issue on December 27th 2013

Hello,

Recently ran into what looks to be a regression of Bug #490 ([490]).

Basically, when multiple languages are used in Chrome, the browser language string may exceed the 20 characters specified by the database and a database error is thrown.

In my case, the string was: "en,es,af,es-419,en-us" (which is 21 characters).

I have applied a substr patch as submitted in pull request (https://github.com/piwik/piwik/pull/181). This seems better than expanding the database column for what is largely informational with diminishing returns after a certain point. But I leave that decision to you guys.

The sql error is:

Error query: SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'location_browser_lang' at row 1
In query: INSERT INTO piwik_log_visit (idsite, visitor_localtime, idvisitor, visitor_returning, visitor_count_visits, visitor_days_since_last, visitor_days_since_order, visitor_days_since_first, visit_first_action_time, visit_last_action_time, visit_entry_idaction_url, visit_entry_idaction_name, visit_exit_idaction_url, visit_exit_idaction_name, visit_total_actions, visit_total_searches, visit_total_events, visit_total_time, visit_goal_buyer, referer_type, referer_name, referer_url, referer_keyword, config_id, config_os, config_browser_name, config_browser_version, config_resolution, config_pdf, config_flash, config_java, config_director, config_quicktime, config_realplayer, config_windowsmedia, config_gears, config_silverlight, config_cookie, location_ip, location_browser_lang, visit_goal_converted, location_provider, location_country) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
Parameters: array (
0 => 1,
1 => '10:11:31',
2 => '6 fW',
3 => 0,
4 => 1,
5 => 0,
6 => 0,
7 => 0,
8 => '2013-12-27 15:11:31',
9 => '2013-12-27 15:11:31',
10 => 40,
11 => 1,
12 => 40,
13 => 1,
14 => 1,
15 => 0,
16 => 0,
17 => 0,
18 => 0,
19 => 1,
20 => false,
21 => '',
22 => false,
23 => '("C9',
24 => 'WI7',
25 => 'CH',
26 => '31.0',
27 => '1920x1080',
28 => 1,
29 => 1,
30 => 1,
31 => 0,
32 => 0,
33 => 0,
34 => 0,
35 => 0,
36 => 1,
37 => 1,
38 => '' . "\0" . '' . "\0" . '' . "\0" . '' . "\0" . '' . "\0" . '' . "\0" . 'B',
39 => '1234567890123456789012345',
40 => 0,
41 => 'cl.local',
42 => 'xx',
)

I feel like this error occured after upgrading to v2, but can't be entirely sure as previous entries had a truncated value for this column.

Great product by the way, awesome job!

Thanks,
Ryan
Keywords: location_browser_language

@mattab commented on January 3rd 2014 Owner
This Issue was closed on January 3rd 2014
Powered by GitHub Issue Mirror