From 4fb7d734016c90f49299ce9724f486058b81cdad Mon Sep 17 00:00:00 2001 From: Deven Bansod Date: Mon, 3 Oct 2016 10:50:32 +0530 Subject: [PATCH] Don't assume justBrowsing if there is a Join in the query Fix #12189 Signed-off-by: Deven Bansod --- libraries/sql.lib.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libraries/sql.lib.php b/libraries/sql.lib.php index d7c164f719..b57b1ddc1f 100644 --- a/libraries/sql.lib.php +++ b/libraries/sql.lib.php @@ -662,6 +662,7 @@ function PMA_isJustBrowsing($analyzed_sql_results, $find_real_end) && empty($analyzed_sql_results['group']) && ! isset($find_real_end) && ! $analyzed_sql_results['is_subquery'] + && ! $analyzed_sql_results['join'] && empty($analyzed_sql_results['having']); } @@ -1122,7 +1123,7 @@ function PMA_countQueryResults( ) { // c o u n t q u e r y - // If we are "just browsing", there is only one table, + // If we are "just browsing", there is only one table (and no join), // and no WHERE clause (or just 'WHERE 1 '), // we do a quick count (which uses MaxExactCount) because // SQL_CALC_FOUND_ROWS is not quick on large InnoDB tables