apache / apache/shardingsphere

Failed to execute `SET TRANSACTION ISOLATION` in postgresql transaction

Open
#26,003 1 comment 0 reactions 1 assignee Claimed by @FlyingZC View on GitHub
feature: transaction type: bug
Dominant language
Java
Stars
20.8k
Forks
6.9k
Avg merge
11h 35m
Merged PRs (30d)
326

Description

## Bug Report
### Which version of ShardingSphere did you use?
Master.

### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
Proxy.

### Expected behavior
Execute sql successfully.

### Actual behavior
Failed to execute sql in transaction

### Reason analyze (If you can)

### Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.
Execute in ShardingSphere-Proxy
```sql
begin;
SET TRANSACTION ISOLATION LEVEL REPEATABLE READ, READ ONLY;
-- failed
```

Execute in postgresql
```sql
postgres=# begin;
BEGIN
postgres=*# SET TRANSACTION ISOLATION LEVEL REPEATABLE READ, READ ONLY;
SET
postgres=*# rollback;
ROLLBACK
postgres=# SET TRANSACTION ISOLATION LEVEL REPEATABLE READ, READ ONLY;
WARNING: SET TRANSACTION can only be used in transaction blocks
SET
```
### Example codes for reproduce this issue (such as a github link).

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.