From 2ccf544ad7c8bfc54600adb065156f04a8912c9f Mon Sep 17 00:00:00 2001 From: Philipp Schaffrath Date: Tue, 10 Jan 2017 12:10:36 +0100 Subject: Fixed failing test which was ignoring a required (not null) column (#26303) * Fixed failing test which was ignoring a required (not null) column * restored test to original, catching DriverException which also catches ConstraintViolationException * catch ConstraintViolationException again * removed unnecessary field from this test * clobfield should be nullable * clobfield now is nullable * removed autoincrement since whenever this strategy is enabled, oracle would not throw constraint violation exceptions (needed for setValues), which mysql still does * this field does not auto increment anymore * mark integerfield as primary, since it is not getting marked as such through auto increment anymore, integerfield default always has been 0 instead of null Signed-off-by: Morris Jobke --- lib/private/DB/Connection.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/private/DB/Connection.php b/lib/private/DB/Connection.php index a39dbe3783c..4b1c560c5ca 100644 --- a/lib/private/DB/Connection.php +++ b/lib/private/DB/Connection.php @@ -34,6 +34,7 @@ use Doctrine\DBAL\Configuration; use Doctrine\DBAL\Cache\QueryCacheProfile; use Doctrine\Common\EventManager; use Doctrine\DBAL\Platforms\MySqlPlatform; +use Doctrine\DBAL\Exception\ConstraintViolationException; use OC\DB\QueryBuilder\QueryBuilder; use OCP\DB\QueryBuilder\IQueryBuilder; use OCP\IDBConnection; @@ -284,7 +285,7 @@ class Connection extends \Doctrine\DBAL\Connection implements IDBConnection { }, array_merge($keys, $values)) ); return $insertQb->execute(); - } catch (\Doctrine\DBAL\Exception\ConstraintViolationException $e) { + } catch (ConstraintViolationException $e) { // value already exists, try update $updateQb = $this->getQueryBuilder(); $updateQb->update($table); -- cgit v1.2.3