The problem is that if a developer creates a structural error in their migration file,
they will already be marked as executed and an not be rerun.
Signed-off-by: Joas Schilling <coding@schilljs.com>
Right now our API exports the Doctrine/dbal exception. As we've seen
with the dbal 3 upgrade, the leakage of 3rdparty types is problematic as
a dependency update means lots of work in apps, due to the direct
dependency of what Nextcloud ships. This breaks this dependency so that
apps only need to depend on our public API. That API can then be vendor
(db lib) agnostic and we can work around future deprecations/removals in
dbal more easily.
Right now the type of exception thrown is transported as "reason". For
the more popular types of errors we can extend the new exception class
and allow apps to catch specific errors only. Right now they have to
catch-check-rethrow. This is not ideal, but better than the dependnecy
on dbal.
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
As per https://dev.mysql.com/doc/refman/8.0/en/implicit-commit.html
CREATE TABLE statements automatically commit always. The only reason
this worked in the past was that PHPs PDO connection didn't check the
actual state on commit, but only checked their internal state.
But in PHP8 this was fixed:
https://github.com/php/php-src/blob/PHP-8.0/UPGRADING#L446-L450
So now commit() fails because the internal PDO connection implicitly
commited already.
Signed-off-by: Joas Schilling <coding@schilljs.com>
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Revert "Make sure the migrations table schema is always checked"
This reverts commit 258955ef738a52d9da2ac2fe59466e6093d7e9bc.
Set current vendor during upgrade and perform migrations table change if needed
Signed-off-by: Julius Härtl <jus@bitgrid.net>
When the "log_query" debug config parameter is set, SQL queries are
logged. However, if an error occurs when converting the values to
string, it will abort the request.
This fix catches the error and continues instead.
Also added handler for DateTime value which is already known to cause
aborts here.
Signed-off-by: Vincent Petry <vincent@nextcloud.com>
executeUpdate is deprecated in favor of executeStatement.
We overwrote the old one hence the prefix was no longer replaced.
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
$y is always passed to quoteColumnName hence ILiteral|IParameter|IQueryFunction are supported.
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
$x is always passed to quoteColumnName hence ILiteral|IParameter|IQueryFunction are supported.
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>