title: Cannot add foreign key constraint on a date field
body: <p>I have the following SQL statements:</p>
  
  <pre><code>CREATE TABLE patient(
    Name varchar(255),
    Geburtsdatum date,
    CONSTRAINT pk_patient PRIMARY KEY (Name,Geburtsdatum)
  );
  
  CREATE TABLE fake(
    Name varchar(255),
    PName varchar(255),
    PGeburtsdatum date,
    CONSTRAINT pk_fake PRIMARY KEY (Name,PName,PGeburtsdatum),
    CONSTRAINT fk_PName2 FOREIGN KEY (PName) REFERENCES patient(Name) ON DELETE CASCADE ON UPDATE CASCADE,
    CONSTRAINT fk_PGeburtsdatum FOREIGN KEY (PGeburtsdatum) REFERENCES patient(Geburtsdatum) ON DELETE CASCADE ON UPDATE CASCADE
  );
  </code></pre>
  
  <p>This gives me the error "#1215 - Cannot add foreign key constraint". If I remove the last constraint in the second table creation everything works. All my other foreign key constraints work exactly the same way. What am I missing here?</p>