title: MySQL ON Duplicate update not working
body: <p>I am running the following Insert statement:</p>
  
  <pre><code>INSERT INTO list_subscribers (subscriberid, listid, emailaddress, domainname, format, confirmed, confirmcode, requestdate, requestip, confirmdate, confirmip, subscribedate, unsubscribed, unsubscribeconfirmed) 
  VALUES ('203404', 1, 'blah@gmail.com', '@gmail.com', 'h', 1, '1234', 1282196458, '', 1282196458, '', 1282196458, 0, 0 ) 
  ON DUPLICATE KEY UPDATE emailaddress='blah@gmail.com', domainname = '@gmail.com', unsubscribed = 0, unsubscribeconfirmed = 0
  </code></pre>
  
  <p>And I am getting the following error back:</p>
  
  <pre><code>Error Code: 1062. Duplicate entry 'blah@gmail.com-1' for key 'subscribers_email_list_idx'
  </code></pre>
  
  <p>Here is what my table looks like:</p>
  
  <pre><code>CREATE TABLE `list_subscribers` (
      `subscriberid` int(11) NOT NULL AUTO_INCREMENT,
      `listid` int(11) NOT NULL DEFAULT '0',
      `emailaddress` varchar(200) DEFAULT NULL,
      `domainname` varchar(100) DEFAULT NULL,
      `format` char(1) DEFAULT NULL,
      `confirmed` char(1) DEFAULT '0',
      `confirmcode` varchar(32) DEFAULT NULL,
      `requestdate` int(11) DEFAULT '0',
      `requestip` varchar(20) DEFAULT NULL,
      `confirmdate` int(11) DEFAULT '0',
      `confirmip` varchar(20) DEFAULT NULL,
      `subscribedate` int(11) DEFAULT '0',
      `bounced` int(11) DEFAULT '0',
      `unsubscribed` int(11) DEFAULT '0',
      `unsubscribeconfirmed` char(1) DEFAULT '0',
      `formid` int(11) DEFAULT '0',
      PRIMARY KEY (`subscriberid`),
      UNIQUE KEY `subscribers_email_list_idx` (`emailaddress`,`listid`),
      KEY `list_subscribers_sub_list_idx` (`subscriberid`,`listid`),
      KEY `subscribe_date_idx` (`subscribedate`),
      KEY `list_subscribers_listid_idx` (`listid`),
      KEY `confirmed_idx` (`confirmed`)
  ) ENGINE=InnoDB AUTO_INCREMENT=4687107 DEFAULT CHARSET=utf8
  </code></pre>
  
  <p>I thought that this was exactly what the "ON DUPLICATE KEY UPDATE" statement was for?  Why is it aborting the query because of a duplicate index?</p>