From 1431625d68f103b8d80173af214a5bc4e39b92c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Tue, 19 Jan 2016 11:45:52 +0100 Subject: [PATCH] Fixes possible error when query is empty/not analyzed MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes #11873 Signed-off-by: Michal Čihař --- libraries/sql.lib.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libraries/sql.lib.php b/libraries/sql.lib.php index 20b0fe6fd7..ba054d3674 100644 --- a/libraries/sql.lib.php +++ b/libraries/sql.lib.php @@ -1093,6 +1093,11 @@ function PMA_countQueryResults( $num_rows, $justBrowsing, $db, $table, $analyzed_sql_results ) { + /* Shortcut for not analyzed/empty query */ + if (empty($analyzed_sql_results)) { + return 0; + } + if (!PMA_isAppendLimitClause($analyzed_sql_results)) { // if we did not append a limit, set this to get a correct // "Showing rows..." message