Hi,

PFA minor patch to fix the issue where we were executing SELECT statements
in transactions in query tool which probably is not required because SELECT
statements are already protected from dirty reads.
RM#2683

--
Regards,
Murtuza Zabuawala
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
diff --git a/web/pgadmin/tools/sqleditor/__init__.py 
b/web/pgadmin/tools/sqleditor/__init__.py
index 15ec8c4..ee7dc8c 100644
--- a/web/pgadmin/tools/sqleditor/__init__.py
+++ b/web/pgadmin/tools/sqleditor/__init__.py
@@ -1319,8 +1319,10 @@ def is_begin_required(query):
         return False
     if word_len == 5 and keyword.lower() == "start":
         return False
-    if word_len == 6 and keyword.lower() == "commit":
-        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 == 3 and keyword.lower() == "end":
         return False
     if word_len == 8 and keyword.lower() == "rollback":

Reply via email to