fixed problems with non-isam tables

This commit is contained in:
Steve Alberty
2001-08-03 17:54:53 +00:00
parent 7895ccd437
commit e79af90f65
3 changed files with 48 additions and 31 deletions

View File

@@ -29,8 +29,8 @@ $Source$
* tbl_change.php3: current value of enums was lost. * tbl_change.php3: current value of enums was lost.
2001-08-03 Steve Alberty <alberty@neptunlabs.de> 2001-08-03 Steve Alberty <alberty@neptunlabs.de>
* tbl_properties.php3, db_details.php3: fixed problem with table size * tbl_properties.php3, db_details.php3: fixed problems with table
display and MERGE tables. size display and Non-ISAM tables
* tbl_qbe.php3: remove some warnings in higher errorlevel * tbl_qbe.php3: remove some warnings in higher errorlevel
2001-08-03 Olivier M<>ller <om@omnis.ch> 2001-08-03 Olivier M<>ller <om@omnis.ch>

View File

@@ -129,30 +129,42 @@ else if (MYSQL_MAJOR_VERSION >= 3.23 && isset($tbl_cache)) {
</td> </td>
<?php <?php
echo "\n"; echo "\n";
$mergetable = FALSE; $mergetable=false;
if (isset($sts_data['Type']) && $sts_data['Type'] == 'MRG_MyISAM') { $nonisam=false;
$mergetable = TRUE; if (isset($sts_data['Type'])) {
if ($sts_data['Type']=="MRG_MyISAM") $mergetable=true;
else if (!eregi("ISAM", $sts_data['Type'])) $nonisam=true;
}
if (isset($sts_data['Rows']))
{
if ($mergetable == false){
if ($nonisam == false){
$tblsize = $sts_data['Data_length'] + $sts_data['Index_length'];
$sum_size += $tblsize;
if ($tblsize > 0) {
list($formated_size, $unit) = format_byte_down($tblsize, 3, 1);
} else {
list($formated_size, $unit) = format_byte_down($tblsize, 3, 0);
} }
if (isset($sts_data['Rows'])) { }
if ($mergetable == FALSE) { else {
$tblsize = $sts_data['Data_length'] + $sts_data['Index_length']; $formated_size="&nbsp;-&nbsp;";
$sum_size += $tblsize; $unit="";
$sum_entries += $sts_data['Rows']; }
if ($tblsize > 0) { if (isset($sts_data['Rows'])) $sum_entries += $sts_data['Rows'];
list($formated_size, $unit) = format_byte_down($tblsize, 3, 1); }
} else { // MyISAM MERGE Table
list($formated_size, $unit) = format_byte_down($tblsize, 3, 0); else if ($mergetable == true)
} {
} $formated_size="&nbsp;-&nbsp;";
// MyISAM MERGE Table $unit="";
else if ($mergetable == TRUE) { }
$formated_size = '&nbsp;-&nbsp;'; else
$unit = ''; {
} $formated_size="unknown";
else { $unit="";
$formated_size = 'unknown'; }
$unit = '';
}
?> ?>
<td align="right"> <td align="right">
<?php <?php

View File

@@ -266,16 +266,21 @@ if ($index_count > 0) {
?> ?>
<?php <?php
// 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)) { $nonisam=false;
if (!eregi("ISAM", $showtable['Type'])) $nonisam=true;
if (MYSQL_MAJOR_VERSION >= 3.23 && intval(MYSQL_MINOR_VERSION) > 3 && $nonisam==false && isset($showtable)) {
// Gets some sizes // Gets some sizes
$mergetable = FALSE; $mergetable=false;
if (isset($showtable['Type']) && $showtable['Type'] == 'MRG_MyISAM') { if (isset($showtable['Type']) && $showtable['Type']=="MRG_MyISAM") {
$mergetable = TRUE; $mergetable=true;
} }
list($data_size, $data_unit) = format_byte_down($showtable['Data_length']);
if ($mergetable == FALSE) { list($data_size, $data_unit) = format_byte_down($showtable['Data_length']);
if ($mergetable==false) {
list($index_size, $index_unit) = format_byte_down($showtable['Index_length']); 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']);
} }