Inconsistent stale read check result with prepared `START TRANSACTION`
- Dominant language
- Go
- Stars
- 40.5k
- Forks
- 6.2k
- PR merge metrics
- PR metrics pending
Description
## Bug Report
Please answer these questions before submitting your issue. Thanks!
### 1. Minimal reproduce step (Required)
```sql
PREPARE stmt1 FROM 'START TRANSACTION READ ONLY AS OF TIMESTAMP NOW() - INTERVAL 5 SECOND';
EXECUTE stmt1;
EXECUTE stmt1;
```
### 2. What did you expect to see? (Required)
If not using prepared statement, the second start succeeds:
```sql
START TRANSACTION READ ONLY AS OF TIMESTAMP NOW() - INTERVAL 5 SECOND;
START TRANSACTION READ ONLY AS OF TIMESTAMP NOW() - INTERVAL 5 SECOND;
```
So, I expect it to also succeed when using prepared statement.
### 3. What did you see instead (Required)
The second `EXECUTE` raises `ERROR 1105 (HY000): only support read-only statement during read-only staleness transactions`.
### 4. What is your TiDB version? (Required)
6.5
Contributor guide
Assessment
This issue has not been assessed yet.