Bug #574855
This commit is contained in:
@@ -7,6 +7,8 @@ $Source$
|
||||
|
||||
2002-06-30 Alexander M. Turek <rabus@users.sourceforge.net>
|
||||
* user_details.php3: Added a tooltip for the new documenation link.
|
||||
* sql.php3: Fixed bug #574855 (wrong counted rows with many functions)
|
||||
thanks to Svetlozar Kovachev (svetlio).
|
||||
|
||||
2002-06-29 Marc Delisle <lem9@users.sourceforge.net>
|
||||
* tbl_qbe.php3: show upper links
|
||||
|
5
sql.php3
5
sql.php3
@@ -223,8 +223,9 @@ else {
|
||||
* $is_count is changed for more correct "LIMIT" clause appending
|
||||
* in queries like SELECT COUNT(...) FROM ... GROUP BY ...
|
||||
*/
|
||||
$is_explain = $is_count = $is_export = $is_delete = $is_insert = $is_affected = $is_show = $is_maint = $is_analyse = $is_group = FALSE;
|
||||
$is_explain = $is_count = $is_export = $is_delete = $is_insert = $is_affected = $is_show = $is_maint = $is_analyse = $is_group = $is_func = FALSE;
|
||||
if ($is_select) { // see line 76
|
||||
$is_func = !$is_group && (eregi("( SUM\s*\(| AVG\s*\(| STD\s*\(| STDDEV\s*\(| MIN\s*\(| MAX\s*\(| BIT_OR\s*\(| BIT_AND\s*\()", $sql_query));
|
||||
$is_group = eregi("( GROUP BY | HAVING | SELECT DISTINCT )", $sql_query);
|
||||
$is_count = !$is_group && (eregi('^SELECT[[:space:]]+COUNT\((.*\.+)?.*\)', $sql_query));
|
||||
$is_export = (eregi('[[:space:]]+INTO[[:space:]]+OUTFILE[[:space:]]+', $sql_query));
|
||||
@@ -249,7 +250,7 @@ else {
|
||||
if (isset($pos)
|
||||
&& (!$cfg['ShowAll'] || $session_max_rows != 'all')
|
||||
&& $is_select
|
||||
&& !($is_count || $is_export)
|
||||
&& !($is_count || $is_export || $is_func)
|
||||
&& eregi('[[:space:]]FROM[[:space:]]', $sql_query)
|
||||
&& !eregi('[[:space:]]LIMIT[[:space:]0-9,]+$', $sql_query)) {
|
||||
|
||||
|
Reference in New Issue
Block a user