Skip to content

Commit 33c031d

Browse files
committed
Restore original 4.x behavior for initialization of function return name
Closes gh-25707
1 parent c266c52 commit 33c031d

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

spring-jdbc/src/main/java/org/springframework/jdbc/core/metadata/CallMetaDataContext.java

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2018 the original author or authors.
2+
* Copyright 2002-2020 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -172,7 +172,7 @@ public String getCatalogName() {
172172
}
173173

174174
/**
175-
* Secify the name of the schema.
175+
* Specify the name of the schema.
176176
*/
177177
public void setSchemaName(@Nullable String schemaName) {
178178
this.schemaName = schemaName;
@@ -354,16 +354,15 @@ protected List<SqlParameter> reconcileParameters(List<SqlParameter> parameters)
354354
logger.debug("Using declared out parameter '" + paramName +
355355
"' for function return value");
356356
}
357-
setFunctionReturnName(paramName);
357+
this.actualFunctionReturnName = paramName;
358358
returnDeclared = true;
359359
}
360360
}
361361
}
362362
}
363363
setOutParameterNames(outParamNames);
364364

365-
List<SqlParameter> workParams = new ArrayList<>();
366-
workParams.addAll(declaredReturnParams);
365+
List<SqlParameter> workParams = new ArrayList<>(declaredReturnParams);
367366
if (!provider.isProcedureColumnMetaDataUsed()) {
368367
workParams.addAll(declaredParams.values());
369368
return workParams;
@@ -393,8 +392,8 @@ protected List<SqlParameter> reconcileParameters(List<SqlParameter> parameters)
393392
"Unable to locate declared parameter for function return value - " +
394393
" add a SqlOutParameter with name '" + getFunctionReturnName() + "'");
395394
}
396-
else if (paramName != null) {
397-
setFunctionReturnName(paramName);
395+
else {
396+
this.actualFunctionReturnName = param.getName();
398397
}
399398
}
400399
else {
@@ -422,7 +421,7 @@ else if (paramName != null) {
422421
(StringUtils.hasLength(paramNameToUse) ? paramNameToUse : getFunctionReturnName());
423422
workParams.add(provider.createDefaultOutParameter(returnNameToUse, meta));
424423
if (isFunction()) {
425-
setFunctionReturnName(returnNameToUse);
424+
this.actualFunctionReturnName = returnNameToUse;
426425
outParamNames.add(returnNameToUse);
427426
}
428427
if (logger.isDebugEnabled()) {

0 commit comments

Comments
 (0)