HHH-18353 ArrayConstructorFunction comparing argument types by reference causes FunctionArgumentException

This commit is contained in:
Andrea Boriero 2024-09-02 14:33:08 +02:00 committed by Andrea Boriero
parent ab11020ed1
commit 4bd164222f
1 changed files with 3 additions and 3 deletions

View File

@ -109,13 +109,13 @@ public class ArrayConstructorFunction extends AbstractSqmSelfRenderingFunctionDe
if ( firstType == null ) {
firstType = argumentType;
}
else if ( firstType != argumentType ) {
else if ( firstType.getSingleJdbcMapping() != argumentType.getSingleJdbcMapping() ) {
throw new FunctionArgumentException(
String.format(
"All array arguments must have a type compatible to the first argument type [%s], but argument %d has type '%s'",
firstType,
firstType.getSingleJdbcMapping(),
i + 1,
argumentType
argumentType.getSingleJdbcMapping()
)
);
}