dbal icon indicating copy to clipboard operation
dbal copied to clipboard

FK violation exception is not converted to ForeignKeyConstraintViolationException with Sqlite

Open mvorisek opened this issue 2 years ago • 2 comments

Q A
Version 3.3.7

Summary

Currently, a general DBAL driver exception is thrown even if the error code is 23000 representing a FK violation for Sqlite.

Current behaviour

DBAL driver exception is thrown.

How to reproduce

Insert a row violating at least one FK.

Expected behaviour

Instance of ForeignKeyConstraintViolationException exception is thrown (exception is converted).

mvorisek avatar Jul 12 '22 23:07 mvorisek

Insert a row violating at least one FK.

Please be more specific. There are several scenarios like this covered by Functional\ExceptionTest.

Is the issue reproducible on 3.4.x? It may have been fixed by https://github.com/doctrine/dbal/pull/5409.

morozov avatar Jul 15 '22 19:07 morozov

The https://github.com/doctrine/dbal/pull/5409 does not fix this issue.

Thank you for pointing to the tests - I will check.

mvorisek avatar Jul 15 '22 20:07 mvorisek

Closing due to the lack of feedback.

morozov avatar Aug 18 '22 15:08 morozov

weird, https://github.com/atk4/data/blob/9e7a43525bd887eb01145076ede775bb4e621553/src/Persistence/Sql/DbalDriverMiddleware.php#L119 is needed in atk4/data to pass the tests

did you try to reproduce?

mvorisek avatar Aug 18 '22 16:08 mvorisek

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

github-actions[bot] avatar Sep 18 '22 00:09 github-actions[bot]