Open paomian opened 7 months ago
I'm using quarkus 3.9.3 with hibernate reactive. database is pg. When I call createNativeQuery and the query table result contains field which type is json will cause NPE. The reason I conducted a brief survey was
https://github.com/hibernate/hibernate-orm/blob/aae9b1e55d865d215070ee7d74ecc49593f83f4f/hibernate-core/src/main/java/org/hibernate/sql/results/jdbc/internal/ResultSetAccess.java#L78-L99
columnTypeName is from this method. it must be null. https://github.com/hibernate/hibernate-reactive/blob/a8e757f772f84c59a8b21edf7a8f1d6469d11ea2/hibernate-reactive-core/src/main/java/org/hibernate/reactive/adaptor/impl/ResultSetAdaptor.java#L1352-L1356
columnTypeName
and then call resolveSqlTypeDescriptor in PostgreSQLDialect. when jdbcTypeCode is OTHER it will cause NPE because columnTypeName is null https://github.com/hibernate/hibernate-orm/blob/aae9b1e55d865d215070ee7d74ecc49593f83f4f/hibernate-core/src/main/java/org/hibernate/dialect/PostgreSQLDialect.java#L308-L337
resolveSqlTypeDescriptor
jdbcTypeCode
OTHER
This issue has been solved as part of https://github.com/hibernate/hibernate-reactive/issues/1915
I'm using quarkus 3.9.3 with hibernate reactive. database is pg. When I call createNativeQuery and the query table result contains field which type is json will cause NPE. The reason I conducted a brief survey was
https://github.com/hibernate/hibernate-orm/blob/aae9b1e55d865d215070ee7d74ecc49593f83f4f/hibernate-core/src/main/java/org/hibernate/sql/results/jdbc/internal/ResultSetAccess.java#L78-L99
columnTypeName
is from this method. it must be null. https://github.com/hibernate/hibernate-reactive/blob/a8e757f772f84c59a8b21edf7a8f1d6469d11ea2/hibernate-reactive-core/src/main/java/org/hibernate/reactive/adaptor/impl/ResultSetAdaptor.java#L1352-L1356and then call
resolveSqlTypeDescriptor
in PostgreSQLDialect. whenjdbcTypeCode
isOTHER
it will cause NPE becausecolumnTypeName
is null https://github.com/hibernate/hibernate-orm/blob/aae9b1e55d865d215070ee7d74ecc49593f83f4f/hibernate-core/src/main/java/org/hibernate/dialect/PostgreSQLDialect.java#L308-L337