feat(tidb-stmt-cache): add /api/cross orphaned same-param-shape endpoint#144
Closed
slayerjain wants to merge 1 commit into
Closed
feat(tidb-stmt-cache): add /api/cross orphaned same-param-shape endpoint#144slayerjain wants to merge 1 commit into
slayerjain wants to merge 1 commit into
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]>
3 tasks
Member
Author
|
Redundant — the same /api/cross endpoint was already merged via #143. Closing. |
There was a problem hiding this comment.
Pull request overview
Adds a new endpoint to the tidb-stmt-cache sample to exercise Keploy’s orphaned prepared-statement EXECUTE matching when two different SQL queries share the same single-int parameter shape in one request.
Changes:
- Introduces
GET /api/cross/{v}that runsSELECT ? AS vandSELECT ? + 1000 AS wback-to-back and returns{a, b}. - Documents the intended orphaned-mock matching behavior and expected response invariants.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+101
to
+103
| public Map<String, Object> cross(@PathVariable("v") int v) { | ||
| Integer a = jdbc.queryForObject("SELECT ? AS v", Integer.class, v); | ||
| Integer b = jdbc.queryForObject("SELECT ? + 1000 AS w", Integer.class, v); |
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 twodistinct prepared queries with an identical one-int parameter signature in
a single request (
SELECT ? AS vandSELECT ? + 1000 AS w). When bothPREPAREs predate keploy's record window (orphaned mocks), this exercises the
parameter-aware orphaned-EXECUTE path — a param-only match must not serve query
B's row for query A.
amust echov,bmust bev+1000.Consumed by the keploy/keploy
java_linuxtidb-stmt-cachee2e job.What type of PR is this?
🤖 Generated with Claude Code