The params of `COM_STMT_EXECUTE` may not be shown in `tiproxy_traffic_replay.fail`
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 73
- Forks
- 41
- Avg merge
- 21h 3m
- Merged PRs (30d)
- 21
Description
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
- Prepare a statement and then capture traffic
- Execute the statement with parameters
- Stop capture and replay with errors (such as replay after dropping the database)
- Check the
sample_stmtin the tabletiproxy_traffic_replay.fail
2. What did you expect to see? (Required)
The parameters are correct
3. What did you see instead (Required)
The parameter is nil.
Reason:
paramNum is contained in the ComStmtPrepare but paramTypes is contained in the first ComStmtExecute (with newParamBoundFlag==1). TiDB parses the paramTypes by the paramNum and then stores it.
If the prepared statement is not executed before and is parsed from the session states, the paramTypes is empty. Besides, the paramNum is not in the session states. When the first ComStmtExecute comes, TiProxy is unable to parse paramTypes because it doesn't know the paramNum.
4. What is your version? (Required)
v1.3.0
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing how COM_STMT_PREPARE and COM_STMT_EXECUTE packets are parsed during traffic replay, focusing on paramNum, paramTypes, and session-state restoration. Reproduce the report by capturing a parameterized statement, replaying after a database drop, and checking sample_stmt in tiproxy_traffic_replay.fail. Done means the recorded parameters are shown correctly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- backend, databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100