summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2014-03-14 10:29:24 +0100
committerYorhel <git@yorhel.nl>2014-03-14 10:29:24 +0100
commitb31b3e902fe7e056e5ab77a01c3d8ecf8be81121 (patch)
treef93460c5398cb47acb5c5a3f21d6e4ddfb5f8d37
parent313e9d64cd626bc6b15691d2a0804807f6d79ac1 (diff)
db.c: The temporary hashdata-cleanup index really shouldn't be UNIQUE
It's possible to have a file with the same TTH shared multiple times, after all.
-rw-r--r--src/db.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/db.c b/src/db.c
index 017f5fa..17941ae 100644
--- a/src/db.c
+++ b/src/db.c
@@ -643,7 +643,7 @@ void db_fl_purgedata() {
// longer on average, but it should guarantee that a /gc actually finishes
// within a matter of minutes rather than hours.
db_queue_lock();
- db_queue_push_unlocked(DBF_NEXT, "CREATE UNIQUE INDEX hashfiles_tth_gc ON hashfiles (tth)", DBQ_END);
+ db_queue_push_unlocked(DBF_NEXT, "CREATE INDEX hashfiles_tth_gc ON hashfiles (tth)", DBQ_END);
db_queue_push_unlocked(DBF_NEXT, "DELETE FROM hashdata WHERE NOT EXISTS(SELECT 1 FROM hashfiles WHERE tth = root)", DBQ_END);
db_queue_push_unlocked(0, "DROP INDEX hashfiles_tth_gc", DBQ_END);
db_queue_unlock();