Catch errors when trying to EXPLAIN an invalid query. Fixes #3257

This commit is contained in:
Murtuza Zabuawala 2018-04-12 10:50:57 +01:00 committed by Dave Page
parent 79edf40141
commit c08adb5567
7 changed files with 46 additions and 54 deletions

View File

@ -9,6 +9,7 @@ for it.
.. toctree::
release_notes_3_1
release_notes_3_0
release_notes_2_1
release_notes_2_0

View File

@ -0,0 +1,17 @@
***********
Version 3.1
***********
Release date: 2018-??-??
This release contains a number of features and fixes reported since the release of pgAdmin4 3.0
Features
********
Bug fixes
*********
| `Bug #3257 <https://redmine.postgresql.org/issues/3257>`_ - Catch errors when trying to EXPLAIN an invalid query

View File

@ -1,23 +1,15 @@
EXPLAIN (
{% if format %}
EXPLAIN ({% if format -%}
FORMAT {{ format.upper() }},
{% endif %}
{% if analyze is defined %}
{%- endif %}{% if analyze is defined -%}
ANALYZE {{ analyze }},
{% endif %}
{% if verbose is defined %}
{%- endif %}{% if verbose is defined -%}
VERBOSE {{ verbose }},
{% endif %}
{% if costs is defined %}
{%- endif %}{% if costs is defined -%}
COSTS {{ costs }},
{% endif %}
{% if timing is defined %}
{%- endif %}{% if timing is defined -%}
TIMING {{ timing }},
{% endif %}
{% if summary is defined %}
{%- endif %}{% if summary is defined -%}
SUMMARY {{ summary }},
{% endif %}
{% if buffers is defined %}
{%- endif %}{% if buffers is defined -%}
BUFFERS {{ buffers }}
{% endif %}
) {{ sql }}
{%- endif %}) {{ sql }}

View File

@ -1,20 +1,13 @@
EXPLAIN (
{% if format %}
EXPLAIN ({% if format -%}
FORMAT {{ format.upper() }},
{% endif %}
{% if analyze is defined %}
{%- endif %}{% if analyze is defined -%}
ANALYZE {{ analyze }},
{% endif %}
{% if verbose is defined %}
{%- endif %}{% if verbose is defined -%}
VERBOSE {{ verbose }},
{% endif %}
{% if costs is defined %}
{%- endif %}{% if costs is defined -%}
COSTS {{ costs }},
{% endif %}
{% if timing is defined %}
{%- endif %}{% if timing is defined -%}
TIMING {{ timing }},
{% endif %}
{% if buffers is defined %}
{%- endif %}{% if buffers is defined -%}
BUFFERS {{ buffers }}
{% endif %}
) {{ sql }}
{%- endif %}) {{ sql }}

View File

@ -1,17 +1,10 @@
EXPLAIN (
{% if format %}
EXPLAIN ({% if format -%}
FORMAT {{ format.upper() }},
{% endif %}
{% if analyze is defined %}
ANALYZE {{ analyze }},
{% endif %}
{% if verbose is defined %}
{%- endif %}{% if analyze is defined -%}
ANALYZE {{ analyze }},{%- endif %}{% if verbose is defined -%}
VERBOSE {{ verbose }},
{% endif %}
{% if costs is defined %}
{%- endif %}{% if costs is defined -%}
COSTS {{ costs }},
{% endif %}
{% if buffers is defined %}
{%- endif %}{% if buffers is defined -%}
BUFFERS {{ buffers }}
{% endif %}
) {{ sql }}
{%- endif %}) {{ sql }}

View File

@ -1,5 +1 @@
EXPLAIN
{% if analyze %}
ANALYZE
{% endif %}
{{ sql }}
EXPLAIN {% if analyze %}ANALYZE {% endif %}{{ sql }}

View File

@ -35,8 +35,8 @@ class TestExplainPlanTemplates(BaseTestGenerator):
),
sql_statement='SELECT * FROM places',
expected_return_value='EXPLAIN '
'( FORMAT XML, ANALYZE True, '
'VERBOSE True, COSTS False, '
'(FORMAT XML,ANALYZE True,'
'VERBOSE True,COSTS False,'
'BUFFERS True) SELECT * FROM places'
)
),
@ -54,7 +54,7 @@ class TestExplainPlanTemplates(BaseTestGenerator):
),
sql_statement='SELECT * FROM places',
expected_return_value='EXPLAIN '
'( FORMAT JSON, BUFFERS True) '
'(FORMAT JSON,BUFFERS True) '
'SELECT * FROM places'
)
),
@ -73,7 +73,7 @@ class TestExplainPlanTemplates(BaseTestGenerator):
),
sql_statement='SELECT * FROM places',
expected_return_value='EXPLAIN '
'( FORMAT JSON, TIMING False, '
'(FORMAT JSON,TIMING False,'
'BUFFERS True) SELECT * FROM places'
)
),
@ -93,8 +93,8 @@ class TestExplainPlanTemplates(BaseTestGenerator):
),
sql_statement='SELECT * FROM places',
expected_return_value='EXPLAIN '
'( FORMAT YAML, TIMING False, '
'SUMMARY True, BUFFERS True) '
'(FORMAT YAML,TIMING False,'
'SUMMARY True,BUFFERS True) '
'SELECT * FROM places'
)
),