title: mysql foreign key ERROR 1451 update cascade not happening
body: <p>I am trying to update a field that is referenced as a foreign key in another table.</p>
  
  <p>mysql> update Maintenance set contract='95096916-OLD' where contract='95096916';</p>
  
  <blockquote>
    <p>ERROR 1451 (23000): Cannot delete or update a parent row: a foreign
    key constraint fails (<code>systems_doc</code>.<code>Equipment</code>, CONSTRAINT
    <code>Equipment_ibfk_1</code> FOREIGN KEY (<code>contract</code>) REFERENCES <code>Maintenance</code>
    (<code>contract</code>) ON UPDATE CASCADE)</p>
  </blockquote>
  
  <pre><code>| Maintenance | CREATE TABLE `Maintenance` (
    `contract` char(30) NOT NULL,
    `quote` char(30) NOT NULL,
    `vendor` char(20) NOT NULL,
    `provider` char(20) NOT NULL,
    `product` char(30) NOT NULL,
    `expiryDate` date NOT NULL,
    `annualCost` int(11) NOT NULL,
    `reference` char(13) NOT NULL,
    `purchaseOrder` char(13) NOT NULL,
    `cq` char(10) NOT NULL,
    `cqRenewal` char(10) NOT NULL,
    `comments` char(40) NOT NULL,
    UNIQUE KEY `contract` (`contract`,`expiryDate`)
  ) ENGINE=InnoDB DEFAULT CHARSET=latin1 | 
  
  | Equipment | CREATE TABLE `Equipment` (
    `vendor` char(20) NOT NULL,
    `model` char(30) NOT NULL,
    `serialNumber` char(20) NOT NULL,
    `purchaseOrder` char(20) NOT NULL,
    `purchaseDate` date NOT NULL,
    `contract` char(15) NOT NULL,
    `annualCost` int(11) NOT NULL,
    `comments1` varchar(256) DEFAULT NULL,
    `comments2` varchar(256) NOT NULL,
    PRIMARY KEY (`serialNumber`),
    KEY `contract` (`contract`),
    CONSTRAINT `Equipment_ibfk_1` FOREIGN KEY (`contract`) REFERENCES `Maintenance` (`contract`) ON UPDATE CASCADE
  ) ENGINE=InnoDB DEFAULT CHARSET=latin1 | 
  </code></pre>
  
  <p>Why isn't it cascading the UPDATE?  I don't <em>think</em> it's circular.  Thanks for your help.  I've read other similar problems, but either I am misinterpreting how it should work, or I've got something setup wrong.</p>