Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ReactiveDeferredResultSetAccess use ResultSetAccess interface default resolveType impl will cause NPE #1887

Open
paomian opened this issue Apr 18, 2024 · 1 comment

Comments

@paomian
Copy link

paomian commented Apr 18, 2024

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.

public String getColumnTypeName(int column) {
// This information is in rows.columnDescriptors().get( column-1 ).dataType.name
// but does not appear to be accessible.
return null;
}

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

@DavideD
Copy link
Member

DavideD commented Dec 2, 2024

This issue has been solved as part of #1915

@DavideD DavideD added problem A limitation or source of discomfort and removed problem A limitation or source of discomfort labels Dec 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants