From 1824f33650d4da98559e4877eeba3731ff17fb85 Mon Sep 17 00:00:00 2001 From: Deven Bansod Date: Sat, 15 Oct 2016 13:32:15 +0530 Subject: [PATCH] Use justBrowsing only if outputting the results from a single table The issue #12533 happens because we use countRecords on the parent table since it is incorrectly set, while actually we should be looking at SQL_CALC_FOUND_ROWS instead. Fix #12533 Signed-off-by: Deven Bansod --- libraries/sql.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/sql.lib.php b/libraries/sql.lib.php index 3e2c714e1d..91864bd8a4 100644 --- a/libraries/sql.lib.php +++ b/libraries/sql.lib.php @@ -655,7 +655,7 @@ function PMA_isJustBrowsing($analyzed_sql_results, $find_real_end) && empty($analyzed_sql_results['union']) && empty($analyzed_sql_results['distinct']) && $analyzed_sql_results['select_from'] - && (count($analyzed_sql_results['select_tables']) <= 1) + && (count($analyzed_sql_results['select_tables']) === 1) && (empty($analyzed_sql_results['statement']->where) || (count($analyzed_sql_results['statement']->where) == 1 && $analyzed_sql_results['statement']->where[0]->expr ==='1'))