<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/'><id>tag:blogger.com,1999:blog-20434908.post5634579591190328024..comments</id><updated>2008-02-23T17:13:20.808+02:00</updated><title type='text'>Comments on Rational Relational: MySQL T-SQL CASE Statement: Bad Language Design</title><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://blog.shlomoid.com/feeds/5634579591190328024/comments/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20434908/5634579591190328024/comments/default'/><link rel='alternate' type='text/html' href='http://blog.shlomoid.com/2007/12/mysql-t-sql-case-statement-bad-language.html'/><author><name>Shlomo Priymak</name><uri>http://www.blogger.com/profile/08509735030020026930</uri><email>noreply@blogger.com</email></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>5</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-20434908.post-5227405382612753549</id><published>2008-02-23T17:13:20.808+02:00</published><updated>2008-02-23T17:13:20.808+02:00</updated><title type='text'>Roland:Thanks :)Very interesting! I didn't know it...</title><content type='html'>Roland:&lt;BR/&gt;Thanks :)&lt;BR/&gt;&lt;BR/&gt;Very interesting! I didn't know it was defined in this way in the SQL Standard... Good to know.&lt;BR/&gt;&lt;BR/&gt;Probably the standard designers believe you shouldn't be able to "fall through" the case statement, since T-SQL is more sensitive than C when it comes to small programming mistakes - and things should be stricter.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20434908/5634579591190328024/comments/default/5227405382612753549'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20434908/5634579591190328024/comments/default/5227405382612753549'/><link rel='alternate' type='text/html' href='http://blog.shlomoid.com/2007/12/mysql-t-sql-case-statement-bad-language.html?showComment=1203779600808#c5227405382612753549' title=''/><author><name>Shlomo Priymak</name><uri>http://www.blogger.com/profile/08509735030020026930</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='14670563893292506590'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.shlomoid.com/2007/12/mysql-t-sql-case-statement-bad-language.html' ref='tag:blogger.com,1999:blog-20434908.post-5634579591190328024' source='http://www.blogger.com/feeds/20434908/posts/default/5634579591190328024' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-20434908.post-1443304034865497003</id><published>2008-02-22T03:00:42.963+02:00</published><updated>2008-02-22T03:00:42.963+02:00</updated><title type='text'>Hi!welcome to the planet!!!I filed the bug you are...</title><content type='html'>Hi!&lt;BR/&gt;&lt;BR/&gt;welcome to the planet!!!&lt;BR/&gt;&lt;BR/&gt;I filed the bug you are referring to. &lt;BR/&gt;&lt;BR/&gt;Personally, I don't find it "bad" language design - it is actually pretty good to be informed that a condition was not anticipated (another thing I like about CASE is that it does'nt "fall through like the switch statement in C, java, PHP etc). &lt;BR/&gt;&lt;BR/&gt;On another level, MySQL's behavior here is exactly as defined in the standard (ISO/IEC 9075-4:2003 (E), 13.6 case statement, page 103):&lt;BR/&gt;&lt;BR/&gt;"c) Otherwise, an exception condition is raised: case not found for case statement, and the execution of&lt;BR/&gt;   the &amp;lt;case statement&amp;gt; is terminated immediately."&lt;BR/&gt;&lt;BR/&gt;So IMO, it can't do better here. What remains is the clunky syntax to suppress the error. It would probably be ugly no matter what noop construct would be available.&lt;BR/&gt;&lt;BR/&gt;;)&lt;BR/&gt;&lt;BR/&gt;Roland Bouman</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20434908/5634579591190328024/comments/default/1443304034865497003'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20434908/5634579591190328024/comments/default/1443304034865497003'/><link rel='alternate' type='text/html' href='http://blog.shlomoid.com/2007/12/mysql-t-sql-case-statement-bad-language.html?showComment=1203642042963#c1443304034865497003' title=''/><author><name>Roland Bouman</name><uri>http://www.blogger.com/profile/13365137747952711328</uri><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.shlomoid.com/2007/12/mysql-t-sql-case-statement-bad-language.html' ref='tag:blogger.com,1999:blog-20434908.post-5634579591190328024' source='http://www.blogger.com/feeds/20434908/posts/default/5634579591190328024' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-20434908.post-1811005223060356002</id><published>2007-12-20T17:26:55.438+02:00</published><updated>2007-12-20T17:26:55.438+02:00</updated><title type='text'>right.:)</title><content type='html'>right.&lt;BR/&gt;:)</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20434908/5634579591190328024/comments/default/1811005223060356002'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20434908/5634579591190328024/comments/default/1811005223060356002'/><link rel='alternate' type='text/html' href='http://blog.shlomoid.com/2007/12/mysql-t-sql-case-statement-bad-language.html?showComment=1198164415438#c1811005223060356002' title=''/><author><name>Rijik</name><uri>http://www.blogger.com/profile/03312587984242487322</uri><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.shlomoid.com/2007/12/mysql-t-sql-case-statement-bad-language.html' ref='tag:blogger.com,1999:blog-20434908.post-5634579591190328024' source='http://www.blogger.com/feeds/20434908/posts/default/5634579591190328024' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-20434908.post-1943529875512581818</id><published>2007-12-20T17:18:19.765+02:00</published><updated>2007-12-20T17:18:19.765+02:00</updated><title type='text'>WHEN 1=1 THEN CALL default(); Will catch all the q...</title><content type='html'>WHEN 1=1 THEN CALL default(); &lt;BR/&gt;&lt;BR/&gt;Will catch all the queries that don't fit any conditions, just what ELSE should do - so it is not the main point here. &lt;BR/&gt;&lt;BR/&gt;The empty statement you are looking for is this "BEGIN END;" that I mentioned. 1=1 is not a statement by itself.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20434908/5634579591190328024/comments/default/1943529875512581818'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20434908/5634579591190328024/comments/default/1943529875512581818'/><link rel='alternate' type='text/html' href='http://blog.shlomoid.com/2007/12/mysql-t-sql-case-statement-bad-language.html?showComment=1198163899765#c1943529875512581818' title=''/><author><name>Shlomo Priymak</name><uri>http://www.blogger.com/profile/08509735030020026930</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='14670563893292506590'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.shlomoid.com/2007/12/mysql-t-sql-case-statement-bad-language.html' ref='tag:blogger.com,1999:blog-20434908.post-5634579591190328024' source='http://www.blogger.com/feeds/20434908/posts/default/5634579591190328024' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-20434908.post-1980571742955351310</id><published>2007-12-20T16:51:19.818+02:00</published><updated>2007-12-20T16:51:19.818+02:00</updated><title type='text'>Can't it swallowSET @var = SELECT var FROM t;CASE ...</title><content type='html'>Can't it swallow&lt;BR/&gt;&lt;BR/&gt;SET @var = SELECT var FROM t;&lt;BR/&gt;CASE &lt;BR/&gt;  WHEN @var=1 THEN CALL do_something(); &lt;BR/&gt;  WHEN @var=2 THEN CALL do_something_else(); &lt;BR/&gt;  WHEN 1=1 THEN CALL default(); &lt;BR/&gt;END CASE;&lt;BR/&gt;&lt;BR/&gt;or maybe just do ELSE 1=1 or some kind of another empty statement&lt;BR/&gt;?</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20434908/5634579591190328024/comments/default/1980571742955351310'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20434908/5634579591190328024/comments/default/1980571742955351310'/><link rel='alternate' type='text/html' href='http://blog.shlomoid.com/2007/12/mysql-t-sql-case-statement-bad-language.html?showComment=1198162279818#c1980571742955351310' title=''/><author><name>Rijik</name><uri>http://www.blogger.com/profile/03312587984242487322</uri><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.shlomoid.com/2007/12/mysql-t-sql-case-statement-bad-language.html' ref='tag:blogger.com,1999:blog-20434908.post-5634579591190328024' source='http://www.blogger.com/feeds/20434908/posts/default/5634579591190328024' type='text/html'/></entry></feed>