<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 5.50.4807.2300" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT size=2>This patch rewrites the handling of row count and table size 
in db_details to more accurately deal with different table types such as InnoDB. 
It also re-enables the valid fields of size usage and row stats in 
tbl_properties for InnoDB tables.</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>-Josh</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV>diff -r -u phpMyAdmin-2.2.4/db_details.php 
phpMyAdmin-devel/db_details.php<BR>--- phpMyAdmin-2.2.4/db_details.php Tue Feb 
19 18:35:40 2002<BR>+++ phpMyAdmin-devel/db_details.php Thu Feb 21 12:00:00 
2002<BR>@@ -237,51 +237,43 @@<BR>     
</td><BR>         
<?php<BR>         echo 
"\n";<BR>-        
$mergetable         = 
FALSE;<BR>-        
$nonisam            = 
FALSE;<BR>-        if 
(isset($sts_data['Type'])) 
{<BR>-            if 
($sts_data['Type'] == 'MRG_MyISAM') 
{<BR>-                
$mergetable = 
TRUE;<BR>-            } 
else if (!eregi('ISAM|HEAP', $sts_data['Type'])) 
{<BR>-                
$nonisam    = 
TRUE;<BR>+<BR>+        
if(isset($sts_data['Rows'])) 
{<BR>+            # 
MyISAM, ISAM or Heap table: Row count, data size and index size is 
accurate.<BR>+            
if(isset($sts_data['Type']) && ereg('^(MyISAM|ISAM|HEAP)$', 
$sts_data['Type'])) 
{<BR>+                
$tblsize = $sts_data['Data_length'] + 
$sts_data['Index_length'];<BR>+                
$sum_size += 
$tblsize;<BR>+                
list($formated_size, $unit) =  PMA_formatByteDown($tblsize, 3, $tblsize 
> 0 ? 1 : 
0);<BR>+                
$sum_entries += 
$sts_data['Rows'];<BR>+                
$display_rows = number_format($sts_data['Rows'], 0, $number_decimal_separator, 
$number_thousands_separator);<BR>             
}<BR>-        
}<BR> <BR>-        if 
(isset($sts_data['Rows'])) 
{<BR>-            if 
($mergetable == FALSE) 
{<BR>-                
if ($cfgShowStats && $nonisam == FALSE) 
{<BR>-                    
$tblsize                        
=  $sts_data['Data_length'] + 
$sts_data['Index_length'];<BR>-                    
$sum_size                       
+= 
$tblsize;<BR>-                    
if ($tblsize > 0) 
{<BR>-                        
list($formated_size, $unit) =  PMA_formatByteDown($tblsize, 3, 
1);<BR>-                    
} else 
{<BR>-                        
list($formated_size, $unit) =  PMA_formatByteDown($tblsize, 3, 
0);<BR>-                    
}<BR>-                
} else if ($cfgShowStats) 
{<BR>-                    
$formated_size                  

'&nbsp;-&nbsp;';<BR>-                    
$unit                           

'';<BR>-                
}<BR>-                
$sum_entries                        
+= 
$sts_data['Rows'];<BR>+            
# InnoDB table: Row count is not accurate but data and index sizes 
are.<BR>+            
elseif(isset($sts_data['Type']) && $sts_data['Type'] == "InnoDB") 
{<BR>+                
$tblsize = $sts_data['Data_length'] + 
$sts_data['Index_length'];<BR>+                
$sum_size += 
$tblsize;<BR>+                
list($formated_size, $unit) =  PMA_formatByteDown($tblsize, 3, $tblsize 
> 0 ? 1 : 
0);<BR>+                
$display_rows = 
'&nbsp;-&nbsp;';<BR>             
}<BR>-            // 
MyISAM MERGE 
Table<BR>-            
else if ($cfgShowStats && $mergetable == TRUE) 
{<BR>+<BR>+            # 
Merge or BerkleyDB table: Only row count is 
accurate.<BR>+            
elseif(isset($sts_data['Type']) && ereg('^(MRG_MyISAM|BerkeleyDB)$', 
$sts_data['Type'])) 
{<BR>                 
$formated_size = 
'&nbsp;-&nbsp;';<BR>-                
$unit          = 
'';<BR>+                
$unit = 
'';<BR>+                
$sum_entries += 
$sts_data['Rows'];<BR>+                
$display_rows = number_format($sts_data['Rows'], 0, $number_decimal_separator, 
$number_thousands_separator);<BR>             
}<BR>-            else if 
($cfgShowStats) 
{<BR>+<BR>+            # 
Unknown table 
type.<BR>+            
else 
{<BR>                 
$formated_size = 
'unknown';<BR>-                
$unit          = 
'';<BR>+                
$unit = 
'';<BR>+                
$display_rows = 
'unknown';<BR>             
}<BR>+<BR>             
?><BR>     <td align="right" bgcolor="<?php echo 
$bgcolor; 
?>"><BR>-            
<?php<BR>-            
echo "\n" . '        
';<BR>-            if 
($mergetable == TRUE) 
{<BR>-                
echo '<i>' . number_format($sts_data['Rows'], 0, 
$number_decimal_separator, $number_thousands_separator) . '</i>' . 
"\n";<BR>-            } 
else 
{<BR>-                
echo number_format($sts_data['Rows'], 0, $number_decimal_separator, 
$number_thousands_separator) . 
"\n";<BR>-            
}<BR>-            
?><BR>+        <?php echo $display_rows 
. "\n"; ?><BR>     
</td><BR>     <td bgcolor="<?php echo $bgcolor; 
?>" nowrap="nowrap"><BR>         
&nbsp;<?php echo (isset($sts_data['Type']) ? $sts_data['Type'] : 
'&nbsp;'); ?>&nbsp;<BR>@@ -291,24 +283,21 
@@<BR>                 
echo 
"\n";<BR>                 
?><BR>     <td align="right" bgcolor="<?php echo 
$bgcolor; ?>" 
nowrap="nowrap"><BR>-        
&nbsp;&nbsp;<BR>-        <a 
href="tbl_properties.php?<?php echo $url_query; ?>#showusage"><?php 
echo $formated_size . ' ' . $unit; 
?></a><BR>+        
&nbsp;&nbsp;<a href="tbl_properties.php?<?php echo $url_query; 
?>#showusage"><?php echo $formated_size . ' ' . $unit; 
?></a><BR>     
</td><BR>                 
<?php<BR>-                
echo 
"\n";<BR>-            } 
// end if<BR>-        } else 
{<BR>+            
}<BR>+        
}<BR>+        else 
{<BR>             
?><BR>-    <td colspan="3" align="center" bgcolor="<?php 
echo $bgcolor; ?>"><BR>-        
<?php echo $strInUse . "\n"; ?><BR>-    
</td><BR>+<td colspan="3" align="center" bgcolor="<?php echo 
$bgcolor; ?>"><?php echo $strInUse . "\n"; 
?></td><BR>             
<?php<BR>         
}<BR>         echo 
"\n";<BR>         
?><BR> </tr><BR>         
<?php<BR>-    }<BR>+    } 
<BR>     // Show Summary<BR>     if 
($cfgShowStats) {<BR>         
list($sum_formated, $unit) = PMA_formatByteDown($sum_size, 3, 1);<BR>diff -r -u 
phpMyAdmin-2.2.4/tbl_properties.php phpMyAdmin-devel/tbl_properties.php<BR>--- 
phpMyAdmin-2.2.4/tbl_properties.php Tue Feb 19 18:35:42 2002<BR>+++ 
phpMyAdmin-devel/tbl_properties.php Thu Feb 21 11:58:15 2002<BR>@@ -484,10 
+484,11 @@<BR> // BEGIN - Calc Table Space - staybyte - 9 June 
2001<BR> if ($cfgShowStats) {<BR>     
$nonisam     = FALSE;<BR>+    $innodb = 
$showtable['Type'] == "InnoDB";<BR>     if 
(isset($showtable['Type']) && !eregi('ISAM|HEAP', $showtable['Type'])) 
{<BR>         $nonisam = 
TRUE;<BR>     }<BR>-    if 
(PMA_MYSQL_INT_VERSION >= 32303 && $nonisam == FALSE) 
{<BR>+    if (PMA_MYSQL_INT_VERSION >= 32303 && 
($nonisam == FALSE || $innodb)) 
{<BR>         // Gets some 
sizes<BR>         
$mergetable     = 
FALSE;<BR>         if 
(isset($showtable['Type']) && $showtable['Type'] == 'MRG_MyISAM') 
{<BR>@@ -613,7 +614,7 @@<BR>         
</tr><BR>             
<?php<BR>         
}<BR>-        if (isset($showtable['Rows'])) 
{<BR>+        if (!$innodb && 
isset($showtable['Rows'])) 
{<BR>             
$bgcolor = ((++$i%2) ? $cfgBgcolorTwo : 
$cfgBgcolorOne);<BR>             
echo 
"\n";<BR>             
?><BR>@@ -625,7 +626,7 @@<BR>         
</tr><BR>             
<?php<BR>         
}<BR>-        if 
(isset($showtable['Avg_row_length']) && $showtable['Avg_row_length'] 
> 0) {<BR>+        if (!$innodb && 
isset($showtable['Avg_row_length']) && $showtable['Avg_row_length'] > 
0) {<BR>             
$bgcolor = ((++$i%2) ? $cfgBgcolorTwo : 
$cfgBgcolorOne);<BR>             
echo 
"\n";<BR>             
?><BR>@@ -637,7 +638,7 @@<BR>         
</tr><BR>             
<?php<BR>         
}<BR>-        if 
(isset($showtable['Data_length']) && $showtable['Rows'] > 0 
&& $mergetable == FALSE) 
{<BR>+        if (!$innodb && 
isset($showtable['Data_length']) && $showtable['Rows'] > 0 && 
$mergetable == FALSE) 
{<BR>             
$bgcolor = ((++$i%2) ? $cfgBgcolorTwo : 
$cfgBgcolorOne);<BR>             
echo 
"\n";<BR>             
?><BR></DIV></BODY></HTML>