title: MySql "cannot update parent row" when I have "ON UPDATE CASCADE"
body: <p>So, I am getting:</p>
  
  <blockquote>
    <p>Error Code: 1451. Cannot delete or update a parent row: a foreign key
    constraint fails (<code>playground</code>.<code>Person</code>, CONSTRAINT <code>sk_Person_Parent</code>
    FOREIGN KEY (<code>parent_id</code>) REFERENCES <code>Person</code> (<code>id</code>) ON DELETE CASCADE
    ON UPDATE CASCADE)</p>
  </blockquote>
  
  <p>This is the simple table, referencing itself:</p>
  
  <pre><code>CREATE TABLE IF NOT EXISTS Person (
  id int not null primary key,
  name varchar(100) not null,
  parent_id int null,
  CONSTRAINT `sk_Person_Parent`
    FOREIGN KEY (parent_id)
    REFERENCES Person (id)
    ON DELETE CASCADE
    ON UPDATE CASCADE
  );
  </code></pre>
  
  <p>as you see, there is "ON UPDATE CASCADE". 
  I insert 4 simple rows in it:</p>
  
  <pre><code>INSERT INTO Person(id, name, parent_id)
  VALUES
  (1, 'vasko', NULL), 
  (2, 'asdas', 1), 
  (3, 'ivo', 1), 
  (4, 'anton', 3);
  </code></pre>
  
  <p>so I have 
  1 - vasko
    2 - asdasd
    3 - ivo
      4 - anton.
  When i delete by id 1, all the records get wiped, because of the ON DELETE CASCADE. However, if I try to execute</p>
  
  <pre><code>UPDATE Person
  SET id=10
  WHERE id=1;
  </code></pre>
  
  <p>I get the given error. Any ideas?</p>
  
  <p>(I am expecting vasil's id to become 10, and the parent_id of the next 2 rows to be updated to 10)</p>