[ 
https://issues.apache.org/jira/browse/OPENJPA-2970?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18115258#comment-18115258
 ] 

ASF subversion and git services commented on OPENJPA-2970:
----------------------------------------------------------

Commit cf3808f2ac092904f530fd0d09716aa398d4df96 in openjpa's branch 
refs/heads/OPENJPA-2970 from Richard Zowalla
[ https://gitbox.apache.org/repos/asf?p=openjpa.git;h=cf3808f2a ]

[OPENJPA-2970] Let an explicit null named parameter win over positional lookup

Look stored procedure parameters up with containsKey so a parameter bound
to null is not replaced by the value registered under its position. Index
the parameter array by the parameter position so IN parameters following
an OUT parameter are bound instead of being silently skipped.


> 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
>            Priority: Major
>             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