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

@@ -5,6 +5,10 @@ phpMyAdmin - Changelog
$Id$
$Source$
2004-03-10 Marc Delisle <lem9@users.sourceforge.net>
* libraries/relation.lib.php: bug 877359, no CONSTRAINT in
SHOW CREATE TABLE on older MySQL versions
2004-03-10 Michal Cihar <michal@cihar.com>
* export.php: Correctly report error when export fails.
* libraries/database_interface.lib.php, libraries/dbi/mysql.dbi.lib.php,

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'];