From c4d14774c35716e2236801ed9e7f538a98bdd78a Mon Sep 17 00:00:00 2001 From: Samith Dassanayake Date: Wed, 20 Feb 2013 23:38:53 +0530 Subject: [PATCH 1/2] Fixed #3833 Undefined variable: sql_limit_to_append. Initialized the varible sql_limit_to_append, Since isset($x) returns true when $x=''(which is not the expected behaviour of the usage), used the function empty() --- libraries/Util.class.php | 2 +- sql.php | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/libraries/Util.class.php b/libraries/Util.class.php index 1922bf0e6b..70aba0d16d 100644 --- a/libraries/Util.class.php +++ b/libraries/Util.class.php @@ -1145,7 +1145,7 @@ class PMA_Util */ if (isset($analyzed_display_query[0]['queryflags']['select_from']) - && isset($GLOBALS['sql_limit_to_append']) + && !empty($GLOBALS['sql_limit_to_append']) ) { $query_base = $analyzed_display_query[0]['section_before_limit'] . "\n" . $GLOBALS['sql_limit_to_append'] diff --git a/sql.php b/sql.php index 7b18b1d10b..2f5717f511 100644 --- a/sql.php +++ b/sql.php @@ -560,6 +560,7 @@ if ($GLOBALS['cfg']['RememberSorting'] PMA_handleSortOrder($db, $table, $analyzed_sql, $full_sql_query); } +$sql_limit_to_append = ''; // Do append a "LIMIT" clause? if (($_SESSION['tmp_user_values']['max_rows'] != 'all') && ! ($is_count || $is_export || $is_func || $is_analyse) From 1ebace0afd78a2469bdc9a454d9317293131e4c6 Mon Sep 17 00:00:00 2001 From: Samith Dassanayake Date: Thu, 21 Feb 2013 19:35:59 +0530 Subject: [PATCH 2/2] Fixed coding style issue --- libraries/Util.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/Util.class.php b/libraries/Util.class.php index 70aba0d16d..ee1481dfcf 100644 --- a/libraries/Util.class.php +++ b/libraries/Util.class.php @@ -1145,7 +1145,7 @@ class PMA_Util */ if (isset($analyzed_display_query[0]['queryflags']['select_from']) - && !empty($GLOBALS['sql_limit_to_append']) + && ! empty($GLOBALS['sql_limit_to_append']) ) { $query_base = $analyzed_display_query[0]['section_before_limit'] . "\n" . $GLOBALS['sql_limit_to_append']