Group concat max length - MySQL
UPDATE: I noticed that I had some pretty big arrays being pumped out, and the global settings I was using were no where near enough. I did some research and discovered that I can set a session variable using PHP. So, I can remove the global setting completely.
In my global config file I do:
mysql_query("SET SESSION group_concat_max_len = 20480");
and I'm sorted out. I can adjust this when necessary and it won't affect anyone else.
I noticed that MySQL views that use group_concat may have truncated output. Specifically, the output is cropped at 341 characters (specifically varchar(341).
It turns out that MySQL has a global variable called group_concat_max_len and it's set to 1024 bytes by default.
A bit of trial and error showed that if I set the max_len to 8192 I get an non-truncated result. Here's the command:
SET GLOBAL group_concat_max_len = 8192
Output now shows as a longtext field.
** However, queries that produce HUGE output (like finding all of the characters associated with the place "Nowhere" still truncates. I'm leaving the GLOBAL at 8KB, though, as the exception is an extreme one and is not actually possible for end-users to request.