Skip to content

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

Open
rzo1 wants to merge 1 commit into
masterfrom
OPENJPA-2970
Open

rzo1 wants to merge 1 commit into
masterfrom
OPENJPA-2970

Conversation

@rzo1

@rzo1 rzo1 commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

Stored procedure parameters are now looked up with containsKey, so a named parameter bound to null is no longer replaced by the value registered under its position. The parameter array is now indexed by position, so an IN parameter that follows an OUT parameter gets bound instead of being silently skipped. New tests in TestStoredProcedureQueryFixes cover both cases.

…al 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.
@rzo1 rzo1 self-assigned this Sep 14, 2026
@rzo1
rzo1 requested review from cristof and solomax September 14, 2026 18:10
final boolean bind = params != null && params.length > 0;
for (Column c : spq.getProcedure().getInColumns()) {
if (params != null && c.getIndex() < params.length) {
if (bind) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

c.getIndex() < params.length was dropped in 2 code blocks
Are you sure this check is not necessary anymore?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants