bug 988723 sql error when ordering by count( * )
This commit is contained in:
@@ -5,6 +5,9 @@ phpMyAdmin - Changelog
|
|||||||
$Id$
|
$Id$
|
||||||
$Source$
|
$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>
|
2004-09-11 Marc Delisle <lem9@users.sourceforge.net>
|
||||||
* lang/dutch: small update
|
* lang/dutch: small update
|
||||||
* lang/chinese_simplified: updated, thanks to Simon - simon2san
|
* lang/chinese_simplified: updated, thanks to Simon - simon2san
|
||||||
|
12
sql.php
12
sql.php
@@ -518,15 +518,21 @@ else {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
PMA_DBI_query($count_query);
|
PMA_DBI_try_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`)
|
||||||
// UNION (SELECT `User`, `Host`, "%" AS "Db",
|
// UNION (SELECT `User`, `Host`, "%" AS "Db",
|
||||||
// `Select_priv`
|
// `Select_priv`
|
||||||
// FROM `user`) ORDER BY `User`, `Host`, `Db`;
|
// FROM `user`) ORDER BY `User`, `Host`, `Db`;
|
||||||
// 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! (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;');
|
$cnt_all_result = PMA_DBI_query('SELECT FOUND_ROWS() as count;');
|
||||||
list($unlim_num_rows) = PMA_DBI_fetch_row($cnt_all_result);
|
list($unlim_num_rows) = PMA_DBI_fetch_row($cnt_all_result);
|
||||||
|
Reference in New Issue
Block a user