Skip to content

Commit

Permalink
removes the specific upsert query which is available on PSQL 9.5 only
Browse files Browse the repository at this point in the history
… in favor of the generic way

fixes #15613 properly and overrides #16461

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
  • Loading branch information
blizzz committed Jul 26, 2019
1 parent 4986241 commit da196bd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 14 deletions.
12 changes: 0 additions & 12 deletions lib/private/DB/AdapterPgSql.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,4 @@ public function fixupStatement($statement) {
return $statement;
}

/**
* @suppress SqlInjectionChecker
*/
public function insertIgnoreConflict(string $table,array $values) : int {
$builder = $this->conn->getQueryBuilder();
$builder->insert($table);
foreach($values as $key => $value) {
$builder->setValue($key, $builder->createNamedParameter($value));
}
$queryString = $builder->getSQL() . ' ON CONFLICT DO NOTHING';
return $this->conn->executeUpdate($queryString, $builder->getParameters(), $builder->getParameterTypes());
}
}
4 changes: 2 additions & 2 deletions lib/private/legacy/util.php
Original file line number Diff line number Diff line change
Expand Up @@ -978,9 +978,9 @@ public static function checkDatabaseVersion() {
$data = $result->fetchRow();
if (isset($data['server_version'])) {
$version = $data['server_version'];
if (version_compare($version, '9.5.0', '<')) {
if (version_compare($version, '9.0.0', '<')) {
$errors[] = array(
'error' => $l->t('PostgreSQL >= 9.5 required'),
'error' => $l->t('PostgreSQL >= 9 required'),
'hint' => $l->t('Please upgrade your database version')
);
}
Expand Down

0 comments on commit da196bd

Please sign in to comment.