Fixed a schema diff issue where generated script adds unwanted line endings for Functions/Procedures/Trigger Functions. Fixes #7102

This commit is contained in:
Akshay Joshi 2022-01-06 13:08:50 +05:30
parent 8b13f158ab
commit f56b4030f1
2 changed files with 3 additions and 1 deletions

View File

@ -28,3 +28,4 @@ Bug fixes
| `Issue #7081 <https://redmine.postgresql.org/issues/7081>`_ - Fixed an issue in SQL generation for PostgreSQL-14 functions. | `Issue #7081 <https://redmine.postgresql.org/issues/7081>`_ - Fixed an issue in SQL generation for PostgreSQL-14 functions.
| `Issue #7093 <https://redmine.postgresql.org/issues/7093>`_ - Fixed an issue where SubPlans may overlap other nodes & make them inaccessible in Graphical EXPLAIN View. | `Issue #7093 <https://redmine.postgresql.org/issues/7093>`_ - Fixed an issue where SubPlans may overlap other nodes & make them inaccessible in Graphical EXPLAIN View.
| `Issue #7096 <https://redmine.postgresql.org/issues/7096>`_ - Ensure that Truncate and Reset statistics should work. | `Issue #7096 <https://redmine.postgresql.org/issues/7096>`_ - Ensure that Truncate and Reset statistics should work.
| `Issue #7102 <https://redmine.postgresql.org/issues/7102>`_ - Fixed a schema diff issue where generated script adds unwanted line endings for Functions/Procedures/Trigger Functions.

View File

@ -1896,7 +1896,8 @@ class FunctionView(PGChildNodeView, DataTypeReader, SchemaDiffObjectCompare):
data['schema'] = target_schema data['schema'] = target_schema
status, sql = self._get_sql(gid=gid, sid=sid, did=did, scid=scid, status, sql = self._get_sql(gid=gid, sid=sid, did=did, scid=scid,
data=data, fnid=oid, is_sql=False, data=data, fnid=oid, is_sql=False,
is_schema_diff=True) is_schema_diff=True,
allow_code_formatting=False)
# Check if return type is changed then we need to drop the # Check if return type is changed then we need to drop the
# function first and then recreate it. # function first and then recreate it.
if 'prorettypename' in data: if 'prorettypename' in data: