diff --git a/ChangeLog b/ChangeLog index ba758a29d..ec464e57d 100755 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,13 @@ phpMyAdmin - Changelog $Id$ $Source$ +2005-01-18 Marc Delisle + * sql.php, libraries/common.lib.php, /display_tbl.lib.php, /functions.js, + lang/*.php: bug #1084820: ask a confirmation when a user wants to + reach the End of rows, and count the exact number of rows to + go to the real end + TODO: page number selector + 2005-01-18 Alexander M. Turek * server_engines.php, server_links.php libraries/storage_engines.lib.php: Emulation for < MySQL 4.1.2. diff --git a/libraries/common.lib.php b/libraries/common.lib.php index f00c8b22a..a4fa27435 100644 --- a/libraries/common.lib.php +++ b/libraries/common.lib.php @@ -1532,21 +1532,24 @@ h1 {font-family: sans-serif; font-size: large; font-weight: bold} * @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 is required, true else * * @access public */ - function PMA_countRecords($db, $table, $ret = FALSE) + function PMA_countRecords($db, $table, $ret = FALSE, $force_exact = FALSE) { global $err_url, $cfg; - $result = PMA_DBI_query('SHOW TABLE STATUS FROM ' . PMA_backquote($db) . ' LIKE \'' . PMA_sqlAddslashes($table, TRUE) . '\';'); - $showtable = PMA_DBI_fetch_assoc($result); - $num = (isset($showtable['Rows']) ? $showtable['Rows'] : 0); - if ($num < $cfg['MaxExactCount']) { - unset($num); + if (!$force_exact) { + $result = PMA_DBI_query('SHOW TABLE STATUS FROM ' . PMA_backquote($db) . ' LIKE \'' . PMA_sqlAddslashes($table, TRUE) . '\';'); + $showtable = PMA_DBI_fetch_assoc($result); + $num = (isset($showtable['Rows']) ? $showtable['Rows'] : 0); + if ($num < $cfg['MaxExactCount']) { + unset($num); + } + PMA_DBI_free_result($result); } - PMA_DBI_free_result($result); if (!isset($num)) { $result = PMA_DBI_query('SELECT COUNT(*) AS num FROM ' . PMA_backquote($db) . '.' . PMA_backquote($table)); diff --git a/libraries/display_tbl.lib.php b/libraries/display_tbl.lib.php index fcf33ba49..135d92897 100644 --- a/libraries/display_tbl.lib.php +++ b/libraries/display_tbl.lib.php @@ -329,12 +329,19 @@ function PMA_displayTableNavigation($pos_next, $pos_prev, $encoded_query) + $GLOBALS['cfg']['MaxExactCount']) { + echo '' . "\n"; + // no backquote around this message + $onclick = ' onclick="return confirmAction(\'' . PMA_jsFormat($GLOBALS['strLongOperation'], FALSE) . '\')"'; + } + ?> - /> + />