<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: An SQL Puzzle?</title>
	<atom:link href="http://www.joinfu.com/2010/03/a-sql-puzzle/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.joinfu.com/2010/03/a-sql-puzzle/</link>
	<description>the art of sql</description>
	<lastBuildDate>Mon, 23 Jan 2012 21:05:00 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: PHP-help &#187; Log Buffer #182, a Carnival of the Vanities for DBAs</title>
		<link>http://www.joinfu.com/2010/03/a-sql-puzzle/comment-page-1/#comment-215306</link>
		<dc:creator>PHP-help &#187; Log Buffer #182, a Carnival of the Vanities for DBAs</dc:creator>
		<pubDate>Fri, 12 Mar 2010 22:48:20 +0000</pubDate>
		<guid isPermaLink="false">http://joinfu.com/2010/03/a-sql-puzzle#comment-215306</guid>
		<description>[...] now available. MySQL join-fu expert Jay Pipes has moved his blog to www.joinfu.com and starts with An SQL Puzzle and of course a follow up on the sql [...]</description>
		<content:encoded><![CDATA[<p>[...] now available. MySQL join-fu expert Jay Pipes has moved his blog to <a href="http://www.joinfu.com" rel="nofollow">http://www.joinfu.com</a> and starts with An SQL Puzzle and of course a follow up on the sql [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Øystein Grøvlen</title>
		<link>http://www.joinfu.com/2010/03/a-sql-puzzle/comment-page-1/#comment-215082</link>
		<dc:creator>Øystein Grøvlen</dc:creator>
		<pubDate>Tue, 09 Mar 2010 08:29:40 +0000</pubDate>
		<guid isPermaLink="false">http://joinfu.com/2010/03/a-sql-puzzle#comment-215082</guid>
		<description>Looks like you are using MyISAM, not InnoDb.</description>
		<content:encoded><![CDATA[<p>Looks like you are using MyISAM, not InnoDb.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: saurabh deshpande</title>
		<link>http://www.joinfu.com/2010/03/a-sql-puzzle/comment-page-1/#comment-215079</link>
		<dc:creator>saurabh deshpande</dc:creator>
		<pubDate>Tue, 09 Mar 2010 08:26:34 +0000</pubDate>
		<guid isPermaLink="false">http://joinfu.com/2010/03/a-sql-puzzle#comment-215079</guid>
		<description>well the result is 

100,100
1,1

even with the autocommit on or off the result is same.</description>
		<content:encoded><![CDATA[<p>well the result is </p>
<p>100,100<br />
1,1</p>
<p>even with the autocommit on or off the result is same.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Roland Bouman</title>
		<link>http://www.joinfu.com/2010/03/a-sql-puzzle/comment-page-1/#comment-215047</link>
		<dc:creator>Roland Bouman</dc:creator>
		<pubDate>Tue, 09 Mar 2010 08:07:46 +0000</pubDate>
		<guid isPermaLink="false">http://joinfu.com/2010/03/a-sql-puzzle#comment-215047</guid>
		<description>Completely agree about the CREATE TABLE...SELECT statement, I also agree about the outcome: one row: (100,100)

The fact that a statement is refused due to a constraint violation, does not mean the transaction should be rolled back. It should be up to the user to decide what to do with whatever happened before the violation. However, the statement that caused the violation should be refused wholly - not like MyISAM, where the rows up to the violation succeed, and the rest fails.</description>
		<content:encoded><![CDATA[<p>Completely agree about the CREATE TABLE&#8230;SELECT statement, I also agree about the outcome: one row: (100,100)</p>
<p>The fact that a statement is refused due to a constraint violation, does not mean the transaction should be rolled back. It should be up to the user to decide what to do with whatever happened before the violation. However, the statement that caused the violation should be refused wholly &#8211; not like MyISAM, where the rows up to the violation succeed, and the rest fails.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Øystein Grøvlen</title>
		<link>http://www.joinfu.com/2010/03/a-sql-puzzle/comment-page-1/#comment-214997</link>
		<dc:creator>Øystein Grøvlen</dc:creator>
		<pubDate>Tue, 09 Mar 2010 06:33:11 +0000</pubDate>
		<guid isPermaLink="false">http://joinfu.com/2010/03/a-sql-puzzle#comment-214997</guid>
		<description>Since you are asking about what the behavior _should_ be, I would say that it should _not_ produce the error that you think are correct.  In my opinion, if the table already exists, the select statement should not be executed.  The existing MySQL behavior makes things pretty messy, especially when views are involved (see MySQL bugs 47132 and 49494).

Given that, the select statement should give one row: (100, 100).</description>
		<content:encoded><![CDATA[<p>Since you are asking about what the behavior _should_ be, I would say that it should _not_ produce the error that you think are correct.  In my opinion, if the table already exists, the select statement should not be executed.  The existing MySQL behavior makes things pretty messy, especially when views are involved (see MySQL bugs 47132 and 49494).</p>
<p>Given that, the select statement should give one row: (100, 100).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jay Pipes</title>
		<link>http://www.joinfu.com/2010/03/a-sql-puzzle/comment-page-1/#comment-214911</link>
		<dc:creator>Jay Pipes</dc:creator>
		<pubDate>Tue, 09 Mar 2010 02:49:39 +0000</pubDate>
		<guid isPermaLink="false">http://joinfu.com/2010/03/a-sql-puzzle#comment-214911</guid>
		<description>LOL. Not yet! :)</description>
		<content:encoded><![CDATA[<p>LOL. Not yet! <img src='http://www.joinfu.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rob Wultsch</title>
		<link>http://www.joinfu.com/2010/03/a-sql-puzzle/comment-page-1/#comment-214877</link>
		<dc:creator>Rob Wultsch</dc:creator>
		<pubDate>Tue, 09 Mar 2010 00:51:38 +0000</pubDate>
		<guid isPermaLink="false">http://joinfu.com/2010/03/a-sql-puzzle#comment-214877</guid>
		<description>Note
CREATE TABLE does not automatically commit the current active transaction if you use the TEMPORARY keyword.
http://dev.mysql.com/doc/refman/5.1/en/create-table.html

Implicit commit is evil and stupid. Ideally we the server should error and roll back, imho.</description>
		<content:encoded><![CDATA[<p>Note<br />
CREATE TABLE does not automatically commit the current active transaction if you use the TEMPORARY keyword.<br />
<a href="http://dev.mysql.com/doc/refman/5.1/en/create-table.html" rel="nofollow">http://dev.mysql.com/doc/refman/5.1/en/create-table.html</a></p>
<p>Implicit commit is evil and stupid. Ideally we the server should error and roll back, imho.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Darius Jahandarie</title>
		<link>http://www.joinfu.com/2010/03/a-sql-puzzle/comment-page-1/#comment-214844</link>
		<dc:creator>Darius Jahandarie</dc:creator>
		<pubDate>Mon, 08 Mar 2010 23:35:32 +0000</pubDate>
		<guid isPermaLink="false">http://joinfu.com/2010/03/a-sql-puzzle#comment-214844</guid>
		<description>This can be prevented in drizzle with protos and atomic DDL statements, right? ;-)</description>
		<content:encoded><![CDATA[<p>This can be prevented in drizzle with protos and atomic DDL statements, right? <img src='http://www.joinfu.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jay R.</title>
		<link>http://www.joinfu.com/2010/03/a-sql-puzzle/comment-page-1/#comment-214806</link>
		<dc:creator>Jay R.</dc:creator>
		<pubDate>Mon, 08 Mar 2010 22:40:57 +0000</pubDate>
		<guid isPermaLink="false">http://joinfu.com/2010/03/a-sql-puzzle#comment-214806</guid>
		<description>Table modification statements automatically commit transactions, so the insert is committed before the temporary table is created.

Right?</description>
		<content:encoded><![CDATA[<p>Table modification statements automatically commit transactions, so the insert is committed before the temporary table is created.</p>
<p>Right?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Scott Noyes</title>
		<link>http://www.joinfu.com/2010/03/a-sql-puzzle/comment-page-1/#comment-214801</link>
		<dc:creator>Scott Noyes</dc:creator>
		<pubDate>Mon, 08 Mar 2010 21:47:13 +0000</pubDate>
		<guid isPermaLink="false">http://joinfu.com/2010/03/a-sql-puzzle#comment-214801</guid>
		<description>A duplicate key error will roll back the statement. Is the puzzle why it doesn&#039;t roll back the whole transaction, or why it even bothers to do the select given that the table already exists?</description>
		<content:encoded><![CDATA[<p>A duplicate key error will roll back the statement. Is the puzzle why it doesn&#8217;t roll back the whole transaction, or why it even bothers to do the select given that the table already exists?</p>
]]></content:encoded>
	</item>
</channel>
</rss>

