Bug Report
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
- Connect through TiProxy and start a transaction.
- Execute a write but do not commit it.
- Cause the router to request redirection of this connection.
- Send
BEGIN garbage as a normal COM_QUERY.
- Observe the syntax error, then issue
ROLLBACK and query the written row.
It's because an invalid BEGIN actually does nothing, but TiProxy thought it might commit and start a new transaction.
2. What did you expect to see? (Required)
The invalid statement should return a syntax error without changing the active transaction; ROLLBACK should undo the earlier write.
3. What did you see instead (Required)
TiProxy matches only the leading BEGIN token, sends an internal COMMIT to the old backend, attempts redirection, and then forwards the invalid SQL. The client sees only the syntax error, but the earlier write is already committed.
4. What is your version? (Required)
- TiProxy source commit:
51859ee68000dd14dbff4dcaf0ffaeb349d1d5be
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
BEGIN garbageas a normalCOM_QUERY.ROLLBACKand query the written row.It's because an invalid
BEGINactually does nothing, but TiProxy thought it might commit and start a new transaction.2. What did you expect to see? (Required)
The invalid statement should return a syntax error without changing the active transaction;
ROLLBACKshould undo the earlier write.3. What did you see instead (Required)
TiProxy matches only the leading
BEGINtoken, sends an internalCOMMITto the old backend, attempts redirection, and then forwards the invalid SQL. The client sees only the syntax error, but the earlier write is already committed.4. What is your version? (Required)
51859ee68000dd14dbff4dcaf0ffaeb349d1d5be