SQLPro icon indicating copy to clipboard operation
SQLPro copied to clipboard

"BEGIN TRANSACTION;" not evaluated as an independent statement for "cursor range" execution.

Open blak3r opened this issue 1 year ago • 2 comments

Describe the bug BEGIN; and BEGIN TRANSACTION; are not detected as independent sql statements when using "cursor range" execution. This can lead to running statements following it that you didn't intend.

The workaround is to select the text and press "Run Selected" button in upper right. It all feels really scary when you're doing a transaction against your production database.

ROLLBACK TRANSACTION; / COMMIT TRANSACTION and their shorthand variants are properly detected.

To Reproduce The following gif shows how in the UI when you click BEGIN TRANSACTION; the UPDATE statement below is also selected. If you were to press enter, both would get executed. 2024-05-31_12-40-29 (1)

This behavior has been present for several years (it's not a recent regression). Just finally taking the time to report it ;)

Expected behavior Only BEGIN; is selected when the cursor is on that line. And only that statement should be run on enter.

Environment details (please complete the following information): SQLPro Studio Version 2024.11 (Build 111082) MacOS Monterey v12.7.1 SETAPP POSTGRES Database.

image

blak3r avatar May 31 '24 16:05 blak3r

Hmmm, I'm investigating this to see what I can come up with.

hankinsoft avatar Jun 03 '24 15:06 hankinsoft

Had a scare with this functionality today again. Thankfully my query was ok. Something like this occurred.

2024-07-26_14-56-34 (1)

blak3r avatar Jul 26 '24 18:07 blak3r