Skip to content

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

@blak3r

Description

@blak3r

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions