remove deprecated parameter of PMA_Table::countRecords()
This commit is contained in:
@@ -802,7 +802,7 @@ if (isset($Field) && count($Field) > 0) {
|
|||||||
$checked_tables = $col_cand;
|
$checked_tables = $col_cand;
|
||||||
foreach ($col_cand as $tab) {
|
foreach ($col_cand as $tab) {
|
||||||
if ($checked_tables[$tab] != 1) {
|
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;
|
$checked_tables[$tab] = 1;
|
||||||
}
|
}
|
||||||
$csize[$tab] = $tsize[$tab];
|
$csize[$tab] = $tsize[$tab];
|
||||||
|
@@ -192,7 +192,7 @@ foreach ($tables as $keyname => $each_table) {
|
|||||||
case 'MEMORY' :
|
case 'MEMORY' :
|
||||||
if ($db_is_information_schema) {
|
if ($db_is_information_schema) {
|
||||||
$each_table['Rows'] = PMA_Table::countRecords($db,
|
$each_table['Rows'] = PMA_Table::countRecords($db,
|
||||||
$each_table['Name'], $return = true);
|
$each_table['Name']);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($is_show_stats) {
|
if ($is_show_stats) {
|
||||||
@@ -212,7 +212,7 @@ foreach ($tables as $keyname => $each_table) {
|
|||||||
if ($each_table['TABLE_ROWS'] < $GLOBALS['cfg']['MaxExactCount']) {
|
if ($each_table['TABLE_ROWS'] < $GLOBALS['cfg']['MaxExactCount']) {
|
||||||
$each_table['COUNTED'] = true;
|
$each_table['COUNTED'] = true;
|
||||||
$each_table['TABLE_ROWS'] = PMA_Table::countRecords($db,
|
$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);
|
$is_view = false);
|
||||||
} else {
|
} else {
|
||||||
$each_table['COUNTED'] = false;
|
$each_table['COUNTED'] = false;
|
||||||
@@ -241,7 +241,7 @@ foreach ($tables as $keyname => $each_table) {
|
|||||||
if ($each_table['TABLE_TYPE'] == 'VIEW') {
|
if ($each_table['TABLE_TYPE'] == 'VIEW') {
|
||||||
// countRecords() takes care of $cfg['MaxExactCountViews']
|
// countRecords() takes care of $cfg['MaxExactCountViews']
|
||||||
$each_table['TABLE_ROWS'] = PMA_Table::countRecords($db,
|
$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);
|
$is_view = true);
|
||||||
$table_is_view = true;
|
$table_is_view = true;
|
||||||
}
|
}
|
||||||
|
@@ -199,7 +199,7 @@ class PMA_Table
|
|||||||
|
|
||||||
if ($this->get('TABLE_ROWS') === null) {
|
if ($this->get('TABLE_ROWS') === null) {
|
||||||
$this->set('TABLE_ROWS', PMA_Table::countRecords($this->getDbName(),
|
$this->set('TABLE_ROWS', PMA_Table::countRecords($this->getDbName(),
|
||||||
$this->getName(), true, true));
|
$this->getName(), true));
|
||||||
}
|
}
|
||||||
|
|
||||||
$create_options = explode(' ', $this->get('TABLE_ROWS'));
|
$create_options = explode(' ', $this->get('TABLE_ROWS'));
|
||||||
@@ -241,7 +241,7 @@ class PMA_Table
|
|||||||
static public function sGetToolTip($db, $table)
|
static public function sGetToolTip($db, $table)
|
||||||
{
|
{
|
||||||
return PMA_Table::sGetStatusInfo($db, $table, 'Comment')
|
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 database name
|
||||||
* @param string the current table 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
|
* @param boolean whether to force an exact count
|
||||||
*
|
*
|
||||||
* @return mixed the number of records if "retain" param is true,
|
* @return mixed the number of records if "retain" param is true,
|
||||||
@@ -411,8 +410,7 @@ class PMA_Table
|
|||||||
*
|
*
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
static public function countRecords($db, $table, $ret = false,
|
static public function countRecords($db, $table, $force_exact = false, $is_view = null)
|
||||||
$force_exact = false, $is_view = null)
|
|
||||||
{
|
{
|
||||||
if (isset(PMA_Table::$cache[$db][$table]['ExactRows'])) {
|
if (isset(PMA_Table::$cache[$db][$table]['ExactRows'])) {
|
||||||
$row_count = 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;
|
||||||
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 ' '
|
|
||||||
. sprintf($GLOBALS['strViewHasAtLeast'],
|
|
||||||
$GLOBALS['cfg']['MaxExactCount'],
|
|
||||||
'[a@./Documentation.html#cfg_MaxExactCount@_blank]', '[/a]');
|
|
||||||
}
|
|
||||||
} // end of the 'PMA_Table::countRecords()' function
|
} // end of the 'PMA_Table::countRecords()' function
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -811,8 +811,7 @@ function PMA_getTableList($db, $tables = null, $limit_offset = 0, $limit_count =
|
|||||||
$tbl_is_view = PMA_Table::isView($db, $table['Name']);
|
$tbl_is_view = PMA_Table::isView($db, $table['Name']);
|
||||||
|
|
||||||
if ($tbl_is_view || 'information_schema' == $db) {
|
if ($tbl_is_view || 'information_schema' == $db) {
|
||||||
$table['Rows'] = PMA_Table::countRecords($db, $table['Name'],
|
$table['Rows'] = PMA_Table::countRecords($db, $table['Name']);
|
||||||
$return = true);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -109,7 +109,7 @@ echo PMA_pluginGetJavascript($export_list);
|
|||||||
<?php
|
<?php
|
||||||
echo sprintf($strDumpXRows,
|
echo sprintf($strDumpXRows,
|
||||||
'<input type="text" name="limit_to" size="5" value="'
|
'<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()" />',
|
. '" onfocus="this.select()" />',
|
||||||
'<input type="text" name="limit_from" value="0" size="5"'
|
'<input type="text" name="limit_from" value="0" size="5"'
|
||||||
.' onfocus="this.select()" /> ');
|
.' onfocus="this.select()" /> ');
|
||||||
|
@@ -160,7 +160,7 @@ function PMA_setDisplayMode(&$the_disp_mode, &$the_total)
|
|||||||
$the_total = $unlim_num_rows;
|
$the_total = $unlim_num_rows;
|
||||||
} elseif (($do_display['nav_bar'] == '1' || $do_display['sort_lnk'] == '1')
|
} elseif (($do_display['nav_bar'] == '1' || $do_display['sort_lnk'] == '1')
|
||||||
&& (strlen($db) && !empty($table))) {
|
&& (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
|
// 4. If navigation bar or sorting fields names URLs should be
|
||||||
|
@@ -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
|
// 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 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']) {
|
if ($override_total == true || $the_total < $GLOBALS['cfg']['ForeignKeyMaxLimit']) {
|
||||||
// foreign_display can be FALSE if no display field defined:
|
// foreign_display can be FALSE if no display field defined:
|
||||||
|
@@ -86,7 +86,7 @@ if ($showtable) {
|
|||||||
|
|
||||||
if (null === $showtable['Rows']) {
|
if (null === $showtable['Rows']) {
|
||||||
$showtable['Rows'] = PMA_Table::countRecords($GLOBALS['db'],
|
$showtable['Rows'] = PMA_Table::countRecords($GLOBALS['db'],
|
||||||
$showtable['Name'], true, true);
|
$showtable['Name'], true);
|
||||||
}
|
}
|
||||||
$table_info_num_rows = isset($showtable['Rows']) ? $showtable['Rows'] : 0;
|
$table_info_num_rows = isset($showtable['Rows']) ? $showtable['Rows'] : 0;
|
||||||
$row_format = isset($showtable['Row_format']) ? $showtable['Row_format'] : '';
|
$row_format = isset($showtable['Row_format']) ? $showtable['Row_format'] : '';
|
||||||
|
4
sql.php
4
sql.php
@@ -96,7 +96,7 @@ PMA_displayTable_checkConfigParams();
|
|||||||
* Need to find the real end of rows?
|
* Need to find the real end of rows?
|
||||||
*/
|
*/
|
||||||
if (isset($find_real_end) && $find_real_end) {
|
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']);
|
$_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"
|
// "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 "
|
} else { // n o t " j u s t b r o w s i n g "
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user