[shotwell] Fix issue with indexes on PhotoTable
- From: Jens Georg <jensgeorg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [shotwell] Fix issue with indexes on PhotoTable
- Date: Fri, 5 Aug 2016 22:13:54 +0000 (UTC)
commit 71ec94aa52e5bccf4e438804f45321e39f284fb1
Author: Jens Georg <mail jensge org>
Date: Fri Jul 29 00:22:19 2016 +0200
Fix issue with indexes on PhotoTable
- thumbnail_md5 might actually not be unique for various reasons
- Second index was a duplicate of the first instead of using thumbnail_md5
Signed-off-by: Jens Georg <mail jensge org>
https://bugzilla.gnome.org/show_bug.cgi?id=742670
src/db/PhotoTable.vala | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/db/PhotoTable.vala b/src/db/PhotoTable.vala
index cead338..f774df5 100644
--- a/src/db/PhotoTable.vala
+++ b/src/db/PhotoTable.vala
@@ -170,7 +170,7 @@ public class PhotoTable : DatabaseTable {
}
// 2) index on thumbnail_md5,file_format
- res = db.prepare_v2 ("CREATE UNIQUE INDEX IF NOT EXISTS PhotoTableThumbnailMD5Format on
PhotoTable(md5, file_format)", -1, out stmt);
+ res = db.prepare_v2 ("CREATE INDEX IF NOT EXISTS PhotoTableThumbnailMD5Format on
PhotoTable(thumbnail_md5, file_format)", -1, out stmt);
assert (res == Sqlite.OK);
res = stmt.step ();
if (res != Sqlite.DONE) {
@@ -178,7 +178,7 @@ public class PhotoTable : DatabaseTable {
}
// 3) index on thumbnail_md5,md5
- res = db.prepare_v2 ("CREATE UNIQUE INDEX IF NOT EXISTS PhotoTableThumbnailMD5MD5 on
PhotoTable(thumbnail_md5, md5)", -1, out stmt);
+ res = db.prepare_v2 ("CREATE INDEX IF NOT EXISTS PhotoTableThumbnailMD5MD5 on
PhotoTable(thumbnail_md5, md5)", -1, out stmt);
assert (res == Sqlite.OK);
res = stmt.step ();
if (res != Sqlite.DONE) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]