named query params not handled correctly

Description

If a named param is used twice, the actual value is not set into the statement more than once.

I believe we need to reverse our logic. Right now, we are looping over the params and replacing the placeholders in the SQL, but instead, we should be looping over the placeholders in the SQL and then finding the matching param because in a SQL statement like so

we need to track which params were added, and in what order, so we can add the proper values to the actual JDBC statement in the correct order as well. Right now, only half the required JDBC param values are being added to the statement because we replace the placeholders and add the param values via setObject() in two completely separate steps.

Activity

Show:
Fixed
Pinned fields
Click on the next to a field label to start pinning.

Details

Assignee

Reporter

Fix versions

Priority

Sentry

Created December 28, 2024 at 8:09 PM
Updated January 9, 2025 at 7:48 PM
Resolved January 9, 2025 at 7:48 PM