title: MySQL Cannot add foreign key constraint - mismatched charset
body: <p>The following create statements fail </p>
  
  <pre><code>DROP TABLE IF EXISTS `book` ;
  DROP TABLE IF EXISTS `person` ;
  
  CREATE TABLE `person` (
    `name` VARCHAR(30) NOT NULL,
    PRIMARY KEY (`name`)
  ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  
  CREATE TABLE `book` (
    `author` VARCHAR(30) NOT NULL,
    `title` VARCHAR(100) NOT NULL,
    PRIMARY KEY (`author`, `title`),
    FOREIGN KEY (`author`)
      REFERENCES `person` (`name`)
      ON DELETE NO ACTION
      ON UPDATE NO ACTION
  ) ENGINE = InnoDB ;
  </code></pre>
  
  <p>with the following error </p>
  
  <pre><code>ERROR 1215 (HY000): Cannot add foreign key constraint
  </code></pre>
  
  <p>and all the data types and field names are all correct. Why is the foreign key constraint failing?</p>