bug 1016997 wrong db name in SHOW KEYS

This commit is contained in:
Marc Delisle
2004-08-27 17:20:19 +00:00
parent a645a84590
commit a16d97912f
3 changed files with 10 additions and 0 deletions

View File

@@ -5,6 +5,10 @@ phpMyAdmin - Changelog
$Id$
$Source$
2004-08-27 Marc Delisle <lem9@users.sourceforge.net>
* tbl_relation.php, libraries/display_tbl.lib.php: bug 1016997,
wrong db name generated in SHOW KEYS
2004-08-26 Marc Delisle <lem9@users.sourceforge.net>
* index.php, libraries/common.lib.php: bug 1006011: now we save
the chosen connection collation into a cookie

View File

@@ -489,6 +489,8 @@ function PMA_displayTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0, $
$sort_expression_nodir = isset($matches[1]) ? trim($matches[1]) : $sort_expression;
// grab indexes data:
PMA_DBI_select_db($db);
if (!defined('PMA_IDX_INCLUDED')) {
$local_query = 'SHOW KEYS FROM ' . PMA_backquote($table);
$result = PMA_DBI_query($local_query) or PMA_mysqlDie('', $local_query, '', $err_url_0);

View File

@@ -279,6 +279,8 @@ if ($cfgRelation['relwork'] || $tbl_type=='INNODB') {
while ($curr_table = @PMA_DBI_fetch_row($tab_rs)) {
if (($curr_table[0] != $table) && ($curr_table[0] != $cfg['Server']['relation'])) {
PMA_DBI_select_db($db);
// need to use PMA_DBI_QUERY_STORE with PMA_DBI_num_rows() in mysqli
$fi_rs = PMA_DBI_query('SHOW KEYS FROM ' . PMA_backquote($curr_table[0]) . ';', NULL, PMA_DBI_QUERY_STORE);
if ($fi_rs && PMA_DBI_num_rows($fi_rs) > 0) {
@@ -325,6 +327,8 @@ if ($cfgRelation['relwork'] || $tbl_type=='INNODB') {
// current table (see bug report #574851)
}
else if ($curr_table[0] == $table) {
PMA_DBI_select_db($db);
// need to use PMA_DBI_QUERY_STORE with PMA_DBI_num_rows() in mysqli
$fi_rs = PMA_DBI_query('SHOW KEYS FROM ' . PMA_backquote($curr_table[0]) . ';', NULL, PMA_DBI_QUERY_STORE);
if ($fi_rs && PMA_DBI_num_rows($fi_rs) > 0) {