diff options
author | Ludovic Courtès <ludo@gnu.org> | 2018-02-14 16:40:50 +0100 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2018-02-14 16:41:50 +0100 |
commit | 1f31134d33ba6b30e375c9debe792a6c85363313 (patch) | |
tree | ee47a285aee67dbb474c4a93954234064f14c308 /tests | |
parent | c47dfdf82b4be62501a7932eaec4c124566a1829 (diff) | |
download | cuirass-1f31134d33ba6b30e375c9debe792a6c85363313.tar cuirass-1f31134d33ba6b30e375c9debe792a6c85363313.tar.gz |
database: Make 'db-add-derivation' idempotent.
* src/cuirass/database.scm (db-add-derivation): Catch 'sqlite-error and
handle SQLITE_CONSTRAINT_PRIMARYKEY.
(SQLITE_CONSTRAINT_UNIQUE): New variable.
* tests/database.scm ("database")["db-add-derivation"]: Add extra call to
'db-add-derivation'.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/database.scm | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/tests/database.scm b/tests/database.scm index 306068b..902c94e 100644 --- a/tests/database.scm +++ b/tests/database.scm @@ -106,6 +106,7 @@ INSERT INTO Evaluations (specification, revision) VALUES (3, 3);") (let* ((job (make-dummy-job)) (key (assq-ref job #:derivation))) (db-add-derivation (%db) job) + (db-add-derivation (%db) job) ;idempotent (%id key))) (test-assert "db-get-derivation" |