dbeaver / dbeaver/dbeaver

Rollback to savepoint is rolling back the entire transaction

Open
#35,821 2 comments 0 reactions 0 assignees View on GitHub
xf:sql execution
Dominant language
Java
Stars
51.8k
Forks
4.4k
Avg merge
3d 13h
Merged PRs (30d)
183

Description

### Description

Seems like Problem 2 in #29317 was not addressed or reintroduced.

Executing the following line by line (Ctrl+Enter) in Manual Commit mode
```sql
CREATE TABLE zltest(id INT)

BEGIN TRANSACTION

INSERT INTO zltest VALUES (1)

SAVEPOINT foo

INSERT INTO zltest VALUES (2)

ROLLBACK TO foo

SELECT * FROM zltest
```

at this point the transaction is rolled back and the table does not exists:
![image](https://github.com/user-attachments/assets/e01db549-d468-4701-9cb0-b391c7151b47)
(I did not manually trigger the Rollback and could reproduce this behavior every single time I tried)

Interestingly, using `ROLLBACK TRANSACTION TO foo` works as expected:
![image](https://github.com/user-attachments/assets/3424104c-fc3b-425f-83c8-7fc26a3e755a)

### DBeaver Version

Community Edition 24.2.1.202409221725

### Operating System

Windows 11 Enterprise 22H2 (OS Build 22621.4169)

### Database and driver

CloudSQL PostgreSQL 14.12, driver: PostgreSQL JDBC 42.5.0

### Steps to reproduce

_No response_

### Additional context

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.