diff --git a/ChangeLog b/ChangeLog index d8b9c8dc7..f11ded4d2 100755 --- a/ChangeLog +++ b/ChangeLog @@ -8,6 +8,7 @@ $Source$ 2006-03-14 Marc Delisle * libraries/common.lib.php: bug #1449715, loading of binary data very slow * server_privileges.php: compatibility with MySQL < 4.0.2 + * server_databases.php: bug #1445991, compatibility with MySQL 3.23.52 2006-03-13 Marc Delisle * libraries/Config.class.php, /common.lib.php: bug #1445120, diff --git a/server_databases.php b/server_databases.php index 8305490ae..bd176efa4 100644 --- a/server_databases.php +++ b/server_databases.php @@ -124,9 +124,20 @@ if ($server > 0) { /** * Displays the page */ -if (count($databases) > 0) { - // sorts the array - usort( $databases, 'PMA_dbCmp' ); + +$tmp_count = count($databases); +if ($tmp_count > 0) { + if ($tmp_count > 1) { + // sorts the array + usort( $databases, 'PMA_dbCmp' ); + } else { + // when there is only one database, the sort would not happen and + // the index would not become numeric (reproduced in MySQL 3.23.52) + $tmp_each = each($databases); + $databases = array(); + $databases[0] = $tmp_each['value']; + unset($tmp_each); + } // table col order // there is no db specific collation or charset prior 4.1.0 @@ -332,6 +343,7 @@ if (count($databases) > 0) { } else { echo $strNoDatabases; } +unset($tmp_count); /** * Create new database.