Fix missing taskId filter and incorrect IN clause in JDBC profiling query DAOs#13785
Merged
wu-sheng merged 3 commits intoapache:masterfrom Apr 2, 2026
Merged
Conversation
f7f777b to
ba69c5b
Compare
…uery DAOs In JDBCJFRDataQueryDAO and JDBCPprofDataQueryDAO, the taskId parameter was validated but never added to the SQL WHERE clause, causing all profiling data to be returned regardless of the task. Additionally, the IN clause for instanceIds used a single comma-joined string parameter instead of individual bind parameters, which always returned empty results when multiple instances were specified.
086e432 to
b6c1835
Compare
Member
|
CI repies on my manual approval(due to ASF policy and setup). |
Member
|
And update changes.md. |
wu-sheng
approved these changes
Apr 2, 2026
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.
Fix missing
taskIdfilter and incorrectINclause inJDBCJFRDataQueryDAOandJDBCPprofDataQueryDAOJDBCJFRDataQueryDAO.getByTaskIdAndInstancesAndEventandJDBCPprofDataQueryDAO.getByTaskIdAndInstancesboth had two bugs.Bug 1 -
taskIdnot used in the WHERE clauseThe
taskIdparameter was null-checked but never added to the SQL query, so all profiling data was returned regardless of which task was requested.Bug 2 - Incorrect
INclause parameter bindingThe
instanceIdsfilter was built asin (?)with a single comma-joined string (e.g."id1,id2,id3") as the bind parameter. JDBC binds each?to exactly one value, so the query becameWHERE instance_id IN ('id1,id2,id3')- a literal string comparison - which returns no rows when multiple instances are given.The same pattern was copied from
JDBCJFRDataQueryDAOintoJDBCPprofDataQueryDAOwhen pprof support was added (#13502).Fix
Added
task_id = ?to the WHERE clause in both DAOs.Replaced the
in (?)+ joined string withString.join(",", Collections.nCopies(instanceIds.size(), "?"))to generate the correct number of placeholders, matching the pattern used inJDBCEBPFProfilingTaskDAO.If this pull request closes/resolves/fixes an existing issue, replace the issue number. Closes #.
Update the
CHANGESlog.