This commit is contained in:
Alexander M. Turek
2002-06-30 10:14:44 +00:00
parent f84f215a27
commit f6e74dd1a9
2 changed files with 6 additions and 3 deletions

View File

@@ -7,6 +7,8 @@ $Source$
2002-06-30 Alexander M. Turek <rabus@users.sourceforge.net> 2002-06-30 Alexander M. Turek <rabus@users.sourceforge.net>
* user_details.php3: Added a tooltip for the new documenation link. * 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> 2002-06-29 Marc Delisle <lem9@users.sourceforge.net>
* tbl_qbe.php3: show upper links * tbl_qbe.php3: show upper links

View File

@@ -223,8 +223,9 @@ else {
* $is_count is changed for more correct "LIMIT" clause appending * $is_count is changed for more correct "LIMIT" clause appending
* in queries like SELECT COUNT(...) FROM ... GROUP BY ... * 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 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_group = eregi("( GROUP BY | HAVING | SELECT DISTINCT )", $sql_query);
$is_count = !$is_group && (eregi('^SELECT[[:space:]]+COUNT\((.*\.+)?.*\)', $sql_query)); $is_count = !$is_group && (eregi('^SELECT[[:space:]]+COUNT\((.*\.+)?.*\)', $sql_query));
$is_export = (eregi('[[:space:]]+INTO[[:space:]]+OUTFILE[[:space:]]+', $sql_query)); $is_export = (eregi('[[:space:]]+INTO[[:space:]]+OUTFILE[[:space:]]+', $sql_query));
@@ -249,7 +250,7 @@ else {
if (isset($pos) if (isset($pos)
&& (!$cfg['ShowAll'] || $session_max_rows != 'all') && (!$cfg['ShowAll'] || $session_max_rows != 'all')
&& $is_select && $is_select
&& !($is_count || $is_export) && !($is_count || $is_export || $is_func)
&& eregi('[[:space:]]FROM[[:space:]]', $sql_query) && eregi('[[:space:]]FROM[[:space:]]', $sql_query)
&& !eregi('[[:space:]]LIMIT[[:space:]0-9,]+$', $sql_query)) { && !eregi('[[:space:]]LIMIT[[:space:]0-9,]+$', $sql_query)) {