remove deprecated parameter of PMA_Table::countRecords()

This commit is contained in:
Marc Delisle
2009-10-23 10:02:09 +00:00
parent 5211a88350
commit 1419fcf3c2
9 changed files with 15 additions and 33 deletions

View File

@@ -802,7 +802,7 @@ if (isset($Field) && count($Field) > 0) {
$checked_tables = $col_cand;
foreach ($col_cand as $tab) {
if ($checked_tables[$tab] != 1) {
$tsize[$tab] = PMA_Table::countRecords($db, $tab, true, false);
$tsize[$tab] = PMA_Table::countRecords($db, $tab, false);
$checked_tables[$tab] = 1;
}
$csize[$tab] = $tsize[$tab];

View File

@@ -192,7 +192,7 @@ foreach ($tables as $keyname => $each_table) {
case 'MEMORY' :
if ($db_is_information_schema) {
$each_table['Rows'] = PMA_Table::countRecords($db,
$each_table['Name'], $return = true);
$each_table['Name']);
}
if ($is_show_stats) {
@@ -212,7 +212,7 @@ foreach ($tables as $keyname => $each_table) {
if ($each_table['TABLE_ROWS'] < $GLOBALS['cfg']['MaxExactCount']) {
$each_table['COUNTED'] = true;
$each_table['TABLE_ROWS'] = PMA_Table::countRecords($db,
$each_table['TABLE_NAME'], $return = true, $force_exact = true,
$each_table['TABLE_NAME'], $force_exact = true,
$is_view = false);
} else {
$each_table['COUNTED'] = false;
@@ -241,7 +241,7 @@ foreach ($tables as $keyname => $each_table) {
if ($each_table['TABLE_TYPE'] == 'VIEW') {
// countRecords() takes care of $cfg['MaxExactCountViews']
$each_table['TABLE_ROWS'] = PMA_Table::countRecords($db,
$each_table['TABLE_NAME'], $return = true, $force_exact = true,
$each_table['TABLE_NAME'], $force_exact = true,
$is_view = true);
$table_is_view = true;
}

View File

@@ -199,7 +199,7 @@ class PMA_Table
if ($this->get('TABLE_ROWS') === null) {
$this->set('TABLE_ROWS', PMA_Table::countRecords($this->getDbName(),
$this->getName(), true, true));
$this->getName(), true));
}
$create_options = explode(' ', $this->get('TABLE_ROWS'));
@@ -241,7 +241,7 @@ class PMA_Table
static public function sGetToolTip($db, $table)
{
return PMA_Table::sGetStatusInfo($db, $table, 'Comment')
. ' (' . PMA_Table::countRecords($db, $table, true) . ')';
. ' (' . PMA_Table::countRecords($db, $table) . ')';
}
/**
@@ -403,7 +403,6 @@ class PMA_Table
*
* @param string the current database name
* @param string the current table name
* @param boolean whether to retain or to displays the result
* @param boolean whether to force an exact count
*
* @return mixed the number of records if "retain" param is true,
@@ -411,8 +410,7 @@ class PMA_Table
*
* @access public
*/
static public function countRecords($db, $table, $ret = false,
$force_exact = false, $is_view = null)
static public function countRecords($db, $table, $force_exact = false, $is_view = null)
{
if (isset(PMA_Table::$cache[$db][$table]['ExactRows'])) {
$row_count = PMA_Table::$cache[$db][$table]['ExactRows'];
@@ -464,22 +462,7 @@ class PMA_Table
}
}
if ($ret) {
return $row_count;
}
/**
* @deprecated at the moment nowhere is $return = false used
*/
// Note: as of PMA 2.8.0, we no longer seem to be using
// PMA_Table::countRecords() in display mode.
echo PMA_formatNumber($row_count, 0);
if ($is_view) {
echo '&nbsp;'
. sprintf($GLOBALS['strViewHasAtLeast'],
$GLOBALS['cfg']['MaxExactCount'],
'[a@./Documentation.html#cfg_MaxExactCount@_blank]', '[/a]');
}
return $row_count;
} // end of the 'PMA_Table::countRecords()' function
/**

View File

@@ -811,8 +811,7 @@ function PMA_getTableList($db, $tables = null, $limit_offset = 0, $limit_count =
$tbl_is_view = PMA_Table::isView($db, $table['Name']);
if ($tbl_is_view || 'information_schema' == $db) {
$table['Rows'] = PMA_Table::countRecords($db, $table['Name'],
$return = true);
$table['Rows'] = PMA_Table::countRecords($db, $table['Name']);
}
}

View File

@@ -109,7 +109,7 @@ echo PMA_pluginGetJavascript($export_list);
<?php
echo sprintf($strDumpXRows,
'<input type="text" name="limit_to" size="5" value="'
. (isset($unlim_num_rows) ? $unlim_num_rows : PMA_Table::countRecords($db, $table, TRUE))
. (isset($unlim_num_rows) ? $unlim_num_rows : PMA_Table::countRecords($db, $table))
. '" onfocus="this.select()" />',
'<input type="text" name="limit_from" value="0" size="5"'
.' onfocus="this.select()" /> ');

View File

@@ -160,7 +160,7 @@ function PMA_setDisplayMode(&$the_disp_mode, &$the_total)
$the_total = $unlim_num_rows;
} elseif (($do_display['nav_bar'] == '1' || $do_display['sort_lnk'] == '1')
&& (strlen($db) && !empty($table))) {
$the_total = PMA_Table::countRecords($db, $table, true);
$the_total = PMA_Table::countRecords($db, $table);
}
// 4. If navigation bar or sorting fields names URLs should be

View File

@@ -1003,7 +1003,7 @@ function PMA_getForeignData($foreigners, $field, $override_total, $foreign_filte
// We could also do the SELECT anyway, with a LIMIT, and ensure that
// the current value of the field is one of the choices.
$the_total = PMA_Table::countRecords($foreign_db, $foreign_table, TRUE);
$the_total = PMA_Table::countRecords($foreign_db, $foreign_table);
if ($override_total == true || $the_total < $GLOBALS['cfg']['ForeignKeyMaxLimit']) {
// foreign_display can be FALSE if no display field defined:

View File

@@ -86,7 +86,7 @@ if ($showtable) {
if (null === $showtable['Rows']) {
$showtable['Rows'] = PMA_Table::countRecords($GLOBALS['db'],
$showtable['Name'], true, true);
$showtable['Name'], true);
}
$table_info_num_rows = isset($showtable['Rows']) ? $showtable['Rows'] : 0;
$row_format = isset($showtable['Row_format']) ? $showtable['Row_format'] : '';

View File

@@ -96,7 +96,7 @@ PMA_displayTable_checkConfigParams();
* Need to find the real end of rows?
*/
if (isset($find_real_end) && $find_real_end) {
$unlim_num_rows = PMA_Table::countRecords($db, $table, true, true);
$unlim_num_rows = PMA_Table::countRecords($db, $table, $force_exact = true);
$_SESSION['tmp_user_values']['pos'] = @((ceil($unlim_num_rows / $_SESSION['tmp_user_values']['max_rows']) - 1) * $_SESSION['tmp_user_values']['max_rows']);
}
@@ -396,7 +396,7 @@ if (isset($GLOBALS['show_as_php']) || !empty($GLOBALS['validatequery'])) {
) {
// "j u s t b r o w s i n g"
$unlim_num_rows = PMA_Table::countRecords($db, $table, true);
$unlim_num_rows = PMA_Table::countRecords($db, $table);
} else { // n o t " j u s t b r o w s i n g "