Fixed schema diff issue where function's difference DDL was showing incorrectly when arguments had default values with commas. Fixes #7263

This commit is contained in:
Akshay Joshi 2022-03-28 13:33:35 +05:30
parent d548a5bc50
commit 9f992a9e5d
2 changed files with 4 additions and 3 deletions

View File

@ -25,6 +25,7 @@ Bug fixes
| `Issue #7238 <https://redmine.postgresql.org/issues/7238>`_ - Fixed an issue where foreign key is not removed even if the referred table is removed in ERD.
| `Issue #7257 <https://redmine.postgresql.org/issues/7257>`_ - Support running the container under OpenShift with alternate UIDs.
| `Issue #7261 <https://redmine.postgresql.org/issues/7261>`_ - Correct typo in the documentation.
| `Issue #7263 <https://redmine.postgresql.org/issues/7263>`_ - Fixed schema diff issue where function's difference DDL was showing incorrectly when arguments had default values with commas.
| `Issue #7265 <https://redmine.postgresql.org/issues/7265>`_ - Fixed schema diff issue in which the option 'null' doesn't appear in the DDL statement for the foreign table.
| `Issue #7267 <https://redmine.postgresql.org/issues/7267>`_ - Fixed an issue where unexpected error messages are displayed when users change the language via preferences.
| `Issue #7269 <https://redmine.postgresql.org/issues/7269>`_ - Ensure that pgAdmin4 should work with latest jinja2 version.

View File

@ -494,9 +494,9 @@ class FunctionView(PGChildNodeView, DataTypeReader, SchemaDiffObjectCompare):
proargmodes = data['proargmodes'] if data['proargmodes'] else \
['i'] * len(proargtypes)
proargnames = data['proargnames'] if data['proargnames'] else []
proargdefaultvals = [ptype for ptype in
data['proargdefaultvals'].split(",")] \
if data['proargdefaultvals'] else []
proargdefaultvals = re.split(
r',(?=(?:[^\"\']*[\"\'][^\"\']*[\"\'])*[^\"\']*$)',
data['proargdefaultvals']) if data['proargdefaultvals'] else []
proallargtypes = data['proallargtypes'] \
if data['proallargtypes'] else []