You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using PostgreSQL driver 42.2.11 and higher and spring-jdbc version 5.2.8.RELEASE and calling Postgresql function then CallMetaDataContext.actualFunctionReturnName from function metadata is not set.
Related to issue # 25399 there was a split in GenericCallMetaDataProvider:
Only the type of parameters for the procedure are checked.
Because of this, the output parameter for the function is passed in the metadata as returnValue, setFunctionReturnName is not called, and spring uses the default name return, and does not find such a parameter in the results.
The text was updated successfully, but these errors were encountered:
ddrko22
changed the title
spring-jdbc don't set out parameter name from metadata for Postgresql function after issuer#25399
spring-jdbc don't set out parameter name from metadata for Postgresql function after issue#25399
Aug 14, 2020
I've found the same issue and can add a little more detail.
Looks like GenericCallMetaDataProvider.processProcedureColumns first identifies it as a function rather than a procedure.
PgDatabaseMetaData.getFunctionColumns (ie the Postgresql driver) sets the return type to java.sql.DatabaseMetaData.functionReturn now (which has magic number 4 whereas in the previous driver it was set to DatabaseMetaData.procedureColumnReturn with magic number 5).
CallMetaDataContext.reconcileParameters calls CallParameterMetaData.isReturnParameter which still only looks for the procedure types, not function types.
It can't simply look for both because the numbers would conflict. It looks like it needs an extra parameter to tell it if it's a procedure or a function.
Affects: 5.2.8.RELEASE
When using PostgreSQL driver 42.2.11 and higher and spring-jdbc version 5.2.8.RELEASE and calling Postgresql function then
CallMetaDataContext.actualFunctionReturnName
from function metadata is not set.Related to issue # 25399 there was a split in GenericCallMetaDataProvider:
And for functions it returns columnType = 4, previously it returned columnType = 5.
Because of this, the condition is not met in
CallMetaDataContext.reconcileParameters
:and
setFunctionReturnName
is not called. It is not executed becauseisReturnParameter
looks like:Only the type of parameters for the procedure are checked.
Because of this, the output parameter for the function is passed in the metadata as
returnValue
,setFunctionReturnName
is not called, and spring uses the default namereturn
, and does not find such a parameter in the results.The text was updated successfully, but these errors were encountered: