diff options
author | Philipp Schaffrath <github@philipp.schaffrath.email> | 2017-01-10 12:10:36 +0100 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2017-03-17 00:09:07 -0600 |
commit | 2ccf544ad7c8bfc54600adb065156f04a8912c9f (patch) | |
tree | 02e8efd96ba96be842ec092bbfa2c80c9873ec7f /lib/private/DB/Connection.php | |
parent | 39afcbd49feb4ba333746762fe7c9d4701db9860 (diff) | |
download | nextcloud-server-2ccf544ad7c8bfc54600adb065156f04a8912c9f.tar.gz nextcloud-server-2ccf544ad7c8bfc54600adb065156f04a8912c9f.zip |
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 <hey@morrisjobke.de>
Diffstat (limited to 'lib/private/DB/Connection.php')
-rw-r--r-- | lib/private/DB/Connection.php | 3 |
1 files changed, 2 insertions, 1 deletions
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); |