From f5f751f86914f540b767aa1cf24a7c0fb65dedd0 Mon Sep 17 00:00:00 2001 From: Shailesh Jain Date: Mon, 18 Nov 2019 22:45:07 +0100 Subject: [PATCH 1/3] Fix #15465 - profiling output when the result has no rows Fixes: #15465 Signed-off-by: Shailesh Jain --- libraries/classes/Sql.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/libraries/classes/Sql.php b/libraries/classes/Sql.php index 58cceb745e..8cd213490a 100644 --- a/libraries/classes/Sql.php +++ b/libraries/classes/Sql.php @@ -1465,6 +1465,7 @@ EOT; * @param DisplayResults $displayResultsObject DisplayResult instance * @param array $extra_data extra data * @param string $pmaThemeImage uri of the theme image + * @param array|null $profiling_results profiling results * @param object $result executed query results * @param string $sql_query sql query * @param string $complete_query complete sql query @@ -1473,7 +1474,7 @@ EOT; */ private function getQueryResponseForNoResultsReturned(array $analyzed_sql_results, $db, $table, $message_to_show, $num_rows, $displayResultsObject, $extra_data, - $pmaThemeImage, $result, $sql_query, $complete_query + $pmaThemeImage, $profiling_results, $result, $sql_query, $complete_query ) { if ($this->isDeleteTransformationInfo($analyzed_sql_results)) { $this->deleteTransformationInfo($db, $table, $analyzed_sql_results); @@ -1532,6 +1533,12 @@ EOT; $analyzed_sql_results, true ); + $html_output .= $this->getHtmlForProfilingChart( + $url_query, + $db, + isset($profiling_results) ? $profiling_results : [] + ); + $html_output .= $displayResultsObject->getCreateViewQueryResultOp( $analyzed_sql_results ); @@ -2244,7 +2251,7 @@ EOT; $analyzed_sql_results, $db, $table, isset($message_to_show) ? $message_to_show : null, $num_rows, $displayResultsObject, $extra_data, - $pmaThemeImage, isset($result) ? $result : null, + $pmaThemeImage, $profiling_results, isset($result) ? $result : null, $sql_query, isset($complete_query) ? $complete_query : null ); } else { From 52c17a34d2af4f743b34c8472f092004c9623517 Mon Sep 17 00:00:00 2001 From: William Desportes Date: Mon, 18 Nov 2019 23:10:45 +0100 Subject: [PATCH 2/3] Display the chart for no rows profiling results Ref: #15465 Signed-off-by: William Desportes --- libraries/classes/Sql.php | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/libraries/classes/Sql.php b/libraries/classes/Sql.php index 8cd213490a..a09f659817 100644 --- a/libraries/classes/Sql.php +++ b/libraries/classes/Sql.php @@ -1533,11 +1533,16 @@ EOT; $analyzed_sql_results, true ); - $html_output .= $this->getHtmlForProfilingChart( - $url_query, - $db, - isset($profiling_results) ? $profiling_results : [] - ); + if (isset($profiling_results)) { + $header = $response->getHeader(); + $scripts = $header->getScripts(); + $scripts->addFile('sql.js'); + $html_output .= $this->getHtmlForProfilingChart( + $url_query, + $db, + isset($profiling_results) ? $profiling_results : [] + ); + } $html_output .= $displayResultsObject->getCreateViewQueryResultOp( $analyzed_sql_results From 9e5758e1de6c0361070fc8abf9dd6f09c7422add Mon Sep 17 00:00:00 2001 From: William Desportes Date: Mon, 18 Nov 2019 23:13:51 +0100 Subject: [PATCH 3/3] Add ChangeLog entry for #15465 Signed-off-by: William Desportes --- ChangeLog | 1 + 1 file changed, 1 insertion(+) diff --git a/ChangeLog b/ChangeLog index 36bbe61453..f322d407cf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -29,6 +29,7 @@ phpMyAdmin - ChangeLog - issue #14809 Fix error "is_uploaded_file() expects parameter 1 to be string" when inserting blobs from files - issue #15127 Fix white square when refreshing designer or browsing other pages - issue #13912 Detect when phpMyAdmin storage tables are not accessible, help users browse corrupt DBs +- issue #15465 Display profiling when query outputs no rows 4.9.1 (2019-09-20) - issue #15313 Added support for Twig 2