fixed problem with table size display and MERGE tables
This commit is contained in:
@@ -129,10 +129,11 @@ else if (MYSQL_MAJOR_VERSION >= 3.23 && isset($tbl_cache)) {
|
|||||||
</td>
|
</td>
|
||||||
<?php
|
<?php
|
||||||
echo "\n";
|
echo "\n";
|
||||||
|
$mergetable=false;
|
||||||
if (isset($sts_data['Type']) && $sts_data['Type']=="MRG_MyISAM") $mergetable=true;
|
if (isset($sts_data['Type']) && $sts_data['Type']=="MRG_MyISAM") $mergetable=true;
|
||||||
if (isset($sts_data['Rows']))
|
if (isset($sts_data['Rows']))
|
||||||
{
|
{
|
||||||
if (!isset($mergetable)){
|
if ($mergetable == false){
|
||||||
$tblsize = $sts_data['Data_length'] + $sts_data['Index_length'];
|
$tblsize = $sts_data['Data_length'] + $sts_data['Index_length'];
|
||||||
$sum_size += $tblsize;
|
$sum_size += $tblsize;
|
||||||
$sum_entries += $sts_data['Rows'];
|
$sum_entries += $sts_data['Rows'];
|
||||||
@@ -142,7 +143,7 @@ else if (MYSQL_MAJOR_VERSION >= 3.23 && isset($tbl_cache)) {
|
|||||||
list($formated_size, $unit) = format_byte_down($tblsize, 3, 0);
|
list($formated_size, $unit) = format_byte_down($tblsize, 3, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (isset($mergetable)) // MyISAM MERGE Table
|
else if ($mergetable == true) // MyISAM MERGE Table
|
||||||
{
|
{
|
||||||
$formated_size=" - ";
|
$formated_size=" - ";
|
||||||
$unit="";
|
$unit="";
|
||||||
@@ -155,10 +156,10 @@ else if (MYSQL_MAJOR_VERSION >= 3.23 && isset($tbl_cache)) {
|
|||||||
?>
|
?>
|
||||||
<td align="right">
|
<td align="right">
|
||||||
<?php
|
<?php
|
||||||
if (isset($mergetable)) echo "<i>";
|
if ($mergetable == true) echo "<i>";
|
||||||
echo number_format($sts_data['Rows'], 0, $number_decimal_separator,
|
echo number_format($sts_data['Rows'], 0, $number_decimal_separator,
|
||||||
$number_thousands_separator) . "\n";
|
$number_thousands_separator) . "\n";
|
||||||
if (isset($mergetable)) echo "</i>";
|
if ($mergetable == true) echo "</i>";
|
||||||
?>
|
?>
|
||||||
</td>
|
</td>
|
||||||
<td align="right" nowrap="nowrap">
|
<td align="right" nowrap="nowrap">
|
||||||
|
@@ -268,11 +268,12 @@ if ($index_count > 0) {
|
|||||||
// BEGIN - Calc Table Space - staybyte - 9 June 2001
|
// BEGIN - Calc Table Space - staybyte - 9 June 2001
|
||||||
if (MYSQL_MAJOR_VERSION >= 3.23 && intval(MYSQL_MINOR_VERSION) > 3 && $tbl_type != "INNODB" && isset($showtable)) {
|
if (MYSQL_MAJOR_VERSION >= 3.23 && intval(MYSQL_MINOR_VERSION) > 3 && $tbl_type != "INNODB" && isset($showtable)) {
|
||||||
// Gets some sizes
|
// Gets some sizes
|
||||||
if (isset($showtable['Type']) && $showtable['Type']=="MRG_MyISAM")
|
$mergetable=false;
|
||||||
$mergetable=true;
|
if (isset($showtable['Type']) && $showtable['Type']=="MRG_MyISAM") $mergetable=true;
|
||||||
list($data_size, $data_unit) = format_byte_down($showtable['Data_length']);
|
list($data_size, $data_unit) = format_byte_down($showtable['Data_length']);
|
||||||
if (!isset($mergetable))
|
|
||||||
list($index_size, $index_unit) = format_byte_down($showtable['Index_length']);
|
if ($mergetable==false) list($index_size, $index_unit) = format_byte_down($showtable['Index_length']);
|
||||||
|
|
||||||
if (isset($showtable['Data_free']) && $showtable['Data_free'] > 0) {
|
if (isset($showtable['Data_free']) && $showtable['Data_free'] > 0) {
|
||||||
list($free_size, $free_unit) = format_byte_down($showtable['Data_free']);
|
list($free_size, $free_unit) = format_byte_down($showtable['Data_free']);
|
||||||
}
|
}
|
||||||
@@ -328,6 +329,7 @@ if (MYSQL_MAJOR_VERSION >= 3.23 && intval(MYSQL_MINOR_VERSION) > 3 && $tbl_type
|
|||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
echo "\n";
|
echo "\n";
|
||||||
|
if (isset($tot_size) && $mergetable == false) {
|
||||||
?>
|
?>
|
||||||
<tr bgcolor="<?php echo $cfgBgcolorOne; ?>">
|
<tr bgcolor="<?php echo $cfgBgcolorOne; ?>">
|
||||||
<td style="padding-right: 10px"><?php echo ucfirst($strTotal); ?></td>
|
<td style="padding-right: 10px"><?php echo ucfirst($strTotal); ?></td>
|
||||||
@@ -335,6 +337,8 @@ if (MYSQL_MAJOR_VERSION >= 3.23 && intval(MYSQL_MINOR_VERSION) > 3 && $tbl_type
|
|||||||
<td><?php echo $tot_unit; ?></td>
|
<td><?php echo $tot_unit; ?></td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php
|
<?php
|
||||||
|
}
|
||||||
|
|
||||||
// Optimize link if overhead
|
// Optimize link if overhead
|
||||||
if (isset($free_size) && ($tbl_type == 'MYISAM' || $tbl_type == 'BDB')) {
|
if (isset($free_size) && ($tbl_type == 'MYISAM' || $tbl_type == 'BDB')) {
|
||||||
echo "\n";
|
echo "\n";
|
||||||
@@ -412,8 +416,7 @@ if (MYSQL_MAJOR_VERSION >= 3.23 && intval(MYSQL_MINOR_VERSION) > 3 && $tbl_type
|
|||||||
</tr>
|
</tr>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
if (isset($showtable['Data_length']) && $showtable['Rows'] > 0
|
if (isset($showtable['Data_length']) && $showtable['Rows'] > 0 && $mergetable==false) {
|
||||||
&& !isset($mergetable)) {
|
|
||||||
echo (++$i%2)
|
echo (++$i%2)
|
||||||
? ' <tr bgcolor="' . $cfgBgcolorTwo . '">'
|
? ' <tr bgcolor="' . $cfgBgcolorTwo . '">'
|
||||||
: ' <tr bgcolor="' . $cfgBgcolorOne . '">';
|
: ' <tr bgcolor="' . $cfgBgcolorOne . '">';
|
||||||
|
Reference in New Issue
Block a user