From 94adb5612a67dd9256c5163fd474e4881726f127 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Chapeaux?= Date: Wed, 27 Feb 2002 20:23:08 +0000 Subject: [PATCH] "SHOW TABLE STATUS" requires MySQL 3.23.03+ --- db_stats.php3 | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/db_stats.php3 b/db_stats.php3 index c02bc30fd..d095b597b 100644 --- a/db_stats.php3 +++ b/db_stats.php3 @@ -224,20 +224,23 @@ if ($num_dbs > 0) { $dbs_array[$db][2] = 0; // index size column $dbs_array[$db][3] = 0; // full size column - $local_query = 'SHOW TABLE STATUS FROM ' . PMA_backquote($db); - $result = @mysql_query($local_query); - // needs the "@" below otherwise, warnings in case of special DB names - if (@mysql_num_rows($result)) { - while ($row = mysql_fetch_array($result)) { - $dbs_array[$db][1] += $row['Data_length']; - $dbs_array[$db][2] += $row['Index_length']; - } - $dbs_array[$db][3] = $dbs_array[$db][1] + $dbs_array[$db][2]; - $total_array[1] += $dbs_array[$db][1]; - $total_array[2] += $dbs_array[$db][2]; - $total_array[3] += $dbs_array[$db][3]; - } // end if - mysql_free_result($result); + if (PMA_MYSQL_INT_VERSION >= 32303) { + $local_query = 'SHOW TABLE STATUS FROM ' . PMA_backquote($db); + $result = @mysql_query($local_query); + // needs the "@" below otherwise, warnings in case of special DB names + if (@mysql_num_rows($result)) { + while ($row = mysql_fetch_array($result)) { + $dbs_array[$db][1] += $row['Data_length']; + $dbs_array[$db][2] += $row['Index_length']; + } + $dbs_array[$db][3] = $dbs_array[$db][1] + $dbs_array[$db][2]; + $total_array[1] += $dbs_array[$db][1]; + $total_array[2] += $dbs_array[$db][2]; + $total_array[3] += $dbs_array[$db][3]; + } // end if + mysql_free_result($result); + } // end if MySQL 3.23.03+ + } // end for mysql_close();