[hibernate-issues] [JIRA] (HHH-14041) H2Dialect does not correctly extract violated constraint names
gittenburg (JIRA)
jira at hibernate.atlassian.net
Sun May 24 06:14:01 EDT 2020
gittenburg ( https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=5eca45698d2e220c252a5c30 ) *updated* an issue
Hibernate ORM ( https://hibernate.atlassian.net/browse/HHH?atlOrigin=eyJpIjoiNTU1NzExZmIwNDc3NGRhNWFkYzNiNDU1ODgwZDg3NDgiLCJwIjoiaiJ9 ) / Bug ( https://hibernate.atlassian.net/browse/HHH-14041?atlOrigin=eyJpIjoiNTU1NzExZmIwNDc3NGRhNWFkYzNiNDU1ODgwZDg3NDgiLCJwIjoiaiJ9 ) HHH-14041 ( https://hibernate.atlassian.net/browse/HHH-14041?atlOrigin=eyJpIjoiNTU1NzExZmIwNDc3NGRhNWFkYzNiNDU1ODgwZDg3NDgiLCJwIjoiaiJ9 ) H2Dialect does not correctly extract violated constraint names ( https://hibernate.atlassian.net/browse/HHH-14041?atlOrigin=eyJpIjoiNTU1NzExZmIwNDc3NGRhNWFkYzNiNDU1ODgwZDg3NDgiLCJwIjoiaiJ9 )
Change By: gittenburg ( https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=5eca45698d2e220c252a5c30 )
For SQLState: 23506 h2 returns:
```
{noformat} Referential integrity constraint violation: "FK_PROGRESS_CARD: PUBLIC.PROGRESS FOREIGN KEY(CARD_ID) REFERENCES PUBLIC.CARDS(ID) (0)"; SQL statement:
insert into progress (due, factor, card_id, user_id) values (?, ?, ?, ?) [23506-200] {noformat}
```
H2Dialect's ViolatedConstraintNameExtracter currently only strips away everything up to and including `violation: `, making ` {{ constraintViolationException.getConstraintName() ` }} return ` {{ "FK_PROGRESS_CARD: PUBLIC.PROGRESS FOREIGN KEY(CARD_ID) REFERENCES PUBLIC.CARDS(ID) (0)"; SQL statement: }}
{{ insert into progress (due, factor, card_id, user_id) values (?, ?, ?, ?) [23506-200] ` }} , which is obviously wrong.
( https://hibernate.atlassian.net/browse/HHH-14041#add-comment?atlOrigin=eyJpIjoiNTU1NzExZmIwNDc3NGRhNWFkYzNiNDU1ODgwZDg3NDgiLCJwIjoiaiJ9 ) Add Comment ( https://hibernate.atlassian.net/browse/HHH-14041#add-comment?atlOrigin=eyJpIjoiNTU1NzExZmIwNDc3NGRhNWFkYzNiNDU1ODgwZDg3NDgiLCJwIjoiaiJ9 )
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.core&referrer=utm_source%3DNotificationLink%26utm_medium%3DEmail ) or iOS ( https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=EmailNotificationLink&mt=8 ) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100127- sha1:ff24dc8 )
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/hibernate-issues/attachments/20200524/7fd05f4e/attachment.html
More information about the hibernate-issues
mailing list