omeka/omeka-s

Migrations can fail silently

Closed this issue · 0 comments

Migrations commonly use multiline statements passed to DBAL's exec(), which itself passes through to PDO's exec():

It turns out that PDO doesn't throw an exception for a statement in a multi-line query that caused an error until you actually look at that statement's results specifically. Since DBAL doesn't expect to be given a multi-line statement it doesn't ever do this, with the result that the multiline query just stops partway through and everything proceeds as if it succeeded.

See https://bugs.php.net/bug.php?id=61613

Minimally we'll need to remove all uses of multi-line calls to exec and that may be about all that can be reasonably done.