feat(tidb-stmt-cache): add /api/cross orphaned same-param-shape endpoint#143
Merged
slayerjain merged 1 commit intoJun 9, 2026
Merged
Conversation
Adds GET /api/cross/{v}, which issues two DISTINCT prepared queries with an
identical one-int parameter signature ("SELECT ? AS v" and "SELECT ? + 1000 AS
w") inside a single request. When both PREPAREs predate the record window
(orphaned mocks, expectedQuery==""), this exercises the matcher's
parameter-aware orphaned-EXECUTE path: a param-only match must not serve query
B's row for query A. a must echo v and b must be v+1000.
Consumed by the keploy/keploy java_linux tidb-stmt-cache e2e job.
Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Signed-off-by: slayerjain <[email protected]>
8 tasks
There was a problem hiding this comment.
Pull request overview
Adds a new endpoint to the tidb-stmt-cache Spring sample to exercise Keploy’s orphaned-EXECUTE matching behavior when two distinct prepared statements share the same one-int parameter shape within a single request.
Changes:
- Add
GET /api/cross/{v}that executes two different preparedSELECTstatements with the same bound parameter. - Return both results in a single JSON payload (
{"a": v, "b": v+1000}) to detect cross-statement mismatches during replay.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Describe the changes that are made
Adds
GET /api/cross/{v}to thetidb-stmt-cachesample.It issues two distinct prepared queries that share an identical one-int
parameter signature inside a single request:
When both
COM_STMT_PREPAREs predate keploy's record window (orphaned mocks,expectedQuery==""), this exercises the matcher's parameter-awareorphaned-EXECUTE path: a param-only match must not serve query B's row for
query A just because the bound parameter is equal.
amust echovandbmust be
v+1000.No schema or JDBC-URL change; reuses the existing
kvtable flags(
useServerPrepStmts=true&cachePrepStmts=true).Links & References
Closes: NA
🔗 Related PRs
java_linuxtidb-stmt-cachee2e job (companion PR).What type of PR is this?
Are there any sample code or steps to test the changes?
🤖 Generated with Claude Code