Skip to content

Commit

Permalink
Restore original 4.x behavior for initialization of function return name
Browse files Browse the repository at this point in the history
  • Loading branch information
jhoeller authored and engimatic committed Sep 29, 2020
1 parent 8424e91 commit 4a56372
Showing 1 changed file with 7 additions and 8 deletions.
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2018 the original author or authors.
* Copyright 2002-2020 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -172,7 +172,7 @@ public String getCatalogName() {
}

/**
* Secify the name of the schema.
* Specify the name of the schema.
*/
public void setSchemaName(@Nullable String schemaName) {
this.schemaName = schemaName;
Expand Down Expand Up @@ -354,16 +354,15 @@ protected List<SqlParameter> reconcileParameters(List<SqlParameter> parameters)
logger.debug("Using declared out parameter '" + paramName +
"' for function return value");
}
setFunctionReturnName(paramName);
this.actualFunctionReturnName = paramName;
returnDeclared = true;
}
}
}
}
setOutParameterNames(outParamNames);

List<SqlParameter> workParams = new ArrayList<>();
workParams.addAll(declaredReturnParams);
List<SqlParameter> workParams = new ArrayList<>(declaredReturnParams);
if (!provider.isProcedureColumnMetaDataUsed()) {
workParams.addAll(declaredParams.values());
return workParams;
Expand Down Expand Up @@ -393,8 +392,8 @@ protected List<SqlParameter> reconcileParameters(List<SqlParameter> parameters)
"Unable to locate declared parameter for function return value - " +
" add a SqlOutParameter with name '" + getFunctionReturnName() + "'");
}
else if (paramName != null) {
setFunctionReturnName(paramName);
else {
this.actualFunctionReturnName = param.getName();
}
}
else {
Expand Down Expand Up @@ -422,7 +421,7 @@ else if (paramName != null) {
(StringUtils.hasLength(paramNameToUse) ? paramNameToUse : getFunctionReturnName());
workParams.add(provider.createDefaultOutParameter(returnNameToUse, meta));
if (isFunction()) {
setFunctionReturnName(returnNameToUse);
this.actualFunctionReturnName = returnNameToUse;
outParamNames.add(returnNameToUse);
}
if (logger.isDebugEnabled()) {
Expand Down

0 comments on commit 4a56372

Please sign in to comment.