[hibernate-issues] [JIRA] (HHH-14041) H2Dialect does not correctly extract violated constraint names

gittenburg (JIRA) jira at hibernate.atlassian.net
Sun May 24 06:12:44 EDT 2020


gittenburg ( https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=5eca45698d2e220c252a5c30 ) *created* an issue

Hibernate ORM ( https://hibernate.atlassian.net/browse/HHH?atlOrigin=eyJpIjoiZTMyM2IzYThmZjc2NDk1MmFkZjIxM2Y3NzRkNzA5ZjkiLCJwIjoiaiJ9 ) / Bug ( https://hibernate.atlassian.net/browse/HHH-14041?atlOrigin=eyJpIjoiZTMyM2IzYThmZjc2NDk1MmFkZjIxM2Y3NzRkNzA5ZjkiLCJwIjoiaiJ9 ) HHH-14041 ( https://hibernate.atlassian.net/browse/HHH-14041?atlOrigin=eyJpIjoiZTMyM2IzYThmZjc2NDk1MmFkZjIxM2Y3NzRkNzA5ZjkiLCJwIjoiaiJ9 ) H2Dialect does not correctly extract violated constraint names ( https://hibernate.atlassian.net/browse/HHH-14041?atlOrigin=eyJpIjoiZTMyM2IzYThmZjc2NDk1MmFkZjIxM2Y3NzRkNzA5ZjkiLCJwIjoiaiJ9 )

Issue Type: Bug Assignee: Unassigned Created: 24/May/2020 03:12 AM Priority: Minor Reporter: gittenburg ( https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=5eca45698d2e220c252a5c30 ) Original Estimate: 1h Remaining Estimate: 1h

For SQLState: 23506 h2 returns:
```
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]
```

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=eyJpIjoiZTMyM2IzYThmZjc2NDk1MmFkZjIxM2Y3NzRkNzA5ZjkiLCJwIjoiaiJ9 ) Add Comment ( https://hibernate.atlassian.net/browse/HHH-14041#add-comment?atlOrigin=eyJpIjoiZTMyM2IzYThmZjc2NDk1MmFkZjIxM2Y3NzRkNzA5ZjkiLCJwIjoiaiJ9 )

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/2108293c/attachment.html 


More information about the hibernate-issues mailing list