Brian Stansberry (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=70121%3...
) *created* an issue
Hibernate ORM (
https://hibernate.atlassian.net/browse/HHH?atlOrigin=eyJpIjoiZmEwMDUyNDk5...
) / Bug (
https://hibernate.atlassian.net/browse/HHH-15592?atlOrigin=eyJpIjoiZmEwMD...
) HHH-15592 (
https://hibernate.atlassian.net/browse/HHH-15592?atlOrigin=eyJpIjoiZmEwMD...
) Use of JdbcExceptionHelper.extractSqlState in string switches causes NPE (
https://hibernate.atlassian.net/browse/HHH-15592?atlOrigin=eyJpIjoiZmEwMD...
)
Issue Type: Bug Affects Versions: 6.1.4 Assignee: Unassigned Components: hibernate-core
Created: 10/Oct/2022 15:52 PM Priority: Major Reporter: Brian Stansberry (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=70121%3...
)
A number of dialects use the return value from JdbcExceptionHelper.extractSqlState(
SQLException ) in a string switch statement. The problem is that method may return null,
which will result in an NPE, a la
https://wildfly.zulipchat.com/#narrow/stream/174184-wildfly-developers/to...
(
https://wildfly.zulipchat.com/#narrow/stream/174184-wildfly-developers/to...
)
JdbcExceptionHelper.extractSqlState returns the value of the SQLException.SQLState field,
but that can be null. It for sure will be if the new SQLException(String reason)
constructor is used. It can be with the other constructors too as none of them reject a
null param value.
MySQLDialect, PostgreSQLDialect and SybaseASEDialect all look like they’d have this
problem.
(
https://hibernate.atlassian.net/browse/HHH-15592#add-comment?atlOrigin=ey...
) Add Comment (
https://hibernate.atlassian.net/browse/HHH-15592#add-comment?atlOrigin=ey...
)
Get Jira notifications on your phone! Download the Jira Cloud app for Android (
https://play.google.com/store/apps/details?id=com.atlassian.android.jira....
) or iOS (
https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=Em...
) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100207- sha1:591c2ef )