<?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>Gary Pendergast &#187; MySQL</title>
	<atom:link href="http://pento.net/category/mysql/feed/" rel="self" type="application/rss+xml" />
	<link>http://pento.net</link>
	<description>I&#039;m on the Internet</description>
	<lastBuildDate>Wed, 08 Sep 2010 07:04:40 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
<cloud domain='pento.net' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
		<item>
		<title>Leaving MySQL (Not Really)</title>
		<link>http://pento.net/2009/06/05/leaving-mysql-not-really/</link>
		<comments>http://pento.net/2009/06/05/leaving-mysql-not-really/#comments</comments>
		<pubDate>Fri, 05 Jun 2009 21:50:18 +0000</pubDate>
		<dc:creator>Gary Pendergast</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Travel]]></category>
		<guid isPermaLink="false">http://pento.net/?p=248</guid>
		<description><![CDATA[I&#8217;ve been a bit slack about writing my MySQL thoughts of late. This would be caused by the fact that, as I write this, I&#8217;m now one week into a 12 month leave of absence from MySQL. Having given it much careful consideration, I&#8217;ve decided that the wisest way to survive the current economic problems [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been a bit slack about writing my MySQL thoughts of late. This would be caused by the fact that, as I write this, I&#8217;m now one week into a 12 month leave of absence from MySQL.</p>
<p>Having given it much careful consideration, I&#8217;ve decided that the wisest way to survive the current economic problems is by blowing my savings on a year long holiday in Italy. Wait, did I say holiday? Not really. I&#8217;m still a Sun employee, and I&#8217;m still going to be active in the MySQL community. My dear support customers just won&#8217;t be seeing me around for a while. <img src='http://pento.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>I&#8217;m looking forward to having time to write more extensively about some of the cool things we&#8217;re doing, and what&#8217;s going on in the community at large. If there&#8217;s anything you&#8217;d like to hear about (either expanding on <a href="http://pento.net/category/mysql/">my previous posts</a>, or a completely new topic), please let me know.</p>
<p>Another thing I&#8217;d like to do, if there are any interested parties, is to see how companies are using MySQL in their part of the world. So, if you don&#8217;t mind showing off what you&#8217;re doing and having me write a little bit about it, feel free to drop me a line. All of my current contact details can be found on <a href="http://pento.net/contact/">my contact page</a>. I&#8217;m going to be primarily based in Milan, but I&#8217;ll be looking to travel around the rest of Europe at some point, so I&#8217;d be more than happy to stop by and see you if the opportunity arises.</p>
]]></content:encoded>
			<wfw:commentRss>http://pento.net/2009/06/05/leaving-mysql-not-really/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>MySQL and Geospatial Data</title>
		<link>http://pento.net/2009/05/18/mysql-and-geospatial-data/</link>
		<comments>http://pento.net/2009/05/18/mysql-and-geospatial-data/#comments</comments>
		<pubDate>Mon, 18 May 2009 01:08:12 +0000</pubDate>
		<dc:creator>Gary Pendergast</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[GIS]]></category>
		<guid isPermaLink="false">http://pento.net/?p=242</guid>
		<description><![CDATA[MySQL has had basic support for Geospatial Data since 4.1, but has lacked some of the features of the OpenGIS specifications since then. The good news is, this is rapidly changing. Our own Holyfoot has been hammering away at WorkLog #1327, to provide precise functions for our GIS support. Even better, it&#8217;s fast. How fast? [...]]]></description>
			<content:encoded><![CDATA[<p>MySQL has had basic support for Geospatial Data since 4.1, but has lacked some of the features of the <a href="http://www.opengeospatial.org/">OpenGIS</a> specifications since then. The good news is, this is rapidly changing. Our own Holyfoot has been hammering away at <a href="http://forge.mysql.com/worklog/task.php?id=1326">WorkLog #1327</a>, to provide precise functions for our GIS support.</p>
<p>Even better, it&#8217;s fast. How fast? Well, the good people at Oki Labs, apart from having implemented <a href="http://okilab.jp/blog/2008/07/distance_sphere_distance_spher.html">several new GIS functions</a> for MySQL, have done some benchmarking, and it&#8217;s looking good. If you&#8217;ll excuse the cliched comparison to Postgres, here are the response times (seconds) of MySQL GIS vs. PostGIS in Oki&#8217;s test:</p>
<table>
<tbody>
<tr>
<th>Connections</th>
<th> PostGIS</th>
<th> MySQL</th>
</tr>
<tr>
<td>1</td>
<td>1.817</td>
<td>0.220</td>
</tr>
<tr>
<td>100</td>
<td>10.517</td>
<td>0.557</td>
</tr>
</tbody>
</table>
<p>Source: <a href="http://www.osgeo.jp/wordpress/wp-content/uploads/2008/11/foss4g2008_okumura.pdf">http://www.osgeo.jp/wordpress/wp-content/uploads/2008/11/foss4g2008_okumura.pdf</a></p>
<p>If you&#8217;re interested in checking it out, the source tree (regularly merged with MySQL 5.1) is available <a href="https://code.launchpad.net/~mysql/mysql-server/mysql-5.1-wl1326">here</a>. Have a look at Giuseppe&#8217;s guide to <a href="http://datacharmer.blogspot.com/2008/06/from-bazaar-to-sandbox-in-5-moves.html">running a Bazaar export</a> in <a href="https://launchpad.net/mysql-sandbox">MySQL Sandbox</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://pento.net/2009/05/18/mysql-and-geospatial-data/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Open Database Alliance = Awesome</title>
		<link>http://pento.net/2009/05/14/open-database-alliance-awesome/</link>
		<comments>http://pento.net/2009/05/14/open-database-alliance-awesome/#comments</comments>
		<pubDate>Thu, 14 May 2009 00:13:28 +0000</pubDate>
		<dc:creator>Gary Pendergast</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[ODA]]></category>
		<guid isPermaLink="false">http://pento.net/?p=236</guid>
		<description><![CDATA[The big news coming from the MySQL Community today is that Monty Widenius and Percona have founded the Open Database Alliance, a group focused on &#8221;unifing all MySQL-related development and services, providing a solution to the fragmentation and uncertainty facing the communities, businesses and technical experts involved with MySQL&#8221;. I, for one, am 100% behind this. [...]]]></description>
			<content:encoded><![CDATA[<p>The big news coming from the MySQL Community today is that Monty Widenius and Percona have founded the <a href="http://opendatabasealliance.com/">Open Database Alliance</a>, a group focused on &#8221;unifing all MySQL-related development and services, providing a solution to the fragmentation and uncertainty facing the communities, businesses and technical experts involved with MySQL&#8221;.</p>
<p>I, for one, am 100% behind this. I&#8217;ve always been a big fan of community foundations being a focus point for development efforts, they work well to bring everyone together, and to provide a sensible foundation to help avoid much of the uncertainty that seems to spring up around MySQL. I certainly hope that the ODA is able to do the same.</p>
<p>Though I do have one question, how does the ODA plan on handling competing members? If you have two companies offering the same service in the same market, which one will the ODA recommend? Monty specifically says that &#8220;all companies that are joining the Alliance should bring something to the table&#8221;, but it&#8217;s a bit difficult to bring something new when there are already several large players in the MySQL market.</p>
<p>I shall certainly be watching the progress of this alliance with great interest, it has the potential to turn the MySQL Community into a large driving force for development and change.</p>
<p>The press release is available <a href="http://www.prweb.com/releases/2009/05/prweb2417854.htm">here</a>, Monty has written some interesting thoughts about it <a href="http://monty-says.blogspot.com/2009/05/open-database-alliance-founded.html">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://pento.net/2009/05/14/open-database-alliance-awesome/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Don&#8217;t Forget to Alter your Federated Tables!</title>
		<link>http://pento.net/2009/05/05/dont-forget-to-alter-your-federated-tables/</link>
		<comments>http://pento.net/2009/05/05/dont-forget-to-alter-your-federated-tables/#comments</comments>
		<pubDate>Tue, 05 May 2009 08:40:47 +0000</pubDate>
		<dc:creator>Gary Pendergast</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[federated]]></category>
		<guid isPermaLink="false">http://pento.net/?p=229</guid>
		<description><![CDATA[If you&#8217;re using the Federated engine, here&#8217;s something important to remember (apart from the usual advice of &#8220;please don&#8217;t&#8221;). If you need to change the structure of the remote table, always remember to update the Federated table. If not, when you try to use the table, you&#8217;ll get this error: mysql&#62; SELECT * FROM foo; [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re using the Federated engine, here&#8217;s something important to remember (apart from the usual advice of &#8220;please don&#8217;t&#8221;). If you need to change the structure of the remote table, always remember to update the Federated table. If not, when you try to use the table, you&#8217;ll get this error:</p>
<div class="wp_syntax"><div class="code"><pre class="mysql" style="font-family:monospace;">mysql<span style="color: #CC0099;">&gt;</span> <span style="color: #990099; font-weight: bold;">SELECT</span> <span style="color: #CC0099;">*</span> <span style="color: #990099; font-weight: bold;">FROM</span> foo<span style="color: #000033;">;</span>
ERROR <span style="color: #008080;">1030</span> <span style="color: #FF00FF;">&#40;</span>HY000<span style="color: #FF00FF;">&#41;</span>: Got error <span style="color: #008080;">1</span> <span style="color: #990099; font-weight: bold;">from</span> storage <span style="color: #990099; font-weight: bold;">engine</span></pre></div></div>
<p>This error isn&#8217;t really helpful. The problem is, the Federated engine only checks that the remote table structure is correct when it initially connects. Once it has connected, no more checks. When you restart the server, you get a much more helpful message:</p>
<div class="wp_syntax"><div class="code"><pre class="mysql" style="font-family:monospace;">mysql <span style="color: #990099; font-weight: bold;">SELECT</span> <span style="color: #CC0099;">*</span> <span style="color: #990099; font-weight: bold;">FROM</span> foo<span style="color: #000033;">;</span>
ERROR <span style="color: #008080;">1431</span> <span style="color: #FF00FF;">&#40;</span>HY000<span style="color: #FF00FF;">&#41;</span>: The foreign <span style="color: #990099; font-weight: bold;">data</span> source you are trying <span style="color: #990099; font-weight: bold;">to</span> reference does <span style="color: #CC0099; font-weight: bold;">not</span> exist. <span style="color: #990099; font-weight: bold;">Data</span> source error:  error: <span style="color: #008080;">1054</span>  <span style="color: #008000;">'Unknown column '</span>b<span style="color: #008000;">' in '</span><span style="color: #000099;">field</span> list<span style="color: #008000;">''</span></pre></div></div>
<p>Also, keep your eye on the <a title="FederatedX Storage Engine project page" href="http://forge.mysql.com/projects/project.php?id=265">FederatedX</a> project. It&#8217;s still under development, but will hopefully upgrade the Federated engine to being useful again.</p>
]]></content:encoded>
			<wfw:commentRss>http://pento.net/2009/05/05/dont-forget-to-alter-your-federated-tables/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>MySQL is People!</title>
		<link>http://pento.net/2009/05/03/mysql-is-people/</link>
		<comments>http://pento.net/2009/05/03/mysql-is-people/#comments</comments>
		<pubDate>Sun, 03 May 2009 11:38:01 +0000</pubDate>
		<dc:creator>Gary Pendergast</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[skydiving]]></category>
		<guid isPermaLink="false">http://pento.net/?p=220</guid>
		<description><![CDATA[I went skydiving yesterday. Here&#8217;s a short video of me voluntarily leaving an airborne and perfectly sound aeroplane: What does this have to do with MySQL? Well, over the past few weeks there have been a bunch of conspiracy theories bouncing around. There are various topics, but the two favourite at the moment happen to [...]]]></description>
			<content:encoded><![CDATA[<p>I went skydiving yesterday. Here&#8217;s a short video of me voluntarily leaving an airborne and perfectly sound aeroplane:</p>
<p style="text-align: center;"><object type="application/x-shockwave-flash" style="width:480px; height:385px;" data="http://www.youtube.com/v/Qern2XzU3sg"><param name="movie" value="http://www.youtube.com/v/Qern2XzU3sg" /></object></p>
<p>What does this have to do with MySQL? Well, over the past few weeks there have been a bunch of conspiracy theories bouncing around. There are various topics, but the two favourite at the moment happen to be Oracle&#8217;s plans for MySQL, and the licensing of the MySQL documentation. There has been a long history of conspiracies surrounding MySQL, from Oracle&#8217;s original purchase of InnoDB, to our decision to create the Enterprise edition of the server, through to our long and bumpy release cycle.</p>
<p>Now, don&#8217;t get me wrong. I&#8217;m not making any calls to stifle discussion, I&#8217;m a big fan of community input. I was a member of the community before I joined MySQL, and I like to think that I still am. But I would like it if we could at least think about conspiracy theories before posting about them. We&#8217;re all people here at MySQL, we have evenings and weekends and lives just like you. Some of us are crazy enough to do silly things like jumping out of aeroplanes. We&#8217;re not out to get you, and we&#8217;re certainly not planning on turning into some sort of faceless corporate stereotype. We&#8217;re here to do what we love, creating and supporting a really good product.</p>
<p>Oh, and how do you know this isn&#8217;t some corporate play to make us seem human? Well, it&#8217;s 9:30pm on a Sunday night here, I&#8217;m yet to find a company who could pay me well enough to be shilling for them. But MySQL happens to be a group of people I like enough to defend them on my own time.</p>
]]></content:encoded>
			<wfw:commentRss>http://pento.net/2009/05/03/mysql-is-people/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>MySQL Workbench: My Impressions</title>
		<link>http://pento.net/2009/04/17/mysql-workbench-my-impressions/</link>
		<comments>http://pento.net/2009/04/17/mysql-workbench-my-impressions/#comments</comments>
		<pubDate>Fri, 17 Apr 2009 10:23:37 +0000</pubDate>
		<dc:creator>Gary Pendergast</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[MySQL Workbench]]></category>
		<guid isPermaLink="false">http://pento.net/?p=217</guid>
		<description><![CDATA[I&#8217;ve been using the MySQL Workbench 5.1 beta for the past few days now, and I&#8217;m wondering how I designed databases without it. Okay, so that&#8217;s a pretty strong statement, but I&#8217;m genuinely happy with it. 5.1 has fixed my main problem with 5.0, in that the EER diagram mode was horribly slow to render, [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been using the MySQL Workbench 5.1 beta for the past few days now, and I&#8217;m wondering how I designed databases without it.</p>
<p>Okay, so that&#8217;s a pretty strong statement, but I&#8217;m genuinely happy with it. 5.1 has fixed my main problem with 5.0, in that the EER diagram mode was horribly slow to render, now it&#8217;s all nice and smooth. The ability to easily visualise tables and their relationships makes design very simple.</p>
<p>In fact, I really only have one (minor) complaint, the ability to export without foreign keys would be nice. Sometimes you just don&#8217;t want to deal with the performance hit.</p>
<p>That&#8217;s about it. Go and download the <a title="MySQL Workbench OSS 5.1 Beta download" href="http://dev.mysql.com/downloads/workbench/5.1.html#Workbench_5.1_Beta_-_Binaries_and_Source">OSS edition for free now</a>, have a play around. Make it your Friday afternoon experiment. I promise you&#8217;ll like it.</p>
]]></content:encoded>
			<wfw:commentRss>http://pento.net/2009/04/17/mysql-workbench-my-impressions/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Extracting a Database From a mysqldump File</title>
		<link>http://pento.net/2009/04/16/extracting-a-database-from-a-mysqldump-file/</link>
		<comments>http://pento.net/2009/04/16/extracting-a-database-from-a-mysqldump-file/#comments</comments>
		<pubDate>Thu, 16 Apr 2009 03:31:55 +0000</pubDate>
		<dc:creator>Gary Pendergast</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[mysqldump]]></category>
		<category><![CDATA[sed]]></category>
		<guid isPermaLink="false">http://pento.net/?p=208</guid>
		<description><![CDATA[Restoring a single database from a full dump is pretty easy, using the mysql command line client&#8217;s --one-database option: mysql&#62; mysql -u root -p --one-database db_to_restore &#60; fulldump.sql But what if you don&#8217;t want to restore the database, you just want to extract it out of the dump file? Well, that happens to be easy [...]]]></description>
			<content:encoded><![CDATA[<p>Restoring a single database from a full dump is pretty easy, using the <kbd>mysql</kbd> command line client&#8217;s <kbd>--one-database</kbd> option:</p>
<pre>mysql&gt; mysql -u root -p --one-database db_to_restore &lt; fulldump.sql</pre>
<p>But what if you don&#8217;t want to restore the database, you just want to extract it out of the dump file? Well, that happens to be easy as well, thanks to the magic of <kbd>sed</kbd>:</p>
<pre>shell&gt; sed -n '/^-- Current Database: `test`/,/^-- Current Database: `/p' fulldump.sql &gt; test.sql</pre>
<p>You just need to change &#8220;test&#8221; to be the name of the database you want extracted.</p>
]]></content:encoded>
			<wfw:commentRss>http://pento.net/2009/04/16/extracting-a-database-from-a-mysqldump-file/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Don&#8217;t put a NULL in the IN clause in 5.1</title>
		<link>http://pento.net/2009/04/08/dont-put-a-null-in-the-in-clause-in-51/</link>
		<comments>http://pento.net/2009/04/08/dont-put-a-null-in-the-in-clause-in-51/#comments</comments>
		<pubDate>Wed, 08 Apr 2009 07:36:08 +0000</pubDate>
		<dc:creator>Gary Pendergast</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[MySQL 5.1]]></category>
		<category><![CDATA[optimizer]]></category>
		<category><![CDATA[regression]]></category>
		<guid isPermaLink="false">http://pento.net/?p=173</guid>
		<description><![CDATA[There seems to be an optimizer problem in 5.1, if you put a NULL in the IN clause of a SELECT. For example, given the following table: CREATE TABLE foo &#40; a INT NOT NULL AUTO_INCREMENT, PRIMARY KEY &#40;a&#41; &#41;; Compare these two EXPLAINs: mysql&#62; EXPLAIN * FROM foo WHERE a IN &#40;160000, 160001, 160002&#41;\G [...]]]></description>
			<content:encoded><![CDATA[<p>There seems to be an optimizer problem in 5.1, if you put a NULL in the IN clause of a SELECT. For example, given the following table:</p>
<div class="wp_syntax"><div class="code"><pre class="mysql" style="font-family:monospace;"><span style="color: #990099; font-weight: bold;">CREATE</span> <span style="color: #990099; font-weight: bold;">TABLE</span> foo <span style="color: #FF00FF;">&#40;</span>
    a <span style="color: #999900; font-weight: bold;">INT</span> <span style="color: #CC0099; font-weight: bold;">NOT</span> <span style="color: #9900FF; font-weight: bold;">NULL</span> <span style="color: #FF9900; font-weight: bold;">AUTO_INCREMENT</span><span style="color: #000033;">,</span>
    <span style="color: #990099; font-weight: bold;">PRIMARY KEY</span> <span style="color: #FF00FF;">&#40;</span>a<span style="color: #FF00FF;">&#41;</span>
<span style="color: #FF00FF;">&#41;</span><span style="color: #000033;">;</span></pre></div></div>
<p>Compare these two EXPLAINs:</p>
<div class="wp_syntax"><div class="code"><pre class="mysql" style="font-family:monospace;">mysql<span style="color: #CC0099;">&gt;</span> <span style="color: #990099; font-weight: bold;">EXPLAIN</span> <span style="color: #CC0099;">*</span> <span style="color: #990099; font-weight: bold;">FROM</span> foo <span style="color: #990099; font-weight: bold;">WHERE</span> a <span style="color: #990099; font-weight: bold;">IN</span> <span style="color: #FF00FF;">&#40;</span><span style="color: #008080;">160000</span><span style="color: #000033;">,</span> <span style="color: #008080;">160001</span><span style="color: #000033;">,</span> <span style="color: #008080;">160002</span><span style="color: #FF00FF;">&#41;</span>\G
<span style="color: #CC0099;">***************************</span> <span style="color: #008080;">1.</span> row <span style="color: #CC0099;">***************************</span>
           id: <span style="color: #008080;">1</span>
  select_type: <span style="color: #990099; font-weight: bold;">SIMPLE</span>
        <span style="color: #990099; font-weight: bold;">table</span>: foo
         <span style="color: #990099; font-weight: bold;">type</span>: range
possible_keys: PRIMARY
          <span style="color: #990099; font-weight: bold;">key</span>: PRIMARY
      key_len: <span style="color: #008080;">4</span>
          ref: <span style="color: #9900FF; font-weight: bold;">NULL</span>
         rows: <span style="color: #008080;">3</span>
        Extra: <span style="color: #990099; font-weight: bold;">Using</span> <span style="color: #990099; font-weight: bold;">where</span>
<span style="color: #008080;">1</span> row <span style="color: #990099; font-weight: bold;">in</span> <span style="color: #990099; font-weight: bold;">set</span> <span style="color: #FF00FF;">&#40;</span><span style="color: #008080;">0.06</span> sec<span style="color: #FF00FF;">&#41;</span>
&nbsp;
mysql<span style="color: #CC0099;">&gt;</span> <span style="color: #990099; font-weight: bold;">EXPLAIN</span> <span style="color: #990099; font-weight: bold;">SELECT</span> <span style="color: #CC0099;">*</span> <span style="color: #990099; font-weight: bold;">FROM</span> foo <span style="color: #990099; font-weight: bold;">WHERE</span> a <span style="color: #990099; font-weight: bold;">IN</span> <span style="color: #FF00FF;">&#40;</span><span style="color: #9900FF; font-weight: bold;">NULL</span><span style="color: #000033;">,</span> <span style="color: #008080;">160000</span><span style="color: #000033;">,</span> <span style="color: #008080;">160001</span><span style="color: #000033;">,</span> <span style="color: #008080;">160002</span><span style="color: #FF00FF;">&#41;</span>\G
<span style="color: #CC0099;">***************************</span> <span style="color: #008080;">1.</span> row <span style="color: #CC0099;">***************************</span>
           id: <span style="color: #008080;">1</span>
  select_type: <span style="color: #990099; font-weight: bold;">SIMPLE</span>
        <span style="color: #990099; font-weight: bold;">table</span>: foo
         <span style="color: #990099; font-weight: bold;">type</span>: <span style="color: #990099; font-weight: bold;">ALL</span>
possible_keys: PRIMARY
          <span style="color: #990099; font-weight: bold;">key</span>: <span style="color: #9900FF; font-weight: bold;">NULL</span>
      key_len: <span style="color: #9900FF; font-weight: bold;">NULL</span>
          ref: <span style="color: #9900FF; font-weight: bold;">NULL</span>
         rows: <span style="color: #008080;">327680</span>
        Extra: <span style="color: #990099; font-weight: bold;">Using</span> <span style="color: #990099; font-weight: bold;">where</span>
<span style="color: #008080;">1</span> row <span style="color: #990099; font-weight: bold;">in</span> <span style="color: #990099; font-weight: bold;">set</span> <span style="color: #FF00FF;">&#40;</span><span style="color: #008080;">0.00</span> sec<span style="color: #FF00FF;">&#41;</span></pre></div></div>
<p>In the query with the NULL, it does a full table scan. So, if you&#8217;ve run into this problem under MySQL 5.1, the workaround is to remove the NULL. This doesn&#8217;t affect MySQL 4.x or 5.0. </p>
<p>You can also follow along with <a href="http://bugs.mysql.com/44139">Bug #33139</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://pento.net/2009/04/08/dont-put-a-null-in-the-in-clause-in-51/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JOIN and comma precedence</title>
		<link>http://pento.net/2009/04/03/join-and-comma-precedence/</link>
		<comments>http://pento.net/2009/04/03/join-and-comma-precedence/#comments</comments>
		<pubDate>Fri, 03 Apr 2009 04:00:53 +0000</pubDate>
		<dc:creator>Gary Pendergast</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[comma]]></category>
		<category><![CDATA[join]]></category>
		<category><![CDATA[precedence]]></category>
		<guid isPermaLink="false">http://pento.net/?p=149</guid>
		<description><![CDATA[Here&#8217;s a little something that might trip you up occasionally. Have a look at this test scenario: USE test; DROP TABLE IF EXISTS a; DROP TABLE IF EXISTS b; DROP TABLE IF EXISTS c; &#160; CREATE TABLE a &#40; a INT &#41;; CREATE TABLE b &#40; b INT &#41;; CREATE TABLE c &#40; c INT [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a little something that might trip you up occasionally. Have a look at this test scenario:</p>
<div class="wp_syntax"><div class="code"><pre class="mysql" style="font-family:monospace;"><span style="color: #990099; font-weight: bold;">USE</span> test<span style="color: #000033;">;</span>
<span style="color: #990099; font-weight: bold;">DROP</span> <span style="color: #990099; font-weight: bold;">TABLE</span> <span style="color: #009900;">IF</span> <span style="color: #990099; font-weight: bold;">EXISTS</span> a<span style="color: #000033;">;</span>
<span style="color: #990099; font-weight: bold;">DROP</span> <span style="color: #990099; font-weight: bold;">TABLE</span> <span style="color: #009900;">IF</span> <span style="color: #990099; font-weight: bold;">EXISTS</span> b<span style="color: #000033;">;</span>
<span style="color: #990099; font-weight: bold;">DROP</span> <span style="color: #990099; font-weight: bold;">TABLE</span> <span style="color: #009900;">IF</span> <span style="color: #990099; font-weight: bold;">EXISTS</span> c<span style="color: #000033;">;</span>
&nbsp;
<span style="color: #990099; font-weight: bold;">CREATE</span> <span style="color: #990099; font-weight: bold;">TABLE</span> a <span style="color: #FF00FF;">&#40;</span> a <span style="color: #999900; font-weight: bold;">INT</span> <span style="color: #FF00FF;">&#41;</span><span style="color: #000033;">;</span>
<span style="color: #990099; font-weight: bold;">CREATE</span> <span style="color: #990099; font-weight: bold;">TABLE</span> b <span style="color: #FF00FF;">&#40;</span> b <span style="color: #999900; font-weight: bold;">INT</span> <span style="color: #FF00FF;">&#41;</span><span style="color: #000033;">;</span>
<span style="color: #990099; font-weight: bold;">CREATE</span> <span style="color: #990099; font-weight: bold;">TABLE</span> c <span style="color: #FF00FF;">&#40;</span> c <span style="color: #999900; font-weight: bold;">INT</span> <span style="color: #FF00FF;">&#41;</span><span style="color: #000033;">;</span>
&nbsp;
<span style="color: #990099; font-weight: bold;">SELECT</span> a.a <span style="color: #990099; font-weight: bold;">FROM</span> a <span style="color: #000099;">LEFT</span> <span style="color: #990099; font-weight: bold;">JOIN</span> c <span style="color: #990099; font-weight: bold;">ON</span> c.c <span style="color: #CC0099;">=</span> a.a<span style="color: #000033;">;</span> <span style="color: #808080; font-style: italic;">-- Q1</span>
<span style="color: #990099; font-weight: bold;">SELECT</span> a.a <span style="color: #990099; font-weight: bold;">FROM</span> a<span style="color: #000033;">,</span> b <span style="color: #000099;">LEFT</span> <span style="color: #990099; font-weight: bold;">JOIN</span> c <span style="color: #990099; font-weight: bold;">ON</span> c.c <span style="color: #CC0099;">=</span> a.a<span style="color: #000033;">;</span> <span style="color: #808080; font-style: italic;">-- Q2</span></pre></div></div>
<p>Q1 and Q2 will produce the same result, right? Wrong! As of MySQL 5.0.12, per the SQL standard, JOIN has had higher precedence than comma &#8216;,&#8217;.</p>
<p>So, you get the following:</p>
<div class="wp_syntax"><div class="code"><pre class="mysql" style="font-family:monospace;">mysql<span style="color: #CC0099;">&gt;</span> <span style="color: #990099; font-weight: bold;">SELECT</span> a.a <span style="color: #990099; font-weight: bold;">FROM</span> a <span style="color: #000099;">LEFT</span> <span style="color: #990099; font-weight: bold;">JOIN</span> c <span style="color: #990099; font-weight: bold;">ON</span> c.c <span style="color: #CC0099;">=</span> a.a<span style="color: #000033;">;</span>
Empty <span style="color: #990099; font-weight: bold;">set</span> <span style="color: #FF00FF;">&#40;</span><span style="color: #008080;">0.00</span> sec<span style="color: #FF00FF;">&#41;</span>
&nbsp;
mysql<span style="color: #CC0099;">&gt;</span> <span style="color: #990099; font-weight: bold;">SELECT</span> a.a <span style="color: #990099; font-weight: bold;">FROM</span> a<span style="color: #000033;">,</span> b <span style="color: #000099;">LEFT</span> <span style="color: #990099; font-weight: bold;">JOIN</span> c <span style="color: #990099; font-weight: bold;">ON</span> c.c <span style="color: #CC0099;">=</span> a.a<span style="color: #000033;">;</span>
ERROR <span style="color: #008080;">1054</span> <span style="color: #FF00FF;">&#40;</span>42S22<span style="color: #FF00FF;">&#41;</span>: Unknown <span style="color: #990099; font-weight: bold;">column</span> <span style="color: #008000;">'a.a'</span> <span style="color: #990099; font-weight: bold;">in</span> <span style="color: #008000;">'on clause'</span></pre></div></div>
<p>This is because, in earlier versions, MySQL interpreted it as ( ( a, b ) LEFT JOIN c ). Now, it interprets this syntax as ( a, ( b LEFT JOIN c ) ). If you run into this problem, the fix is easy. You simply need to add brackets around the table list:</p>
<div class="wp_syntax"><div class="code"><pre class="mysql" style="font-family:monospace;">mysql<span style="color: #CC0099;">&gt;</span> <span style="color: #990099; font-weight: bold;">SELECT</span> a.a <span style="color: #990099; font-weight: bold;">FROM</span> <span style="color: #FF00FF;">&#40;</span>a<span style="color: #000033;">,</span> b<span style="color: #FF00FF;">&#41;</span> <span style="color: #000099;">LEFT</span> <span style="color: #990099; font-weight: bold;">JOIN</span> c <span style="color: #990099; font-weight: bold;">ON</span> c.c <span style="color: #CC0099;">=</span> a.a<span style="color: #000033;">;</span>
Empty <span style="color: #990099; font-weight: bold;">set</span> <span style="color: #FF00FF;">&#40;</span><span style="color: #008080;">0.00</span> sec<span style="color: #FF00FF;">&#41;</span></pre></div></div>
<p>You can read more about this in the <a title="MySQL Reference Manual: JOIN Syntax" href="http://dev.mysql.com/doc/refman/5.0/en/join.html">MySQL Documentation</a>, from the section starting with &#8220;Previously, the comma&#8221;.</p>
]]></content:encoded>
			<wfw:commentRss>http://pento.net/2009/04/03/join-and-comma-precedence/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Tools of a Support Engineer</title>
		<link>http://pento.net/2009/03/26/tools-of-a-support-engineer/</link>
		<comments>http://pento.net/2009/03/26/tools-of-a-support-engineer/#comments</comments>
		<pubDate>Thu, 26 Mar 2009 04:03:16 +0000</pubDate>
		<dc:creator>Gary Pendergast</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[MySQL Sandbox]]></category>
		<category><![CDATA[support]]></category>
		<guid isPermaLink="false">http://pento.net/?p=146</guid>
		<description><![CDATA[So, you&#8217;ve emailed MySQL Support, they&#8217;re working on the problem you&#8217;re having. How are they working? What tools do they use? Well, here&#8217;s my list: IRC &#8211; All MySQL Support Engineers work on IRC, it&#8217;s our main communication medium. While you&#8217;re only getting emails from one Engineer, it&#8217;s quite likely they&#8217;re consulting with several others [...]]]></description>
			<content:encoded><![CDATA[<p>So, you&#8217;ve emailed MySQL Support, they&#8217;re working on the problem you&#8217;re having. How are they working? What tools do they use? Well, here&#8217;s my list:</p>
<ul>
<li><strong>IRC</strong> &#8211; All MySQL Support Engineers work on IRC, it&#8217;s our main communication medium. While you&#8217;re only getting emails from one Engineer, it&#8217;s quite likely they&#8217;re consulting with several others at the same time. Many pairs of eyes catch all of the details.</li>
<li><strong>MySQL Docs, Changelogs, Knowledge Base, </strong><strong>Google, etc</strong> &#8211; There&#8217;s a lot of information out there, far too much for any one person to keep in their head at once. So, we have extensive documentation that everyone can access, plus the Knowledge Base available to customers. Also, given that MySQL is a very open project, we have plenty of community members who write about their experiences.</li>
<li><strong>MySQL Sandbox</strong> (<a title="MySQL Sandbox homepage" href="https://launchpad.net/mysql-sandbox">Link</a>) &#8211; If you&#8217;re having a problem with a specific version of MySQL, we need to be able to reproduce it. Sandbox is by far the easiest way to create, modify and maintain test environments.</li>
<li><strong>Virtual Machines</strong> &#8211; Similarly, if you&#8217;re having a problem with a specific OS, we can usually reproduce it in a VM. I prefer <a href="http://www.virtualbox.org/">VirtualBox</a> for this, though there are many options.</li>
<li><strong>gdb</strong> &#8211; Crashes often mean core files, and gdb makes them easy to debug. Remember that if you do want to do your own debugging in gdb, you will need a copy of the mysqld binary that generated the core file.</li>
<li><strong>Test Servers</strong> &#8211; We also have a big ol&#8217; pile of servers we use for testing various setups, if it is required.</li>
</ul>
<p>And that&#8217;s about it. Personally, I like to keep my environment simple but flexible.</p>
]]></content:encoded>
			<wfw:commentRss>http://pento.net/2009/03/26/tools-of-a-support-engineer/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic page generated in 1.020 seconds. -->
<!-- Cached page generated by WP-Super-Cache on 2010-09-09 04:10:10 -->
