<?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: Do we need sql_mode?</title>
	<atom:link href="http://code.openark.org/blog/mysql/do-we-need-sql_mode/feed" rel="self" type="application/rss+xml" />
	<link>http://code.openark.org/blog/mysql/do-we-need-sql_mode</link>
	<description>Blog by Shlomi Noach</description>
	<lastBuildDate>Sat, 13 Mar 2010 09:46:07 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: code.openark.org &#187; Blog Archive &#187; MySQL security: data integrity issues</title>
		<link>http://code.openark.org/blog/mysql/do-we-need-sql_mode/comment-page-1#comment-380</link>
		<dc:creator>code.openark.org &#187; Blog Archive &#187; MySQL security: data integrity issues</dc:creator>
		<pubDate>Wed, 21 Jan 2009 10:32:53 +0000</pubDate>
		<guid isPermaLink="false">http://code.openark.org/blog/?p=462#comment-380</guid>
		<description>[...] my earlier posts here and here. Roland Bouman also offers suggestions for fixing this [...]</description>
		<content:encoded><![CDATA[<p>[...] my earlier posts here and here. Roland Bouman also offers suggestions for fixing this [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: shlomi</title>
		<link>http://code.openark.org/blog/mysql/do-we-need-sql_mode/comment-page-1#comment-295</link>
		<dc:creator>shlomi</dc:creator>
		<pubDate>Mon, 12 Jan 2009 15:24:47 +0000</pubDate>
		<guid isPermaLink="false">http://code.openark.org/blog/?p=462#comment-295</guid>
		<description>More discussion is available on &lt;a href=&quot;http://rpbouman.blogspot.com/&quot; rel=&quot;nofollow&quot;&gt;Roland Bouman&lt;/a&gt;&#039;s &lt;a href=&quot;http://rpbouman.blogspot.com/2009/01/mysqls-sqlmode-my-suggestions.html&quot; rel=&quot;nofollow&quot;&gt;post&lt;/a&gt;.</description>
		<content:encoded><![CDATA[<p>More discussion is available on <a href="http://rpbouman.blogspot.com/" rel="nofollow">Roland Bouman</a>&#8217;s <a href="http://rpbouman.blogspot.com/2009/01/mysqls-sqlmode-my-suggestions.html" rel="nofollow">post</a>.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lukas</title>
		<link>http://code.openark.org/blog/mysql/do-we-need-sql_mode/comment-page-1#comment-294</link>
		<dc:creator>Lukas</dc:creator>
		<pubDate>Mon, 12 Jan 2009 12:53:46 +0000</pubDate>
		<guid isPermaLink="false">http://code.openark.org/blog/?p=462#comment-294</guid>
		<description>Developer centric means you are looking after the worries of someone that writes the application. DBA centric is about who manages the data and who gets a call when the database goes up in smoke.</description>
		<content:encoded><![CDATA[<p>Developer centric means you are looking after the worries of someone that writes the application. DBA centric is about who manages the data and who gets a call when the database goes up in smoke.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Roland Bouman</title>
		<link>http://code.openark.org/blog/mysql/do-we-need-sql_mode/comment-page-1#comment-291</link>
		<dc:creator>Roland Bouman</dc:creator>
		<pubDate>Mon, 12 Jan 2009 08:21:57 +0000</pubDate>
		<guid isPermaLink="false">http://code.openark.org/blog/?p=462#comment-291</guid>
		<description>Hi Lukas!

I am not sure what you mean by a developer perspective. My point is that it depends on the application whether things like zero dates and zero in dates are permissable. 

I agree the case where multiple database users access the same tables is a problem. 

I am sure you are aware that for stored procedures, views and events the sql_mode that was in effect at DDL time is stored together with the definitions of these object. At runtime, that sql_mode is applied in order to allow the code to run predictably. 

Well, this always made me wonder....why should tables and triggers be excluded from this? Logically it seems to be in the same league, but I suspect it cannot be implemented in an efficient way for tables.

regards,
Roland</description>
		<content:encoded><![CDATA[<p>Hi Lukas!</p>
<p>I am not sure what you mean by a developer perspective. My point is that it depends on the application whether things like zero dates and zero in dates are permissable. </p>
<p>I agree the case where multiple database users access the same tables is a problem. </p>
<p>I am sure you are aware that for stored procedures, views and events the sql_mode that was in effect at DDL time is stored together with the definitions of these object. At runtime, that sql_mode is applied in order to allow the code to run predictably. </p>
<p>Well, this always made me wonder&#8230;.why should tables and triggers be excluded from this? Logically it seems to be in the same league, but I suspect it cannot be implemented in an efficient way for tables.</p>
<p>regards,<br />
Roland</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lukas</title>
		<link>http://code.openark.org/blog/mysql/do-we-need-sql_mode/comment-page-1#comment-287</link>
		<dc:creator>Lukas</dc:creator>
		<pubDate>Sun, 11 Jan 2009 21:20:17 +0000</pubDate>
		<guid isPermaLink="false">http://code.openark.org/blog/?p=462#comment-287</guid>
		<description>Roland .. that is a very developer centric view (rather than DBA) .. however what happens when you have two apps messing with the same data? I think for the good of MySQL users, people should be pushed towards the strict sql compliance mode and only if they beg their DBA&#039;s they can get an instance with the legacy BC crap.</description>
		<content:encoded><![CDATA[<p>Roland .. that is a very developer centric view (rather than DBA) .. however what happens when you have two apps messing with the same data? I think for the good of MySQL users, people should be pushed towards the strict sql compliance mode and only if they beg their DBA&#8217;s they can get an instance with the legacy BC crap.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: code.openark.org &#187; Blog Archive &#187; sql_mode: a suggestion</title>
		<link>http://code.openark.org/blog/mysql/do-we-need-sql_mode/comment-page-1#comment-285</link>
		<dc:creator>code.openark.org &#187; Blog Archive &#187; sql_mode: a suggestion</dc:creator>
		<pubDate>Sun, 11 Jan 2009 16:09:21 +0000</pubDate>
		<guid isPermaLink="false">http://code.openark.org/blog/?p=462#comment-285</guid>
		<description>[...] thought this deserves more than a comment on my previous post on the subject, in which I expressed the opinion that sql_mode is [...]</description>
		<content:encoded><![CDATA[<p>[...] thought this deserves more than a comment on my previous post on the subject, in which I expressed the opinion that sql_mode is [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Roland Bouman</title>
		<link>http://code.openark.org/blog/mysql/do-we-need-sql_mode/comment-page-1#comment-284</link>
		<dc:creator>Roland Bouman</dc:creator>
		<pubDate>Sun, 11 Jan 2009 15:43:20 +0000</pubDate>
		<guid isPermaLink="false">http://code.openark.org/blog/?p=462#comment-284</guid>
		<description>Hi All!

@Schlomi: sure, feel free to quote me. (I guess it would be best to include a link to this comment thread so ppl can verify real quick who said what, but this is just a suggestion)

Actually, what I meant was container privileges like: 

GRANT SET [SESSION&#124;GLOBAL] SQL_MODE TO user[@host]

But your suggestion gave me the idea that it would in addition be nice to do:

CREATE USER user[@host] IDENTIFIED BY &#039;pasword&#039; 
DEFAULT SQL_MODE = &#039;....&#039;;

(and this would assign the default sql_mode on connect)

As for sql_mode not having to exist at all - well, that would be for the best. But it is not going to happen - not with MySQL. Things are as they are because they evolved that way. Backwards compatibility is being considered by the MySQL dev

@Lukas: I don&#039;t need to support legacy apps. Or well, I do, but this was not what I was thinking about. I like to try out lots of these php apps like wordpress, joomla, drupal, dotProject etc. whatever I feel like I might need at some point. I find that in many, many cases, the installers of these apps break on my perhaps mysql-wise unorthodox settings. I suppose I could have a completely default MySQL installation on the side, but my stance remains that, given the current state of MySQL, it should be on the application to ensure the right SQL_MODE is set right after connecting to the database server. 

I have written about  a few of my experiences in this regard here:

http://rpbouman.blogspot.com/2007/04/so-wordpress-does-not-like-mysql-sql.html
http://rpbouman.blogspot.com/2007/04/guess-whatwordpress-does-not-like.html

I have also filed a dotProject bug relating to this, and this was solved (Kudos to Adam Donnison!)

http://bugs.dotproject.net/view.php?id=2323</description>
		<content:encoded><![CDATA[<p>Hi All!</p>
<p>@Schlomi: sure, feel free to quote me. (I guess it would be best to include a link to this comment thread so ppl can verify real quick who said what, but this is just a suggestion)</p>
<p>Actually, what I meant was container privileges like: </p>
<p>GRANT SET [SESSION|GLOBAL] SQL_MODE TO user[@host]</p>
<p>But your suggestion gave me the idea that it would in addition be nice to do:</p>
<p>CREATE USER user[@host] IDENTIFIED BY &#8216;pasword&#8217;<br />
DEFAULT SQL_MODE = &#8216;&#8230;.&#8217;;</p>
<p>(and this would assign the default sql_mode on connect)</p>
<p>As for sql_mode not having to exist at all &#8211; well, that would be for the best. But it is not going to happen &#8211; not with MySQL. Things are as they are because they evolved that way. Backwards compatibility is being considered by the MySQL dev</p>
<p>@Lukas: I don&#8217;t need to support legacy apps. Or well, I do, but this was not what I was thinking about. I like to try out lots of these php apps like wordpress, joomla, drupal, dotProject etc. whatever I feel like I might need at some point. I find that in many, many cases, the installers of these apps break on my perhaps mysql-wise unorthodox settings. I suppose I could have a completely default MySQL installation on the side, but my stance remains that, given the current state of MySQL, it should be on the application to ensure the right SQL_MODE is set right after connecting to the database server. </p>
<p>I have written about  a few of my experiences in this regard here:</p>
<p><a href="http://rpbouman.blogspot.com/2007/04/so-wordpress-does-not-like-mysql-sql.html" rel="nofollow">http://rpbouman.blogspot.com/2007/04/so-wordpress-does-not-like-mysql-sql.html</a><br />
<a href="http://rpbouman.blogspot.com/2007/04/guess-whatwordpress-does-not-like.html" rel="nofollow">http://rpbouman.blogspot.com/2007/04/guess-whatwordpress-does-not-like.html</a></p>
<p>I have also filed a dotProject bug relating to this, and this was solved (Kudos to Adam Donnison!)</p>
<p><a href="http://bugs.dotproject.net/view.php?id=2323" rel="nofollow">http://bugs.dotproject.net/view.php?id=2323</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lukas</title>
		<link>http://code.openark.org/blog/mysql/do-we-need-sql_mode/comment-page-1#comment-272</link>
		<dc:creator>Lukas</dc:creator>
		<pubDate>Sat, 10 Jan 2009 16:33:35 +0000</pubDate>
		<guid isPermaLink="false">http://code.openark.org/blog/?p=462#comment-272</guid>
		<description>Roland: if you need to support legacy apps, why not offer them a separate server instance? I think this is the cleaner approach.</description>
		<content:encoded><![CDATA[<p>Roland: if you need to support legacy apps, why not offer them a separate server instance? I think this is the cleaner approach.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: shlomi</title>
		<link>http://code.openark.org/blog/mysql/do-we-need-sql_mode/comment-page-1#comment-270</link>
		<dc:creator>shlomi</dc:creator>
		<pubDate>Sat, 10 Jan 2009 09:17:33 +0000</pubDate>
		<guid isPermaLink="false">http://code.openark.org/blog/?p=462#comment-270</guid>
		<description>Hi Roland,

I see your point. If I understand your intention, though, you&#039;re referring to a completely new set of privileges, integrated into the privileges system.
That in itself is just fine. In my opinion, though, sql_mode must still not exist.
So for being able to set zero for dates you would 
GRANT ZERO_ON_DATE ON world.* TO &#039;someuser&#039;@&#039;somehost&#039;
But that user should *not* be able to 
SET sql_mode=&#039;ZERO_ON_DATE&#039;
How does that sound?

With your permission, I would like to quote you on a post I&#039;m writing on the subject.

Regards,
Shlomi</description>
		<content:encoded><![CDATA[<p>Hi Roland,</p>
<p>I see your point. If I understand your intention, though, you&#8217;re referring to a completely new set of privileges, integrated into the privileges system.<br />
That in itself is just fine. In my opinion, though, sql_mode must still not exist.<br />
So for being able to set zero for dates you would<br />
GRANT ZERO_ON_DATE ON world.* TO &#8217;someuser&#8217;@&#8217;somehost&#8217;<br />
But that user should *not* be able to<br />
SET sql_mode=&#8217;ZERO_ON_DATE&#8217;<br />
How does that sound?</p>
<p>With your permission, I would like to quote you on a post I&#8217;m writing on the subject.</p>
<p>Regards,<br />
Shlomi</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Roland Bouman</title>
		<link>http://code.openark.org/blog/mysql/do-we-need-sql_mode/comment-page-1#comment-267</link>
		<dc:creator>Roland Bouman</dc:creator>
		<pubDate>Fri, 09 Jan 2009 20:19:03 +0000</pubDate>
		<guid isPermaLink="false">http://code.openark.org/blog/?p=462#comment-267</guid>
		<description>&quot;The other users cannot benefit from a strict mode if any user can choose to ignore the strict mode.&quot;

sure they can, provided they can&#039;t acces each others schemas. I still don&#039;t see any issue with mixing modes provided different schemas are used in isolation, which is effectively achieved by issuing proper object/schema privileges

Another point is that the sqlmode also contains a number of things that have nothing todo with &quot;strictness&quot;, such as the PIPES_AS_CONCAT you mentioned (other examples are ignore space, double quotes for identifiers and a bunch more).

regards,

Roland</description>
		<content:encoded><![CDATA[<p>&#8220;The other users cannot benefit from a strict mode if any user can choose to ignore the strict mode.&#8221;</p>
<p>sure they can, provided they can&#8217;t acces each others schemas. I still don&#8217;t see any issue with mixing modes provided different schemas are used in isolation, which is effectively achieved by issuing proper object/schema privileges</p>
<p>Another point is that the sqlmode also contains a number of things that have nothing todo with &#8220;strictness&#8221;, such as the PIPES_AS_CONCAT you mentioned (other examples are ignore space, double quotes for identifiers and a bunch more).</p>
<p>regards,</p>
<p>Roland</p>
]]></content:encoded>
	</item>
</channel>
</rss>
