From d2eec7b7d211490385d816562c6026681b7fc226 Mon Sep 17 00:00:00 2001 From: Marc Delisle Date: Thu, 6 Jul 2006 14:40:24 +0000 Subject: [PATCH] bug #1518147, information_schema disables displaying of size for other dbs --- ChangeLog | 6 ++++++ db_details_structure.php | 24 ++++++++++++------------ libraries/db_details_common.inc.php | 4 +++- libraries/db_details_db_info.inc.php | 4 +++- 4 files changed, 24 insertions(+), 14 deletions(-) diff --git a/ChangeLog b/ChangeLog index afcf6feaa..a1d30be91 100755 --- a/ChangeLog +++ b/ChangeLog @@ -6,6 +6,12 @@ $Id$ $Source$ +2006-07-06 Marc Delisle + * db_details_structure.php, libraries/db_details_common.inc.php + libraries/db_details_db_info.inc.php: + bug #1518147, after displaying information_schema, displaying other + dbs does not show size + 2006-07-06 Sebastian Mendel * libraries/select_server.lib.php, css/phpmyadmin.css.php: make serverlist a real html-list diff --git a/db_details_structure.php b/db_details_structure.php index 5deebe471..6b1049578 100644 --- a/db_details_structure.php +++ b/db_details_structure.php @@ -59,7 +59,7 @@ if (PMA_MYSQL_INT_VERSION >= 40101) { * @uses PMA_showHint() * @uses PMA_MYSQL_INT_VERSION * @uses $GLOBALS['cfg']['PropertiesNumColumns'] - * @uses $GLOBALS['cfg']['ShowStats'] + * @uses $GLOBALS['is_show_stats'] * @uses $GLOBALS['strTable'] * @uses $GLOBALS['strAction'] * @uses $GLOBALS['strRecords'] @@ -99,7 +99,7 @@ function PMA_TableHeader($db_is_information_schema = false) $cnt++; } } - if ($GLOBALS['cfg']['ShowStats']) { + if ($GLOBALS['is_show_stats']) { echo ' ' . $GLOBALS['strSize'] . '' . "\n" . ' ' . $GLOBALS['strOverhead'] . '' . "\n"; $cnt += 2; @@ -108,7 +108,7 @@ function PMA_TableHeader($db_is_information_schema = false) echo '' . "\n"; echo '' . "\n"; $GLOBALS['structure_tbl_col_cnt'] = $cnt + $action_colspan + 3; -} +} // end function PMA_TableHeader() $titles = array(); if (true == $cfg['PropertiesIconic']) { @@ -243,7 +243,7 @@ foreach ($tables as $keyname => $each_table) { // MyISAM, ISAM or Heap table: Row count, data size and index size // is accurate. if (preg_match('@^(MyISAM|ISAM|HEAP|MEMORY)$@', $each_table['ENGINE'])) { - if ($cfg['ShowStats']) { + if ($is_show_stats) { $tblsize = doubleval($each_table['Data_length']) + doubleval($each_table['Index_length']); $sum_size += $tblsize; list($formatted_size, $unit) = PMA_formatByteDown($tblsize, 3, ($tblsize > 0) ? 1 : 0); @@ -256,7 +256,7 @@ foreach ($tables as $keyname => $each_table) { } elseif ($each_table['ENGINE'] == 'InnoDB') { // InnoDB table: Row count is not accurate but data and index // sizes are. - if ($cfg['ShowStats']) { + if ($is_show_stats) { $tblsize = $each_table['Data_length'] + $each_table['Index_length']; $sum_size += $tblsize; list($formatted_size, $unit) = PMA_formatByteDown($tblsize, 3, ($tblsize > 0) ? 1 : 0); @@ -265,14 +265,14 @@ foreach ($tables as $keyname => $each_table) { $sum_entries += $each_table['TABLE_ROWS']; } elseif (preg_match('@^(MRG_MyISAM|BerkeleyDB)$@', $each_table['ENGINE'])) { // Merge or BerkleyDB table: Only row count is accurate. - if ($cfg['ShowStats']) { + if ($is_show_stats) { $formatted_size = ' - '; $unit = ''; } $sum_entries += $each_table['TABLE_ROWS']; } else { // Unknown table type. - if ($cfg['ShowStats']) { + if ($is_show_stats) { $formatted_size = 'unknown'; $unit = ''; } @@ -288,7 +288,7 @@ foreach ($tables as $keyname => $each_table) { } } - if ($cfg['ShowStats']) { + if ($is_show_stats) { if (isset($formatted_overhead)) { $overhead = '' . $formatted_overhead @@ -363,7 +363,7 @@ foreach ($tables as $keyname => $each_table) { - + @@ -373,7 +373,7 @@ foreach ($tables as $keyname => $each_table) { - --- - + - - @@ -387,7 +387,7 @@ foreach ($tables as $keyname => $each_table) { } // end foreach // Show Summary -if ($cfg['ShowStats']) { +if ($is_show_stats) { list($sum_formatted, $unit) = PMA_formatByteDown($sum_size, 3, 1); list($overhead_formatted, $overhead_unit) = PMA_formatByteDown($overhead_size, 3, 1); @@ -416,7 +416,7 @@ if (!($cfg['PropertiesNumColumns'] > 1)) { } } -if ($cfg['ShowStats']) { +if ($is_show_stats) { ?> diff --git a/libraries/db_details_common.inc.php b/libraries/db_details_common.inc.php index 68f64756a..9bc3804f8 100644 --- a/libraries/db_details_common.inc.php +++ b/libraries/db_details_common.inc.php @@ -10,8 +10,10 @@ require_once('./libraries/bookmark.lib.php'); PMA_checkParameters(array('db')); +$is_show_stats = $cfg['ShowStats']; + if ( PMA_MYSQL_INT_VERSION >= 50002 && $db == 'information_schema' ) { - $cfg['ShowStats'] = false; + $is_show_stats = false; $db_is_information_schema = true; } else { $db_is_information_schema = false; diff --git a/libraries/db_details_db_info.inc.php b/libraries/db_details_db_info.inc.php index 32cd056a4..e6910e73d 100644 --- a/libraries/db_details_db_info.inc.php +++ b/libraries/db_details_db_info.inc.php @@ -9,8 +9,10 @@ require_once('./libraries/common.lib.php'); PMA_checkParameters(array('db')); +$is_show_stats = $cfg['ShowStats']; + if ( PMA_MYSQL_INT_VERSION >= 50002 && $db == 'information_schema' ) { - $cfg['ShowStats'] = false; + $is_show_stats = false; $db_is_information_schema = true; } else { $db_is_information_schema = false;