From a29890368c055ee524327107d323001719bcaab2 Mon Sep 17 00:00:00 2001 From: Akshay Joshi Date: Tue, 30 Mar 2021 10:58:32 +0530 Subject: [PATCH] Fixed an issue where the procedure creation is failed when providing the Volatility option. Fixes #6293 --- docs/en_US/release_notes_5_2.rst | 2 ++ .../templates/functions/ppas/sql/9.5_plus/create.sql | 2 +- .../templates/procedures/ppas/sql/11_plus/create.sql | 4 ++-- .../templates/procedures/ppas/sql/11_plus/update.sql | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/docs/en_US/release_notes_5_2.rst b/docs/en_US/release_notes_5_2.rst index a5ea9daa1..1f25157f1 100644 --- a/docs/en_US/release_notes_5_2.rst +++ b/docs/en_US/release_notes_5_2.rst @@ -13,7 +13,9 @@ New features Housekeeping ************ + Bug fixes ********* +| `Issue #6293 `_ - Fixed an issue where the procedure creation is failed when providing the Volatility option. | `Issue #6356 `_ - Mark the Apache HTTPD config file as such in the web DEB and RPM packages. diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/functions/ppas/sql/9.5_plus/create.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/functions/ppas/sql/9.5_plus/create.sql index caad0bfad..d79183996 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/functions/ppas/sql/9.5_plus/create.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/functions/ppas/sql/9.5_plus/create.sql @@ -17,7 +17,7 @@ CREATE{% if query_type is defined %}{{' OR REPLACE'}}{% endif %} FUNCTION {{ con RETURNS{% if data.proretset and (data.prorettypename.startswith('SETOF ') or data.prorettypename.startswith('TABLE')) %} {{ data.prorettypename }} {% elif data.proretset %} SETOF {{ data.prorettypename }}{% else %} {{ data.prorettypename }}{% endif %} LANGUAGE {{ data.lanname|qtLiteral }} - {% if data.provolatile %}{% if data.provolatile == 'i' %}IMMUTABLE{% elif data.provolatile == 'STABLE' %}STABLE{% else %}VOLATILE{% endif %} {% endif %}{% if data.proleakproof %}LEAKPROOF {% endif %} + {% if data.provolatile %}{% if data.provolatile == 'i' %}IMMUTABLE{% elif data.provolatile == 's' %}STABLE{% else %}VOLATILE{% endif %} {% endif %}{% if data.proleakproof %}LEAKPROOF {% endif %} {% if data.proisstrict %}STRICT {% endif %} {% if data.prosecdef %}SECURITY DEFINER {% endif %} {% if data.proiswindow %}WINDOW{% endif %}{% if data.procost %} diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/procedures/ppas/sql/11_plus/create.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/procedures/ppas/sql/11_plus/create.sql index f6f62887c..2ba16e518 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/procedures/ppas/sql/11_plus/create.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/procedures/ppas/sql/11_plus/create.sql @@ -18,10 +18,10 @@ LANGUAGE {{ data.lanname|qtLiteral }}{% if data.prosecdef %} SECURITY DEFINER {% endif %} {% if data.lanname == 'edbspl' %} -{{ data.provolatile }} {% if data.proleakproof %}LEAKPROOF {% endif %} +{% if data.provolatile %}{% if data.provolatile == 'i' %}IMMUTABLE{% elif data.provolatile == 's' %}STABLE{% else %}VOLATILE{% endif %} {% endif %}{% if data.proleakproof %}LEAKPROOF {% endif %} {% if data.proisstrict %}STRICT {% endif %} {% if data.proparallel and (data.proparallel == 'r' or data.proparallel == 's' or data.proparallel == 'u') %} -{% if data.proparallel == 'r' %} PARALLEL RESTRICTED{% elif data.proparallel == 's' %} PARALLEL SAFE {% elif data.proparallel == 'u' %} PARALLEL UNSAFE{% endif %}{% endif %}{% if data.procost %} +{% if data.proparallel == 'r' %}PARALLEL RESTRICTED{% elif data.proparallel == 's' %}PARALLEL SAFE{% elif data.proparallel == 'u' %}PARALLEL UNSAFE{% endif %} {% endif %}{% if data.procost %} COST {{data.procost}}{% endif %}{% if data.prorows and (data.prorows | int) > 0 %} diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/procedures/ppas/sql/11_plus/update.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/procedures/ppas/sql/11_plus/update.sql index 43836ca50..d175db1c4 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/procedures/ppas/sql/11_plus/update.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/procedures/ppas/sql/11_plus/update.sql @@ -22,7 +22,7 @@ CREATE OR REPLACE PROCEDURE {{ conn|qtIdent(o_data.pronamespace, name) }}({% if LANGUAGE {{ data.lanname|qtLiteral }} {% else %} LANGUAGE {{ o_data.lanname|qtLiteral }} {% endif %} -{{ data.provolatile }} +{% if 'provolatile' in data and data.provolatile %}{{ data.provolatile }} {% elif 'provolatile' not in data and o_data.provolatile %}{{ o_data.provolatile }} {% endif %} {% if ('prosecdef' in data and data.prosecdef) or ('prosecdef' not in data and o_data.prosecdef) %}SECURITY DEFINER{% endif %} {% if data.lanname == 'edbspl' or (o_data.lanname == 'edbspl' and not 'lanname' in data ) %} {% if ('proleakproof' in data and data.proleakproof) or ('proleakproof' not in data and o_data.proleakproof) %} LEAKPROOF{% else %} NOT LEAKPROOF{% endif %}