Pinot PreparedStatement creates invalid query if one of the parameters has '?' in its value
- Dominant language
- Java
- Stars
- 6.1k
- Forks
- 1.5k
- Avg merge
- 1d 21h
- Merged PRs (30d)
- 189
Description
Sample pinot query : `select * from table where team in (?, ?, ?)`..
Now say parameters are: `'abc'`, `'pqr with (?)'` and `'xyz'`..
Now, on executing `PreparedStatement:fillStatementWithParameters` method on this will return
`select * from table where team in ('abc', 'pqr with ('xyz')', ?)`
-- which is clearly wrong
(what we wanted was `select * from table where team in ('abc', 'pqr with (?)', 'xyz')`)..
The reason is the usage of `replaceFirst` iteration in the method..
Contributor guide
Research direction
Start at PreparedStatement:fillStatementWithParameters and reproduce the sample query with a parameter containing '(?)'. Trace how replacement selects each placeholder, then verify that the resulting query preserves the embedded '?' and substitutes the later parameter correctly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100