title: Can't create an auto_increment primary key, when there is a foreign key which is auto_inc in origin
body: <p>I've got 2 tables:</p>
  
  <ol>
  <li><p>INCIDENCIES:</p>
  
  <pre><code>CREATE TABLE incidencies
    (
       id_inc     INT(7) ZEROFILL NOT NULL auto_increment PRIMARY KEY,
       empresa    VARCHAR(40),
       maquina    VARCHAR(20),
       tipus_inc  VARCHAR(20),
       estat_mon  VARCHAR(20),
       estat_inc  VARCHAR(20),
       dia_inc    DATE,
       hora_inc   TIME,
       descripcio VARCHAR(200)
    )
  CHARACTER SET utf8
  engine=innodb;
  </code></pre></li>
  <li><p>COMENTARIS:</p>
  
  <pre><code>CREATE TABLE comentaris
    (
       id_inc    INT(7) ZEROFILL NOT NULL,
       id_com    INT(3) ZEROFILL NOT NULL auto_increment,
       data_com  DATE,
       hora_com  TIME,
       comentari VARCHAR(999),
       PRIMARY KEY(id_inc, id_com),
       FOREIGN KEY (id_inc) REFERENCES incidencies (id_inc) ON DELETE CASCADE ON
       UPDATE CASCADE
    )
  CHARACTER SET utf8
  engine=innodb; 
  </code></pre></li>
  </ol>
  
  <p>As you can see, on <code>COMENTARIS</code> table, <code>ID_INC</code> is a foreign key which on its origin is auto_incremental, but is not anymore on <code>COMENTARIS</code>.</p>
  
  <p>Now I do want to make the field <code>ID_COM</code> auto_incremental, and make both of them primary keys.</p>
  
  <p>The table should look like this:</p>
  
  <pre>
  ID_INC | ID_COM
  001    |  001
  001    |  002
  001    |  003
  002    |  004
  003    |  005
  </pre>
  
  <p>The problem is that it seems MySQL detects <code>ID_INC</code> as an auto_incremental field, which is <strong>not</strong> on <code>COMENTARIS</code> table anymore.</p>
  
  <p>When I try to make <code>ID_COM</code> auto_incremental, I get this error message:</p>
  
  <blockquote>
    <p>ERROR 1075 (42000): Incorrect table definition; there can be only one auto column and it must be defined as a key</p>
  </blockquote>
  
  <p>The database needs to be <code>InnoDB</code> engine.</p>
  
  <p>Any solution?</p>