bug #1518147, information_schema disables displaying of size for other dbs

This commit is contained in:
Marc Delisle
2006-07-06 14:40:24 +00:00
parent 8da02e83c3
commit d2eec7b7d2
4 changed files with 24 additions and 14 deletions

View File

@@ -6,6 +6,12 @@ $Id$
$Source$ $Source$
2006-07-06 Marc Delisle <lem9@users.sourceforge.net>
* 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 <cybot_tm@users.sourceforge.net> 2006-07-06 Sebastian Mendel <cybot_tm@users.sourceforge.net>
* libraries/select_server.lib.php, css/phpmyadmin.css.php: * libraries/select_server.lib.php, css/phpmyadmin.css.php:
make serverlist a real html-list make serverlist a real html-list

View File

@@ -59,7 +59,7 @@ if (PMA_MYSQL_INT_VERSION >= 40101) {
* @uses PMA_showHint() * @uses PMA_showHint()
* @uses PMA_MYSQL_INT_VERSION * @uses PMA_MYSQL_INT_VERSION
* @uses $GLOBALS['cfg']['PropertiesNumColumns'] * @uses $GLOBALS['cfg']['PropertiesNumColumns']
* @uses $GLOBALS['cfg']['ShowStats'] * @uses $GLOBALS['is_show_stats']
* @uses $GLOBALS['strTable'] * @uses $GLOBALS['strTable']
* @uses $GLOBALS['strAction'] * @uses $GLOBALS['strAction']
* @uses $GLOBALS['strRecords'] * @uses $GLOBALS['strRecords']
@@ -99,7 +99,7 @@ function PMA_TableHeader($db_is_information_schema = false)
$cnt++; $cnt++;
} }
} }
if ($GLOBALS['cfg']['ShowStats']) { if ($GLOBALS['is_show_stats']) {
echo ' <th>' . $GLOBALS['strSize'] . '</th>' . "\n" echo ' <th>' . $GLOBALS['strSize'] . '</th>' . "\n"
. ' <th>' . $GLOBALS['strOverhead'] . '</th>' . "\n"; . ' <th>' . $GLOBALS['strOverhead'] . '</th>' . "\n";
$cnt += 2; $cnt += 2;
@@ -108,7 +108,7 @@ function PMA_TableHeader($db_is_information_schema = false)
echo '</thead>' . "\n"; echo '</thead>' . "\n";
echo '<tbody>' . "\n"; echo '<tbody>' . "\n";
$GLOBALS['structure_tbl_col_cnt'] = $cnt + $action_colspan + 3; $GLOBALS['structure_tbl_col_cnt'] = $cnt + $action_colspan + 3;
} } // end function PMA_TableHeader()
$titles = array(); $titles = array();
if (true == $cfg['PropertiesIconic']) { 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 // MyISAM, ISAM or Heap table: Row count, data size and index size
// is accurate. // is accurate.
if (preg_match('@^(MyISAM|ISAM|HEAP|MEMORY)$@', $each_table['ENGINE'])) { 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']); $tblsize = doubleval($each_table['Data_length']) + doubleval($each_table['Index_length']);
$sum_size += $tblsize; $sum_size += $tblsize;
list($formatted_size, $unit) = PMA_formatByteDown($tblsize, 3, ($tblsize > 0) ? 1 : 0); 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') { } elseif ($each_table['ENGINE'] == 'InnoDB') {
// InnoDB table: Row count is not accurate but data and index // InnoDB table: Row count is not accurate but data and index
// sizes are. // sizes are.
if ($cfg['ShowStats']) { if ($is_show_stats) {
$tblsize = $each_table['Data_length'] + $each_table['Index_length']; $tblsize = $each_table['Data_length'] + $each_table['Index_length'];
$sum_size += $tblsize; $sum_size += $tblsize;
list($formatted_size, $unit) = PMA_formatByteDown($tblsize, 3, ($tblsize > 0) ? 1 : 0); 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']; $sum_entries += $each_table['TABLE_ROWS'];
} elseif (preg_match('@^(MRG_MyISAM|BerkeleyDB)$@', $each_table['ENGINE'])) { } elseif (preg_match('@^(MRG_MyISAM|BerkeleyDB)$@', $each_table['ENGINE'])) {
// Merge or BerkleyDB table: Only row count is accurate. // Merge or BerkleyDB table: Only row count is accurate.
if ($cfg['ShowStats']) { if ($is_show_stats) {
$formatted_size = ' - '; $formatted_size = ' - ';
$unit = ''; $unit = '';
} }
$sum_entries += $each_table['TABLE_ROWS']; $sum_entries += $each_table['TABLE_ROWS'];
} else { } else {
// Unknown table type. // Unknown table type.
if ($cfg['ShowStats']) { if ($is_show_stats) {
$formatted_size = 'unknown'; $formatted_size = 'unknown';
$unit = ''; $unit = '';
} }
@@ -288,7 +288,7 @@ foreach ($tables as $keyname => $each_table) {
} }
} }
if ($cfg['ShowStats']) { if ($is_show_stats) {
if (isset($formatted_overhead)) { if (isset($formatted_overhead)) {
$overhead = '<a href="tbl_properties_structure.php?' $overhead = '<a href="tbl_properties_structure.php?'
. $tbl_url_query . '#showusage">' . $formatted_overhead . $tbl_url_query . '#showusage">' . $formatted_overhead
@@ -363,7 +363,7 @@ foreach ($tables as $keyname => $each_table) {
<?php } ?> <?php } ?>
<?php } ?> <?php } ?>
<?php if ($cfg['ShowStats']) { ?> <?php if ($is_show_stats) { ?>
<td class="value"><a <td class="value"><a
href="tbl_properties_structure.php?<?php echo $tbl_url_query; ?>#showusage" href="tbl_properties_structure.php?<?php echo $tbl_url_query; ?>#showusage"
><?php echo $formatted_size . ' ' . $unit; ?></a></td> ><?php echo $formatted_size . ' ' . $unit; ?></a></td>
@@ -373,7 +373,7 @@ foreach ($tables as $keyname => $each_table) {
<td class="value">-</td> <td class="value">-</td>
<td><?php echo $strView; ?></td> <td><?php echo $strView; ?></td>
<td>---</td> <td>---</td>
<?php if ($cfg['ShowStats']) { ?> <?php if ($is_show_stats) { ?>
<td class="value">-</td> <td class="value">-</td>
<td class="value">-</td> <td class="value">-</td>
<?php } ?> <?php } ?>
@@ -387,7 +387,7 @@ foreach ($tables as $keyname => $each_table) {
} // end foreach } // end foreach
// Show Summary // Show Summary
if ($cfg['ShowStats']) { if ($is_show_stats) {
list($sum_formatted, $unit) = PMA_formatByteDown($sum_size, 3, 1); list($sum_formatted, $unit) = PMA_formatByteDown($sum_size, 3, 1);
list($overhead_formatted, $overhead_unit) = list($overhead_formatted, $overhead_unit) =
PMA_formatByteDown($overhead_size, 3, 1); PMA_formatByteDown($overhead_size, 3, 1);
@@ -416,7 +416,7 @@ if (!($cfg['PropertiesNumColumns'] > 1)) {
} }
} }
if ($cfg['ShowStats']) { if ($is_show_stats) {
?> ?>
<th class="value"><?php echo $sum_formatted . ' ' . $unit; ?></th> <th class="value"><?php echo $sum_formatted . ' ' . $unit; ?></th>
<th class="value"><?php echo $overhead_formatted . ' ' . $overhead_unit; ?></th> <th class="value"><?php echo $overhead_formatted . ' ' . $overhead_unit; ?></th>

View File

@@ -10,8 +10,10 @@ require_once('./libraries/bookmark.lib.php');
PMA_checkParameters(array('db')); PMA_checkParameters(array('db'));
$is_show_stats = $cfg['ShowStats'];
if ( PMA_MYSQL_INT_VERSION >= 50002 && $db == 'information_schema' ) { if ( PMA_MYSQL_INT_VERSION >= 50002 && $db == 'information_schema' ) {
$cfg['ShowStats'] = false; $is_show_stats = false;
$db_is_information_schema = true; $db_is_information_schema = true;
} else { } else {
$db_is_information_schema = false; $db_is_information_schema = false;

View File

@@ -9,8 +9,10 @@ require_once('./libraries/common.lib.php');
PMA_checkParameters(array('db')); PMA_checkParameters(array('db'));
$is_show_stats = $cfg['ShowStats'];
if ( PMA_MYSQL_INT_VERSION >= 50002 && $db == 'information_schema' ) { if ( PMA_MYSQL_INT_VERSION >= 50002 && $db == 'information_schema' ) {
$cfg['ShowStats'] = false; $is_show_stats = false;
$db_is_information_schema = true; $db_is_information_schema = true;
} else { } else {
$db_is_information_schema = false; $db_is_information_schema = false;