SHOW TABLE STATUS / SELECT COUNT (*) fixes continues, now configurable

This commit is contained in:
Michal Čihař
2003-04-11 11:59:44 +00:00
parent e88ea8aa51
commit 182e06e3f1
4 changed files with 21 additions and 9 deletions

View File

@@ -1224,13 +1224,13 @@ h1 {font-family: sans-serif; font-size: large; font-weight: bold}
*/
function PMA_countRecords($db, $table, $ret = FALSE)
{
global $err_url;
global $err_url, $cfg;
if (PMA_MYSQL_INT_VERSION >= 32303) {
$local_query = 'SHOW TABLE STATUS LIKE \'' . PMA_sqlAddslashes($table, TRUE) . '\' FROM \'' . PMA_sqlAddslashes($table, TRUE) . '\'';
$result = PMA_mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $err_url);
$showtable = PMA_mysql_fetch_array($result);
$num = (isset($showtable['Rows']) ? $showtable['Rows'] : 0);
if ($num < 20000) unset($num);
if ($num < $cfg['MaxExactCount']) unset($num);
mysql_free_result($result);
}
if (!isset($num)) {