diff --git a/tbl_properties.php3 b/tbl_properties.php3
index 5ca8b91da..65e76025a 100755
--- a/tbl_properties.php3
+++ b/tbl_properties.php3
@@ -3,7 +3,7 @@
require("./grab_globals.inc.php3");
-
+
if(!isset($message))
{
@@ -17,15 +17,22 @@ else
unset($sql_query);
mysql_select_db($db);
-if(MYSQL_MAJOR_VERSION == "3.23")
- {
- if(isset($submitcomment))
- $result = mysql_query("ALTER TABLE $table comment='$comment'") or mysql_die();
- $result = mysql_query("SHOW TABLE STATUS LIKE '$table'") or mysql_die();
- $row = mysql_fetch_array($result);
- if (!empty($row['Comment']))
- echo "" . $row['Comment'] . "
\n";
+// 'show table' works correct since 3.23.03
+if(MYSQL_MAJOR_VERSION == "3.23" && intval(MYSQL_MINOR_VERSION)>=3)
+{
+ $result = mysql_query("SHOW TABLE STATUS LIKE '$table'") or mysql_die();
+ $showtable = mysql_fetch_array($result);
+ $show_comment=$showtable['Comment'];
+ $tbl_type=strtoupper($showtable['Type']);
+ if(isset($submitcomment))
+ $result = mysql_query("ALTER TABLE $table comment='$comment'") or mysql_die();
+ if(isset($submittype))
+ $result = mysql_query("ALTER TABLE $table TYPE=$tbl_type") or mysql_die();
+ if (!empty($showtable['Comment'])){
+ echo "" . $showtable['Comment'] . "
\n";
+ $show_comment=$showtable['Comment'];
+ }
}
$result = mysql_query("SHOW KEYS FROM $table") or mysql_die();
@@ -71,13 +78,18 @@ while($row= mysql_fetch_array($result))
$Type = stripslashes($row["Type"]);
} else {
$Type = $row["Type"];
+ }
+ // reformat mysql query output - staybyte - 9. June 2001
+ $shorttype=substr($Type,0,3);
+ if ($shorttype=="set" || $shorttype=="enu"){
+ $Type=eregi_replace (",",", ",$Type);
}
$Type = eregi_replace("BINARY", "", $Type);
$Type = eregi_replace("ZEROFILL", "", $Type);
$Type = eregi_replace("UNSIGNED", "", $Type);
- echo $Type;
- ?>
-
+ if (!empty($Type)) echo $Type;
+ else echo " ";
+ ?> |
- |
- |
+
+ |
|
|
@@ -109,14 +122,18 @@ while($row= mysql_fetch_array($result))
}
?>
+
+
+
0)
+$indexcount=mysql_num_rows($result);
+if($indexcount>0)
{
- ?>
-
- >
+echo "\n";
+if (!empty($strIndexes)) echo $strIndexes.":\n";
+?>
+>
|
|
@@ -124,7 +141,7 @@ if(mysql_num_rows($result)>0)
|
";
@@ -154,13 +171,117 @@ if(mysql_num_rows($result)>0)
}
print " \n";
print show_docu("manual_Performance.html#MySQL_indexes");
+ echo " | \n";
}
+// BEGIN - Calc Table Space - staybyte - 9 June 2001
+if (MYSQL_MAJOR_VERSION == "3.23" && intval(MYSQL_MINOR_VERSION)>3 && $tbl_type!="INNODB" && isset($showtable)){
+ echo "0) echo " align=center";
+ echo " valign=top>\n";
+ if (!empty($strSpaceUsage)) echo $strSpaceUsage.":\n";
+ echo "\n";
+ echo "$strType | ";
+ echo "";
+ if (!empty($strUsage)) echo $strUsage;
+ echo " | ";
+
+ // Data
+ echo "\n";
+ list($size,$unit)=format_byte_down($showtable["Data_length"]);
+ echo "";
+ if (!empty($strData)) echo $strData;
+ echo " | ".$size." | ".$unit." | ";
+ echo " \n";
+ // Index
+ echo "\n";
+ list($size,$unit)=format_byte_down($showtable["Index_length"]);
+ echo "$strIndex | ".$size." | ".$unit." | ";
+ echo " \n";
+ // Overhead
+ if (!empty($showtable["Data_free"])){
+ echo "\n";
+ list($size,$unit)=format_byte_down($showtable["Data_free"]);
+ echo "";
+ if (!empty($strOverhead)) echo $strOverhead;
+ echo " | ".$size." | ".$unit." | ";
+ echo " \n";
+ // Effective
+ echo "\n";
+ list($size,$unit)=format_byte_down($showtable["Data_length"]+$showtable["Index_length"]-$showtable["Data_free"]);
+ echo "";
+ if (!empty($strOverhead)) echo $strEffective;
+ echo " | ".$size." | ".$unit." | ";
+ echo " \n";
+ }
+ // Total
+ echo "\n";
+ list($size,$unit)=format_byte_down($showtable["Data_length"]+$showtable["Index_length"]);
+ echo "$strTotal | ".$size." | ".$unit." | ";
+ echo " \n";
+
+ if (!empty($showtable["Data_free"])){
+ echo "";
+ echo "";
+ $query = "server=$server&lang=$lang&db=$db&table=$table&goto=tbl_properties.php3";
+ echo "[$strOptimizeTable]";
+ echo " | ";
+ echo " \n";
+ }
+ echo " \n";
+ echo " | \n";
+
+// Rows Statistic
+ echo "0) echo " align=center";
+ echo " valign=top>\n";
+ if (!empty($strRowsStatistic)) echo $strRowsStatistic.":\n";
+ echo "\n";
+ echo "";
+ if (!empty($strStatement)) echo $strStatement;
+ echo " | ";
+ echo "";
+ if (!empty($strValue)) echo $strValue;
+ echo " | \n";
+
+ $i=0;
+ if (isset($showtable["Row_format"])){
+ echo (++$i%2)?"":" | \n";
+ if (!empty($strFormat)) echo $strFormat;
+ echo " | ";
+ if ($showtable["Row_format"]=="Fixed" && !empty($strFixed)) echo $strFixed;
+ else if ($showtable["Row_format"]=="Dynamic" && !empty($strDynamic)) echo $strDynamic;
+ else echo $showtable["Row_format"];
+ echo " | \n";
+ }
+ if (isset($showtable["Rows"])){
+ echo (++$i%2)?"":" | \n";
+ if (!empty($strRows)) echo $strRows;
+ echo " | ".$showtable["Rows"]." | \n";
+ }
+ if (isset($showtable["Avg_row_length"])){
+ echo (++$i%2)?"":" | \n";
+ if (!empty($strRowLength)) echo $strRowLength;
+ echo " ø";
+ echo " | ".$showtable["Avg_row_length"]." | \n";
+ }
+ if (isset($showtable["Auto_increment"])){
+ echo (++$i%2)?"":" | \n";
+ echo "$strNext Autoindex";
+ echo " | ".$showtable["Auto_increment"]." | \n";
+ }
+
+ echo " \n";
+}
+// END - Calc Table Space
?>
- |
+
+
+
+ | |
+
+ |
-
-
+ |
+
+ |
+
- |
+ |
+ |
+: |
+
-
- |
+ |
+
+ |
+
+ |
+ |
|