<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>LogikDevelopment &#187; group_concat_max_len</title>
	<atom:link href="http://www.logikdev.com/tag/group_concat_max_len/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.logikdev.com</link>
	<description>&#34;Il n&#039;y a pas de problème, il n&#039;y a que des solutions. L&#039;esprit de l&#039;homme invente ensuite le problème.&#34; André Gide</description>
	<lastBuildDate>Fri, 27 Aug 2010 08:54:27 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Why GROUP_CONCAT returns BLOB?</title>
		<link>http://www.logikdev.com/2010/02/11/why-group_concat-returns-blob/</link>
		<comments>http://www.logikdev.com/2010/02/11/why-group_concat-returns-blob/#comments</comments>
		<pubDate>Thu, 11 Feb 2010 19:11:46 +0000</pubDate>
		<dc:creator>smoreau</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Tricks]]></category>
		<category><![CDATA[blob]]></category>
		<category><![CDATA[group_concat()]]></category>
		<category><![CDATA[group_concat_max_len]]></category>
		<category><![CDATA[varchar]]></category>

		<guid isPermaLink="false">http://www.logikdev.com/?p=340</guid>
		<description><![CDATA[Last week, when using the GROUP_CONCAT() function on a MySQL database, I got an unexpected result. Indeed, instead of getting my result as VARCHAR types, I got it as BLOB types! For information, a BLOB is a binary large object that can hold a variable amount of data: http://dev.mysql.com/doc/refman/5.0/en/blob.html Because BLOB values are treated as binary [...]]]></description>
			<content:encoded><![CDATA[<p>Last week, when using the <code>GROUP_CONCAT()</code> function on a MySQL database, I got an unexpected result. <img src='http://www.logikdev.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
<p>Indeed, instead of getting my result as <code>VARCHAR</code> types, I got it as <code>BLOB</code> types! For information, a <code>BLOB</code> is a binary large object that can hold a variable amount of data:<br />
<a href="http://dev.mysql.com/doc/refman/5.0/en/blob.html" target="_blank">http://dev.mysql.com/doc/refman/5.0/en/blob.html</a><br />
Because <code>BLOB</code> values are treated as binary strings, it is not easy to use. This is why we would prefer to have <code>VARCHAR</code> values.</p>
<p>So the question is how to get around this frustrating problem?</p>
<p>The answer is, for once, very simple! <img src='http://www.logikdev.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /><br />
You simply need to:</p>
<ul>
<li>Open your my.ini or my.cnf file;</li>
<li>Change the value of the <code>group_concat_max_len</code> system variable to 512 (no &#8216;k&#8217; suffix);</li>
<li>Restart the mysql service</li>
</ul>
<p>To verify if the value has been successfully updated, execute the following command in your mysql client:</p>
<pre class="brush: sql; light: true;">
mysql&gt; show variables like &quot;%concat%&quot;;
+----------------------+-------+
| Variable_name        | Value |
+----------------------+-------+
| group_concat_max_len | 512   |
+----------------------+-------+
1 row in set (0.00 sec)
</pre>
<p>Note that you cannot set the value of <code>group_concat_max_len</code> to less than 1Kb using the MySQL Administrator GUI. Which means that the only way to set this system variable to 512 (which is less than 1Kb) is to edit your MySQL configuration file as described above.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.logikdev.com/2010/02/11/why-group_concat-returns-blob/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
