From 8cf7c41ad962c5a2617903b41159abf1977ecb66 Mon Sep 17 00:00:00 2001 From: Nikhil Mohite Date: Tue, 9 Mar 2021 12:40:59 +0530 Subject: [PATCH] Fixed an issue where adding/updating records fails if the table name contains percent sign. Fixes #4438. --- docs/en_US/release_notes_5_1.rst | 1 + web/pgadmin/tools/sqleditor/utils/save_changed_data.py | 2 ++ 2 files changed, 3 insertions(+) diff --git a/docs/en_US/release_notes_5_1.rst b/docs/en_US/release_notes_5_1.rst index d75338fa4..d980849ae 100644 --- a/docs/en_US/release_notes_5_1.rst +++ b/docs/en_US/release_notes_5_1.rst @@ -19,6 +19,7 @@ Housekeeping Bug fixes ********* +| `Issue #4438 `_ - Fixed an issue where adding/updating records fails if the table name contains percent sign. | `Issue #4959 `_ - Fixed an issue where the properties tab for collection nodes is unresponsive after switching the tabs. | `Issue #5073 `_ - Fixed an issue where the Save button is enabled for functions/procedures by default when open the properties dialog. | `Issue #5119 `_ - Fixed an issue where hanging symlinks in a directory cause select file dialog to break. diff --git a/web/pgadmin/tools/sqleditor/utils/save_changed_data.py b/web/pgadmin/tools/sqleditor/utils/save_changed_data.py index 27d927a69..3997d93be 100644 --- a/web/pgadmin/tools/sqleditor/utils/save_changed_data.py +++ b/web/pgadmin/tools/sqleditor/utils/save_changed_data.py @@ -36,6 +36,8 @@ def save_changed_data(changed_data, columns_info, conn, command_obj, operations = ('added', 'updated', 'deleted') list_of_sql = {} _rowid = None + # Replace '%' with '%%' as python use '%' as string formatting. + command_obj.object_name = command_obj.object_name.replace('%', '%%') pgadmin_alias = { col_name: col_info['pgadmin_alias']