The mysql driver contains the following error on line 580 in version 506a:
$foreign_keys[$ref_table] = array();
should be:
if (!isset($foreign_keys[$ref_table])) {
$foreign_keys[$ref_table] = array();
}
A table can have two foreign keys pointing to the same column in the same table. The original code will incorrectly report only the last column.
TQ