INSERT ... ON CONFLIT DO NOTHING for addEntry (#3409)

#fix https://github.com/FreshRSS/FreshRSS/issues/3402
Explicit `INSERT OR IGNORE` / `ON CONFLICT DO NOTHING` for the
`addEntry()` method, which does expect some duplicates.
This commit is contained in:
Alexandre Alapetite authored and GitHub committed 2021-02-02 00:03:59 +01:00
1 parent 8285f1df43
commit 1ee1fcce91
3 files changed
+16 -2

No files matched your search

+4
View File
@@ -14,6 +14,10 @@ class FreshRSS_EntryDAOSQLite extends FreshRSS_EntryDAO {
return $x;
}
public function sqlIgnoreConflict($sql) {
return str_replace('INSERT INTO ', 'INSERT OR IGNORE INTO ', $sql);
}
protected function autoUpdateDb($errorInfo) {
if ($tableInfo = $this->pdo->query("SELECT sql FROM sqlite_master where name='tag'")) {
$showCreate = $tableInfo->fetchColumn();