bug 760648

This commit is contained in:
Marc Delisle
2003-06-27 12:48:01 +00:00
parent ddda7c6455
commit f320c80dee
2 changed files with 10 additions and 6 deletions

View File

@@ -5,6 +5,9 @@ phpMyAdmin - Changelog
$Id$ $Id$
$Source$ $Source$
2003-06-27 Marc Delisle <lem9@users.sourceforge.net>
* sql.php3: bug 760648: incorrect result count on MySQL 3
2003-06-26 Marc Delisle <lem9@users.sourceforge.net> 2003-06-26 Marc Delisle <lem9@users.sourceforge.net>
* lang/ukrainian: update, thanks to Markijan Baran * lang/ukrainian: update, thanks to Markijan Baran
* libraries/sqlparser.lib.php3 typo * libraries/sqlparser.lib.php3 typo

View File

@@ -420,11 +420,12 @@ else {
// do not put the order_by_clause, it interferes // do not put the order_by_clause, it interferes
// run the count query // run the count query
if (PMA_MYSQL_INT_VERSION < 40000) { if (PMA_MYSQL_INT_VERSION < 40000) {
if ($cnt_all_result = mysql_query($count_query)) { if ($cnt_all_result = PMA_mysql_query($count_query)) {
if ($is_group) { //if ($is_group) {
if ($count_what == '*') {
$unlim_num_rows = @mysql_num_rows($cnt_all_result); $unlim_num_rows = @mysql_num_rows($cnt_all_result);
} else { } else {
$unlim_num_rows = mysql_result($cnt_all_result, 0, 'count'); $unlim_num_rows = PMA_mysql_result($cnt_all_result, 0, 'count');
} }
mysql_free_result($cnt_all_result); mysql_free_result($cnt_all_result);
} else { } else {
@@ -439,7 +440,7 @@ else {
} }
} }
} else { } else {
mysql_query($count_query); PMA_mysql_query($count_query);
if (mysql_error()) { if (mysql_error()) {
// void. I tried the case // void. I tried the case
// (SELECT `User`, `Host`, `Db`, `Select_priv` FROM `db`) // (SELECT `User`, `Host`, `Db`, `Select_priv` FROM `db`)
@@ -449,8 +450,8 @@ else {
// and although the generated count_query is wrong // and although the generated count_query is wrong
// the SELECT FOUND_ROWS() work! // the SELECT FOUND_ROWS() work!
} }
$cnt_all_result = mysql_query('SELECT FOUND_ROWS() as count'); $cnt_all_result = PMA_mysql_query('SELECT FOUND_ROWS() as count');
$unlim_num_rows = mysql_result($cnt_all_result,0,'count'); $unlim_num_rows = PMA_mysql_result($cnt_all_result,0,'count');
} }
} // end else "just browsing" } // end else "just browsing"