<?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>blog.joaomorais.com &#187; MySQL</title>
	<atom:link href="http://blog.joaomorais.com/tag/mysql/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.joaomorais.com</link>
	<description>Blog about software development, personal projects and development tools.</description>
	<lastBuildDate>Mon, 10 Apr 2017 02:26:40 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>UTF-8 + PHP = Headache?</title>
		<link>http://blog.joaomorais.com/utf-8-php-headache/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=utf-8-php-headache</link>
		<comments>http://blog.joaomorais.com/utf-8-php-headache/#comments</comments>
		<pubDate>Sun, 12 Oct 2008 09:55:43 +0000</pubDate>
		<dc:creator>João Morais</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Unicode]]></category>
		<category><![CDATA[UTF-8]]></category>

		<guid isPermaLink="false">http://solidlocker.webhs.org/wordpress/?p=72</guid>
		<description><![CDATA[As some of you know PHP doesn&#8217;t handle UTF-8 by default and that could lead to a terrible headache, at least till version 6 cames out. Today I&#8217;ve spent some time looking for good articles on this subject. I&#8217;ve found two great articles that cover a lot of topics including strategies to use while working [...]]]></description>
				<content:encoded><![CDATA[<p>As some of you know <a title="PHP Official Web Site" href="http://www.php.net">PHP</a> doesn&#8217;t handle <a title="UTF-8 and Unicode Standards" href="http://www.utf-8.com/">UTF-8</a> by default and that could lead to a terrible headache, at least till <a title="PHP 6 and What to Expect" href="http://it.slashdot.org/comments.pl?sid=180127&amp;cid=14914160">version 6</a> cames out.</p>
<p>Today I&#8217;ve spent some time looking for good articles on this subject. I&#8217;ve found two great articles that cover a lot of topics including strategies to use while working with <a title="MySQL Official Web Site" href="http://www.mysql.com">MySQL</a>:</p>
<p><a title="Handling UTF-8 with PHP" href="http://www.phpwact.org/php/i18n/utf-8">Handling UTF-8 with PHP</a><br />
<a title="Scripters UTF-8 Survival Guide" href="http://www.sitepoint.com/blogs/2006/08/09/scripters-utf-8-survival-guide-slides/">Scripters UTF-8 Survival Guide</a></p>
<p>You can download the second one in PDF format and read it later.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.joaomorais.com/utf-8-php-headache/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SQL Column Truncation Vulnerabilities</title>
		<link>http://blog.joaomorais.com/sql-column-truncation-vulnerabilities/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=sql-column-truncation-vulnerabilities</link>
		<comments>http://blog.joaomorais.com/sql-column-truncation-vulnerabilities/#comments</comments>
		<pubDate>Sat, 20 Sep 2008 11:24:49 +0000</pubDate>
		<dc:creator>João Morais</dc:creator>
				<category><![CDATA[Papers]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[Truncation]]></category>
		<category><![CDATA[Vulnerabilities]]></category>

		<guid isPermaLink="false">http://solidlocker.webhs.org/wordpress/?p=63</guid>
		<description><![CDATA[One of the biggest concerns for Web Developers while developing something with SQL, is to avoid SQL-Injection problems, because those are the most common security flaws. But there are also another flaws that you should be aware about, for example, column truncation vulnerabilities. This security flaw it&#8217;s related with the lack of input length validations [...]]]></description>
				<content:encoded><![CDATA[<p>One of the biggest concerns for Web Developers while developing something with SQL, is to avoid <a title="SQL-Injection" href="http://en.wikipedia.org/wiki/SQL_injection">SQL-Injection</a> problems, because those are the most common security flaws.</p>
<p>But there are also another flaws that you should be aware about, for example, column truncation vulnerabilities.</p>
<p>This security flaw it&#8217;s related with the lack of input length validations and it seems that it is affecting a lot of known applications.</p>
<p>Stefan Esser wrote a great <a title="MySQL and SQL Column Truncation Vulnerabilities" href="http://www.suspekt.org/2008/08/18/mysql-and-sql-column-truncation-vulnerabilities/">tutorial</a> about this subject it&#8217;s a must read.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.joaomorais.com/sql-column-truncation-vulnerabilities/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL bug related with natural number order fix</title>
		<link>http://blog.joaomorais.com/mysql-bug-related-with-natural-number-order-fix/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=mysql-bug-related-with-natural-number-order-fix</link>
		<comments>http://blog.joaomorais.com/mysql-bug-related-with-natural-number-order-fix/#comments</comments>
		<pubDate>Fri, 18 Jul 2008 11:11:21 +0000</pubDate>
		<dc:creator>João Morais</dc:creator>
				<category><![CDATA[Papers]]></category>
		<category><![CDATA[Bug]]></category>
		<category><![CDATA[Fix]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Number]]></category>
		<category><![CDATA[Order]]></category>

		<guid isPermaLink="false">http://solidlocker.webhs.org/wordpress/?p=161</guid>
		<description><![CDATA[It seems that this is a known bug but I only noticed it yesterday. Imagine you have a field named price and it&#8217;s type is VARCHAR (it doesn&#8217;t matter why it&#8217;s not INT or FLOAT) and you want to use ORDER BY clause so you can list table rows ordered by price value. It won&#8217;t [...]]]></description>
				<content:encoded><![CDATA[<p>It seems that this is a known bug but I only noticed it yesterday.</p>
<p>Imagine you have a field named price and it&#8217;s type is VARCHAR (it doesn&#8217;t matter why it&#8217;s not INT or FLOAT) and you want to use ORDER BY clause so you can list table rows ordered by price value.</p>
<p>It won&#8217;t work, since the prices will be listed alphabetically, you may read here how to fix this issue.</p>
<p><span id="more-161"></span>If you have a table labeled products, a field labeled price (typed as VARCHAR) and the following values: 1, 2, 3, 7, 8, 53, 47, 32, 99 and 327.</p>
<p>And you perform a query similar to the one below:</p>
<pre class="brush:sql">SELECT price FROM products ORDER BY price;</pre>
<p>The result will be:</p>
<pre class="brush:plain">1, 2, 3, 32, 327,47, 53, 7, 8, 99</pre>
<p>As you can see the product prices are ordered alphabetically to fix this you should add + 0 to the query (see example below):</p>
<pre class="brush:sql">SELECT price FROM products ORDER BY price + 0;</pre>
<p>The result will be:</p>
<pre class="brush:plain">1, 2, 3, 7, 8, 32, 47, 53, 99, 327</pre>
<p>Problem solved, now your rows will be sorted by price correctly.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.joaomorais.com/mysql-bug-related-with-natural-number-order-fix/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
