Ensure that parameters of procedures for EPAS server 10 and below should be set/reset properly. Fixes #4161

This commit is contained in:
Akshay Joshi 2019-04-10 13:22:52 +05:30
parent 6016a5ee98
commit 9c3925e448
4 changed files with 14 additions and 7 deletions

View File

@ -14,4 +14,5 @@ Features
Bug fixes
*********
| `Bug #4138 <https://redmine.postgresql.org/issues/4138>`_ - Fix an issue where the dropdown becomes misaligned/displaced.
| `Bug #4138 <https://redmine.postgresql.org/issues/4138>`_ - Fix an issue where the dropdown becomes misaligned/displaced.
| `Bug #4161 <https://redmine.postgresql.org/issues/4161>`_ - Ensure that parameters of procedures for EPAS server 10 and below should be set/reset properly.

View File

@ -61,11 +61,11 @@ ALTER PROCEDURE {{ conn|qtIdent(o_data.pronamespace, name) }}{% if o_data.proarg
{% if data.variables %}
{% if 'deleted' in data.variables and data.variables.deleted|length > 0 %}
{{ VARIABLE.UNSET(conn, 'PROCEDURE', name, data.variables.deleted, o_data.pronamespace, o_data.proargtypenames) }}
{{ VARIABLE.UNSET(conn, 'PROCEDURE', name, data.variables.deleted, o_data.pronamespace) }}
{% endif -%}
{% if 'merged_variables' in data and data.merged_variables|length > 0 %}
{{ VARIABLE.SET(conn, 'PROCEDURE', name, data.merged_variables, o_data.pronamespace, o_data.proargtypenames) }}
{{ VARIABLE.SET(conn, 'PROCEDURE', name, data.merged_variables, o_data.pronamespace) }}
{% endif -%}
{% endif -%}
{% endif -%}

View File

@ -63,11 +63,11 @@ ALTER PROCEDURE {{ conn|qtIdent(o_data.pronamespace, name) }}{% if o_data.proarg
{% if data.variables %}
{% if 'deleted' in data.variables and data.variables.deleted|length > 0 %}
{{ VARIABLE.UNSET(conn, 'PROCEDURE', name, data.variables.deleted, o_data.pronamespace, o_data.proargtypenames) }}
{{ VARIABLE.UNSET(conn, 'PROCEDURE', name, data.variables.deleted, o_data.pronamespace) }}
{% endif -%}
{% if 'merged_variables' in data and data.merged_variables|length > 0 %}
{{ VARIABLE.SET(conn, 'PROCEDURE', name, data.merged_variables, o_data.pronamespace, o_data.proargtypenames) }}
{{ VARIABLE.SET(conn, 'PROCEDURE', name, data.merged_variables, o_data.pronamespace) }}
{% endif -%}
{% endif -%}
{% endif -%}

View File

@ -4,7 +4,10 @@
{% macro SET(conn, object_type, object_name, options, schema, func_args) -%}
{% for opt in options %}
ALTER {{object_type}} {{ conn|qtIdent(schema, object_name) }}({{func_args}})
ALTER {{object_type}} {{ conn|qtIdent(schema, object_name) }}{% if func_args is defined %}({{func_args}})
{% else %}
{% endif %}
SET {{ conn|qtIdent(opt.name) }}={{ opt.value }};
{% endfor %}
@ -12,7 +15,10 @@ ALTER {{object_type}} {{ conn|qtIdent(schema, object_name) }}({{func_args}})
{% macro UNSET(conn, object_type, object_name, options, schema, func_args) -%}
{% for opt in options %}
ALTER {{object_type}} {{ conn|qtIdent(schema, object_name) }}({{func_args}})
ALTER {{object_type}} {{ conn|qtIdent(schema, object_name) }}{% if func_args is defined %}({{func_args}})
{% else %}
{% endif %}
RESET {{ conn|qtIdent(opt.name) }};
{% endfor %}