title: Avoid row was cut by GROUP_CONCAT error on insert without changing group_concat_max_len
body: <p>I have an insert that uses a GROUP_CONCAT.  In certain scenarios, the insert fails with Row XX was cut by GROUP_CONCAT.  I understand why it fails but I'm looking for a way to have it not error out since the insert column is already smaller than the group_concat_max_len.  I don't want to increase group_concat_max_len.</p>
  
  <pre><code>drop table if exists a;
  create table a (x varchar(10), c int);
  
  drop table if exists b;
  create table b (x varchar(10));
  
  insert into b values ('abcdefgh');
  insert into b values ('ijklmnop');
  
  -- contrived example to show that insert column size varchar(10) &lt; 15
  set session group_concat_max_len = 15;
  
  insert into a select group_concat(x separator ', '), count(*) from b;
  </code></pre>
  
  <p>This insert produces the error <code>Row 2 was cut by GROUP_CONCAT()</code>.</p>
  
  <p>I'll try to provide a few clarifications -</p>
  
  <ol>
  <li><p>The data in table b is unknown.  There is no way to say set group_concat_max_len to a value greater than 18.</p></li>
  <li><p>I do know the insert column size.</p></li>
  <li><p>Why group_concat 4 GB of data when you want the first x characters?</p></li>
  <li><p>When the concatenated string is longer than 10 chars, it should insert the first 10 characters.</p></li>
  </ol>
  
  <p>Thanks.</p>