From 1f4affcb1e74fea21707c28fbd98c3bb19bd781b Mon Sep 17 00:00:00 2001 From: Akshay Joshi Date: Thu, 8 Apr 2021 18:49:13 +0530 Subject: [PATCH] =?UTF-8?q?Fixed=20an=20issue=20where=20a=20connection=20w?= =?UTF-8?q?arning=20should=20be=20displayed=C2=A0when=20the=20user=20click?= =?UTF-8?q?s=20on=20explain=20or=20explain=20analyze=20and=20the=20databas?= =?UTF-8?q?e=20server=20is=20disconnected=20from=20the=20browser=20tree.?= =?UTF-8?q?=20Fixes=20#6376?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en_US/release_notes_5_2.rst | 1 + .../tools/sqleditor/utils/apply_explain_plan_wrapper.py | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/en_US/release_notes_5_2.rst b/docs/en_US/release_notes_5_2.rst index 10ed1aa19..8ddf82f35 100644 --- a/docs/en_US/release_notes_5_2.rst +++ b/docs/en_US/release_notes_5_2.rst @@ -31,3 +31,4 @@ Bug fixes | `Issue #6344 `_ - Fixed cannot unpack non-iterable response object error when selecting any partition. | `Issue #6356 `_ - Mark the Apache HTTPD config file as such in the web DEB and RPM packages. | `Issue #6375 `_ - Fixed an issue where users are unable to see data of the partitions using the View/Edit data option. +| `Issue #6376 `_ - Fixed an issue where a connection warning should be displayed on the user clicks on explain or explain analyze and the database server is disconnected from the browser tree. diff --git a/web/pgadmin/tools/sqleditor/utils/apply_explain_plan_wrapper.py b/web/pgadmin/tools/sqleditor/utils/apply_explain_plan_wrapper.py index 544e0976c..162b980cb 100644 --- a/web/pgadmin/tools/sqleditor/utils/apply_explain_plan_wrapper.py +++ b/web/pgadmin/tools/sqleditor/utils/apply_explain_plan_wrapper.py @@ -16,8 +16,9 @@ from pgadmin.utils.compile_template_name import compile_template_name def apply_explain_plan_wrapper_if_needed(manager, sql): if 'explain_plan' in sql and sql['explain_plan']: explain_plan = sql['explain_plan'] - ver = manager.version - server_type = manager.server_type + ver = manager.version if manager.version is not None else 0 + server_type = \ + manager.server_type if manager.server_type is not None else 'pg' template_path = compile_template_name( 'sqleditor/sql', 'explain_plan.sql',