bug 877359, constraint and MySQL 3.23.58

This commit is contained in:
Marc Delisle
2004-03-10 15:57:59 +00:00
parent 0174292c97
commit 0f6eb412ec
2 changed files with 14 additions and 1 deletions

View File

@@ -310,7 +310,16 @@ function PMA_getForeigners($db, $table, $column = '', $source = 'both') {
// and in 'innodb', we won't get it twice if $source='both'
// because we use $field as key
$foreign[$field]['constraint'] = $one_key['constraint'];
// The parser looks for a CONSTRAINT clause just before
// the FOREIGN KEY clause. It finds it (as output from
// SHOW CREATE TABLE) in MySQL 4.0.13, but not in older
// versions like 3.23.58.
// In those cases, the FOREIGN KEY parsing will put numbers
// like -1, 0, 1... instead of the constraint number.
if (isset($one_key['constraint'])) {
$foreign[$field]['constraint'] = $one_key['constraint'];
}
if (isset($one_key['ref_db_name'])) {
$foreign[$field]['foreign_db'] = $one_key['ref_db_name'];