From 5be0d17df58041988548b3bec1cecd1ee59bca40 Mon Sep 17 00:00:00 2001 From: Akshay Joshi Date: Thu, 21 Feb 2019 14:05:10 +0000 Subject: [PATCH] Don't exclude SELECT statements from transaction management in the Query Tool in case they call data-modifying functions. Fixes #3958 --- docs/en_US/release_notes_4_3.rst | 1 + web/pgadmin/tools/sqleditor/utils/is_begin_required.py | 6 ++---- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/docs/en_US/release_notes_4_3.rst b/docs/en_US/release_notes_4_3.rst index 550129e15..a2764ea66 100644 --- a/docs/en_US/release_notes_4_3.rst +++ b/docs/en_US/release_notes_4_3.rst @@ -28,6 +28,7 @@ Bug fixes | `Bug #3912 `_ - Fix editing of table data with a JSON primary key. | `Bug #3942 `_ - Close connections gracefully when the user logs out of pgAdmin. | `Bug #3946 `_ - Fix alignment of checkbox to drop multiple schedules of pgAgent job. +| `Bug #3958 `_ - Don't exclude SELECT statements from transaction management in the Query Tool in case they call data-modifying functions. | `Bug #3959 `_ - Optimise display of Dependencies and Dependents, and use on-demand loading of rows in batches of 100. | `Bug #3963 `_ - Fix alignment of import/export toggle switch. | `Bug #3970 `_ - Prevent an error when closing the Sort/Filter dialogue with an empty filter string. diff --git a/web/pgadmin/tools/sqleditor/utils/is_begin_required.py b/web/pgadmin/tools/sqleditor/utils/is_begin_required.py index 7f4412d5c..2f8194277 100644 --- a/web/pgadmin/tools/sqleditor/utils/is_begin_required.py +++ b/web/pgadmin/tools/sqleditor/utils/is_begin_required.py @@ -34,10 +34,8 @@ def is_begin_required(query): return False if word_len == 5 and keyword.lower() == "start": return False - if word_len == 6: - # SELECT is protected from dirty reads hence don't require transaction - if keyword.lower() in ["select", "commit"]: - return False + if word_len == 6 and keyword.lower() == "commit": + return False if word_len == 3 and keyword.lower() == "end": return False if word_len == 8 and keyword.lower() == "rollback":