For SQLState: 23506 h2 returns for example\[1] :
{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.
\[1]: [https://github.com/h2database/h2database/blob/9e2e212cf806fa75cd42437a13a33cb3185f5fb1/h2/src/main/org/h2/constraint/ConstraintReferential.java#L312|https://github.com/h2database/h2database/blob/9e2e212cf806fa75cd42437a13a33cb3185f5fb1/h2/src/main/org/h2/constraint/ConstraintReferential.java#L312] |
|