title: Mysql table with both primary and unique key constraint
body: <p>I have a mysql table like below,</p>
  
  <pre><code>CREATE TABLE IF NOT EXISTS `sometable` (
    `field1` varchar(36) NOT NULL,
    `field2` varchar(36) NOT NULL,
    `field3` varchar(36) NOT NULL,
    `field4` varchar(36) NOT NULL,
    PRIMARY KEY (`field1`, `field2`)
    UNIQUE KEY `field3` (`field3`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  </code></pre>
  
  <p>At what context, a record to this table would be considered as a duplicate one? Assume that, I have the following record in my table.</p>
  
  <pre><code>-------------------------------------
  | field1 | field2 | field3 | field4 |
  |------------------------------------
  |   a    |   b    |    c   |    d   |
  -------------------------------------
  </code></pre>
  
  <p>Now if I insert <code>(field1,field2,field3,field4) values (a, b, cc, d)</code>, would it throw duplicate a key error? Or By considering the unique key constraint, would it allow the entry to be inserted and make the table looks like the below?</p>
  
  <pre><code>-------------------------------------
  | field1 | field2 | field3 | field4 |
  |------------------------------------
  |   a    |   b    |    c   |    d   |
  -------------------------------------
  |   a    |   b    |   cc   |    d   |
  -------------------------------------
  </code></pre>