Fixed an issue while removing the package body showing wrong modified SQL. Fixes #5410

This commit is contained in:
Akshay Joshi
2020-04-17 13:06:07 +05:30
parent d35433d0b8
commit c6deb9393c
3 changed files with 5 additions and 3 deletions

View File

@@ -62,4 +62,5 @@ Bug fixes
| `Issue #5375 <https://redmine.postgresql.org/issues/5375>`_ - Fixed an issue where the Mode cell of argument grid does not appear completely in the Functions dialog.
| `Issue #5383 <https://redmine.postgresql.org/issues/5383>`_ - Fixed syntax error while refreshing the existing synonyms.
| `Issue #5387 <https://redmine.postgresql.org/issues/5387>`_ - Fixed an issue where the mode is not shown in the properties dialog of functions/procedures if all the arguments are "IN" arguments.
| `Issue #5400 <https://redmine.postgresql.org/issues/5400>`_ - Fixed internal server error when the database server is logged in with non-super user.
| `Issue #5400 <https://redmine.postgresql.org/issues/5400>`_ - Fixed internal server error when the database server is logged in with non-super user.
| `Issue #5410 <https://redmine.postgresql.org/issues/5410>`_ - Fixed an issue while removing the package body showing wrong modified SQL.

View File

@@ -649,7 +649,8 @@ class PackageView(PGChildNodeView, SchemaDiffObjectCompare):
data['schema'] = diff_schema
SQL = render_template("/".join([self.template_path, 'update.sql']),
data=data, o_data=old_data, conn=self.conn)
data=data, o_data=old_data, conn=self.conn,
is_schema_diff=diff_schema)
return SQL, data['name'] if 'name' in data else old_data['name']
else:
# To format privileges coming from client

View File

@@ -3,7 +3,7 @@
{% if data %}
{% set recreate_pkg_body = false %}
{% if data.pkgheadsrc is defined and data.pkgheadsrc != o_data.pkgheadsrc and o_data.pkgbodysrc != None or (data.pkgbodysrc is defined and data.pkgbodysrc == '') %}
{% set recreate_pkg_body = true %}
{% if is_schema_diff is defined and is_schema_diff != None %}{% set recreate_pkg_body = true %}{% endif %}
DROP PACKAGE BODY {{ conn|qtIdent(data.schema,data.name) }};
{% endif %}
{% if data.pkgheadsrc %}