Maxim Solodovnik created OPENJPA-2970:
-----------------------------------------

             Summary: Null named parameter falls through to positional lookup
                 Key: OPENJPA-2970
                 URL: https://issues.apache.org/jira/browse/OPENJPA-2970
             Project: OpenJPA
          Issue Type: Sub-task
          Components: jpa
    Affects Versions: 4.2.0
            Reporter: Maxim Solodovnik
             Fix For: 4.2.0


Discussion thread: 
https://github.com/apache/openjpa/pull/144#discussion_r3683003222


**(medium)** Using `userParams.get(name) == null` to fall through to positional 
lookup means an explicitly bound null named parameter is silently replaced by 
whatever is registered under the position key - `containsKey` should 
distinguish "bound to null" from "absent". Related: the new `c.getIndex() < 
params.length` guards at lines 188/195 silently skip binding instead of 
failing, turning a caller bug into an unbound-parameter SQLException far from 
the cause.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to