<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.2.2" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
	<title>Comments on: How to avoid unique index violations on updates in MySQL</title>
	<link>http://www.xaprb.com/blog/2006/06/16/how-to-avoid-unique-index-violations-on-updates-in-mysql/</link>
	<description>Stay curious!</description>
	<pubDate>Thu, 24 Jul 2008 00:17:28 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.2.2</generator>

	<item>
		<title>By: Devon Yates</title>
		<link>http://www.xaprb.com/blog/2006/06/16/how-to-avoid-unique-index-violations-on-updates-in-mysql/#comment-14644</link>
		<author>Devon Yates</author>
		<pubDate>Fri, 23 May 2008 16:28:27 +0000</pubDate>
		<guid>http://www.xaprb.com/blog/2006/06/16/how-to-avoid-unique-index-violations-on-updates-in-mysql/#comment-14644</guid>
		<description>Hi,
This is an interesting topic.  Thanks for documenting it.  I was wondering if you ever followed up with the post on the concept of swapping rows.  I have just run into a situation where I have a unique index, where one of the values within the unique index has swapped.  What is the easiest/best way to handle this?  
Cheers,
Devon Yates</description>
		<content:encoded><![CDATA[<p>Hi,<br />
This is an interesting topic.  Thanks for documenting it.  I was wondering if you ever followed up with the post on the concept of swapping rows.  I have just run into a situation where I have a unique index, where one of the values within the unique index has swapped.  What is the easiest/best way to handle this?<br />
Cheers,<br />
Devon Yates</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Xaprb</title>
		<link>http://www.xaprb.com/blog/2006/06/16/how-to-avoid-unique-index-violations-on-updates-in-mysql/#comment-4049</link>
		<author>Xaprb</author>
		<pubDate>Mon, 12 Feb 2007 14:18:30 +0000</pubDate>
		<guid>http://www.xaprb.com/blog/2006/06/16/how-to-avoid-unique-index-violations-on-updates-in-mysql/#comment-4049</guid>
		<description>&lt;p&gt;It looks like you might accidentally be trying to update the idCalendarEntry column -- are you sure the query is being issued as you say?  If so, that's pretty bizarre.&lt;/p&gt;</description>
		<content:encoded><![CDATA[<p>It looks like you might accidentally be trying to update the idCalendarEntry column &#8212; are you sure the query is being issued as you say?  If so, that&#8217;s pretty bizarre.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Simon Giddings</title>
		<link>http://www.xaprb.com/blog/2006/06/16/how-to-avoid-unique-index-violations-on-updates-in-mysql/#comment-4048</link>
		<author>Simon Giddings</author>
		<pubDate>Mon, 12 Feb 2007 14:05:32 +0000</pubDate>
		<guid>http://www.xaprb.com/blog/2006/06/16/how-to-avoid-unique-index-violations-on-updates-in-mysql/#comment-4048</guid>
		<description>&lt;p&gt;Hi,

I issue an update statement containing a where clause on the primary 
index, so as to update a single record. Howerver this is failing with 
"Duplicate entry '6' for key 1" -
update clients.calendarentry set Subject = 'presentation' where 
idCalendarEntry = 6;

In the table, the field 'idCalendarEntry' is declared as :
`idCalendarEntry` int(10) unsigned NOT NULL auto_increment

The server version of MySql I am using is 5.0.24
The client version of MySql I am using is 5.0.11

Are you able to help?
Simon&lt;/p&gt;</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>I issue an update statement containing a where clause on the primary<br />
index, so as to update a single record. Howerver this is failing with<br />
&#8220;Duplicate entry &#8216;6&#8242; for key 1&#8243; -<br />
update clients.calendarentry set Subject = &#8216;presentation&#8217; where<br />
idCalendarEntry = 6;</p>
<p>In the table, the field &#8216;idCalendarEntry&#8217; is declared as :<br />
`idCalendarEntry` int(10) unsigned NOT NULL auto_increment</p>
<p>The server version of MySql I am using is 5.0.24<br />
The client version of MySql I am using is 5.0.11</p>
<p>Are you able to help?<br />
Simon</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mark</title>
		<link>http://www.xaprb.com/blog/2006/06/16/how-to-avoid-unique-index-violations-on-updates-in-mysql/#comment-1715</link>
		<author>Mark</author>
		<pubDate>Wed, 06 Sep 2006 21:22:43 +0000</pubDate>
		<guid>http://www.xaprb.com/blog/2006/06/16/how-to-avoid-unique-index-violations-on-updates-in-mysql/#comment-1715</guid>
		<description>&lt;p&gt;I was working on a project and ran into this exact problem, fortunately a &lt;a href="http://www.google.com/search?hs=Kfj&#38;hl=en&#38;lr=&#38;client=firefox-a&#38;rls=org.mozilla%3Aen-US%3Aofficial&#38;q=mysql+error+1062+duplicate+entry+for+key+1+myisam&#38;btnG=Search" rel="nofollow"&gt;google search&lt;/a&gt; turned up your article and it saved me.  Thanks for the assist!&lt;/p&gt;</description>
		<content:encoded><![CDATA[<p>I was working on a project and ran into this exact problem, fortunately a <a href="http://www.google.com/search?hs=Kfj&amp;hl=en&amp;lr=&amp;client=firefox-a&amp;rls=org.mozilla%3Aen-US%3Aofficial&amp;q=mysql+error+1062+duplicate+entry+for+key+1+myisam&amp;btnG=Search" rel="nofollow">google search</a> turned up your article and it saved me.  Thanks for the assist!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Noah Winecoff</title>
		<link>http://www.xaprb.com/blog/2006/06/16/how-to-avoid-unique-index-violations-on-updates-in-mysql/#comment-960</link>
		<author>Noah Winecoff</author>
		<pubDate>Wed, 21 Jun 2006 16:02:34 +0000</pubDate>
		<guid>http://www.xaprb.com/blog/2006/06/16/how-to-avoid-unique-index-violations-on-updates-in-mysql/#comment-960</guid>
		<description>&lt;p&gt;Great write up. I develop everyday using MySQL and information like this makes my job a lot easier. Thanks.&lt;/p&gt;</description>
		<content:encoded><![CDATA[<p>Great write up. I develop everyday using MySQL and information like this makes my job a lot easier. Thanks.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
