bug 988723 sql error when ordering by count( * )

This commit is contained in:
Marc Delisle
2004-09-12 13:38:57 +00:00
parent efb633ff1a
commit 2a9b839203
2 changed files with 12 additions and 3 deletions

View File

@@ -5,6 +5,9 @@ phpMyAdmin - Changelog
$Id$
$Source$
2004-09-12 Marc Delisle <lem9@users.sourceforge.net>
* sql.php: bug #988723, sql error when ordering by count( * )
2004-09-11 Marc Delisle <lem9@users.sourceforge.net>
* lang/dutch: small update
* lang/chinese_simplified: updated, thanks to Simon - simon2san

12
sql.php
View File

@@ -518,15 +518,21 @@ else {
}
}
} else {
PMA_DBI_query($count_query);
PMA_DBI_try_query($count_query);
// if (mysql_error()) {
// void. I tried the case
// void.
// I tried the case
// (SELECT `User`, `Host`, `Db`, `Select_priv` FROM `db`)
// UNION (SELECT `User`, `Host`, "%" AS "Db",
// `Select_priv`
// FROM `user`) ORDER BY `User`, `Host`, `Db`;
// and although the generated count_query is wrong
// the SELECT FOUND_ROWS() work!
// the SELECT FOUND_ROWS() work! (maybe it gets the
// count from the latest query that worked)
//
// another case where the count_query is wrong:
// SELECT COUNT( * ), f1 from t1 group by f1
// and you click to sort on count( * )
// }
$cnt_all_result = PMA_DBI_query('SELECT FOUND_ROWS() as count;');
list($unlim_num_rows) = PMA_DBI_fetch_row($cnt_all_result);