<?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: MySQL (errno: 150)</title>
	<atom:link href="http://www.danieltome.com/blog/2008/01/17/mysql-errno-150/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.danieltome.com/blog/2008/01/17/mysql-errno-150/</link>
	<description>Flash, PHP, Open Source, Actionscript, Australia and Argentina stuff.</description>
	<lastBuildDate>Wed, 30 Jun 2010 18:36:58 -0700</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Piers</title>
		<link>http://www.danieltome.com/blog/2008/01/17/mysql-errno-150/comment-page-1/#comment-45202</link>
		<dc:creator>Piers</dc:creator>
		<pubDate>Thu, 29 Jul 2010 16:41:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.danieltome.com/blog/2008/01/17/mysql-errno-150/#comment-45202</guid>
		<description>Bah! thanks for the tip... saved my sanity :)</description>
		<content:encoded><![CDATA[<p>Bah! thanks for the tip&#8230; saved my sanity <img src='http://www.danieltome.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Confuzed</title>
		<link>http://www.danieltome.com/blog/2008/01/17/mysql-errno-150/comment-page-1/#comment-41832</link>
		<dc:creator>Confuzed</dc:creator>
		<pubDate>Thu, 29 Jul 2010 01:43:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.danieltome.com/blog/2008/01/17/mysql-errno-150/#comment-41832</guid>
		<description>Andreas: it did. :)</description>
		<content:encoded><![CDATA[<p>Andreas: it did. <img src='http://www.danieltome.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andreas</title>
		<link>http://www.danieltome.com/blog/2008/01/17/mysql-errno-150/comment-page-1/#comment-41471</link>
		<dc:creator>Andreas</dc:creator>
		<pubDate>Thu, 29 Jul 2010 19:13:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.danieltome.com/blog/2008/01/17/mysql-errno-150/#comment-41471</guid>
		<description>Even though this is an old post, I would also like to add that I had the same error. My solution was that I changed the table to MyISAM instead of previously set innoDB. 

I have a slight memory that I&#039;ve read that innoDB dosen&#039;t support FK. Anyways, hope that this help someone!</description>
		<content:encoded><![CDATA[<p>Even though this is an old post, I would also like to add that I had the same error. My solution was that I changed the table to MyISAM instead of previously set innoDB. </p>
<p>I have a slight memory that I&#8217;ve read that innoDB dosen&#8217;t support FK. Anyways, hope that this help someone!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Giannis</title>
		<link>http://www.danieltome.com/blog/2008/01/17/mysql-errno-150/comment-page-1/#comment-40980</link>
		<dc:creator>Giannis</dc:creator>
		<pubDate>Thu, 29 Jul 2010 06:26:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.danieltome.com/blog/2008/01/17/mysql-errno-150/#comment-40980</guid>
		<description>Thanks!
that was really helpfull!</description>
		<content:encoded><![CDATA[<p>Thanks!<br />
that was really helpfull!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Liam O'Boyle</title>
		<link>http://www.danieltome.com/blog/2008/01/17/mysql-errno-150/comment-page-1/#comment-27503</link>
		<dc:creator>Liam O'Boyle</dc:creator>
		<pubDate>Thu, 29 Jul 2010 14:29:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.danieltome.com/blog/2008/01/17/mysql-errno-150/#comment-27503</guid>
		<description>I found another case where the same error occurs.  If the foreign key is not nullable, then this error is thrown if you try to set the foreign key constraint to ON DELETE SET NULL.

e.g, using the above example

ALTER TABLE vik_energy MODIFY COLUMN energy_id energy_id INT NOT NULL;

ALTER TABLE vik ADD FOREIGN KEY(energy_id) REFERENCES vik_energy(energy_id) ON DELETE SET NOT NULL;</description>
		<content:encoded><![CDATA[<p>I found another case where the same error occurs.  If the foreign key is not nullable, then this error is thrown if you try to set the foreign key constraint to ON DELETE SET NULL.</p>
<p>e.g, using the above example</p>
<p>ALTER TABLE vik_energy MODIFY COLUMN energy_id energy_id INT NOT NULL;</p>
<p>ALTER TABLE vik ADD FOREIGN KEY(energy_id) REFERENCES vik_energy(energy_id) ON DELETE SET NOT NULL;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: D Miller</title>
		<link>http://www.danieltome.com/blog/2008/01/17/mysql-errno-150/comment-page-1/#comment-20247</link>
		<dc:creator>D Miller</dc:creator>
		<pubDate>Thu, 29 Jul 2010 06:42:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.danieltome.com/blog/2008/01/17/mysql-errno-150/#comment-20247</guid>
		<description>Thanks!!</description>
		<content:encoded><![CDATA[<p>Thanks!!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: myyellowshoe</title>
		<link>http://www.danieltome.com/blog/2008/01/17/mysql-errno-150/comment-page-1/#comment-10893</link>
		<dc:creator>myyellowshoe</dc:creator>
		<pubDate>Thu, 29 Jul 2010 04:46:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.danieltome.com/blog/2008/01/17/mysql-errno-150/#comment-10893</guid>
		<description>Hey there,
Thanks for the clear write up on this issue, though I might have found yet another caveat. Take a gander.
This code will run up untill I ad the foreign key. Funny part is, it was working like yesterday. Which I added an on cascade delete, though it is removed in this.
Gotta love sql! :D


CREATE TABLE vik (
		vik_id INT NOT NULL AUTO_INCREMENT,
		nid INT NOT NULL,
		description BLOB,
		PRIMARY KEY(vik_id),	
			energy_id INT	
		)ENGINE = INNODB;

		CREATE TABLE vik_energy(
			vik_id INT,
			energy_id INT,
			FOREIGN KEY(vik_id) REFERENCES vik(vik_id)
			
		)ENGINE=INNODB;

ALTER TABLE vik ADD FOREIGN KEY(energy_id) REFERENCES vik_energy(energy_id);</description>
		<content:encoded><![CDATA[<p>Hey there,<br />
Thanks for the clear write up on this issue, though I might have found yet another caveat. Take a gander.<br />
This code will run up untill I ad the foreign key. Funny part is, it was working like yesterday. Which I added an on cascade delete, though it is removed in this.<br />
Gotta love sql! <img src='http://www.danieltome.com/blog/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p>CREATE TABLE vik (<br />
		vik_id INT NOT NULL AUTO_INCREMENT,<br />
		nid INT NOT NULL,<br />
		description BLOB,<br />
		PRIMARY KEY(vik_id),<br />
			energy_id INT<br />
		)ENGINE = INNODB;</p>
<p>		CREATE TABLE vik_energy(<br />
			vik_id INT,<br />
			energy_id INT,<br />
			FOREIGN KEY(vik_id) REFERENCES vik(vik_id)</p>
<p>		)ENGINE=INNODB;</p>
<p>ALTER TABLE vik ADD FOREIGN KEY(energy_id) REFERENCES vik_energy(energy_id);</p>
]]></content:encoded>
	</item>
</channel>
</rss>
