HHH-18439 Account for null values in query cache hit
Also, solve an assertion error in query result type check when selecting `null` literals
This commit is contained in:
parent
4bf11f8503
commit
a784ca2027
|
@ -1094,7 +1094,10 @@ public class SqmUtil {
|
|||
}
|
||||
|
||||
final JavaType<?> selectionExpressibleJavaType = selectionExpressible.getExpressibleJavaType();
|
||||
assert selectionExpressibleJavaType != null;
|
||||
if ( selectionExpressibleJavaType == null ) {
|
||||
// nothing we can validate
|
||||
return;
|
||||
}
|
||||
|
||||
final Class<?> selectionExpressibleJavaTypeClass = selectionExpressibleJavaType.getJavaTypeClass();
|
||||
if ( selectionExpressibleJavaTypeClass != Object.class ) {
|
||||
|
@ -1103,7 +1106,7 @@ public class SqmUtil {
|
|||
return;
|
||||
}
|
||||
|
||||
if ( selectionExpressibleJavaType instanceof PrimitiveJavaType<?> primitiveJavaType ) {
|
||||
if ( selectionExpressibleJavaType instanceof final PrimitiveJavaType<?> primitiveJavaType ) {
|
||||
if ( primitiveJavaType.getPrimitiveClass() == resultClass ) {
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -176,12 +176,12 @@ public class JdbcValuesCacheHit extends AbstractJdbcValues {
|
|||
if ( valueIndexesToCacheIndexes == null ) {
|
||||
return ( (Object[]) row )[valueIndex];
|
||||
}
|
||||
else if ( row.getClass() != Object[].class ) {
|
||||
assert valueIndexesToCacheIndexes[valueIndex] == 0;
|
||||
return row;
|
||||
else if ( row instanceof Object[] ) {
|
||||
return ( (Object[]) row )[valueIndexesToCacheIndexes[valueIndex]];
|
||||
}
|
||||
else {
|
||||
return ( (Object[]) row )[valueIndexesToCacheIndexes[valueIndex]];
|
||||
assert valueIndexesToCacheIndexes[valueIndex] == 0;
|
||||
return row;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue