projects
/
cumulus.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix to segment age calculation in local database.
[cumulus.git]
/
localdb.cc
diff --git
a/localdb.cc
b/localdb.cc
index
1c44fa4
..
077c927
100644
(file)
--- a/
localdb.cc
+++ b/
localdb.cc
@@
-248,10
+248,12
@@
void LocalDb::StoreObject(const ObjectReference& ref,
sqlite3_finalize(stmt);
if (age != 0.0) {
sqlite3_finalize(stmt);
if (age != 0.0) {
- stmt = Prepare("update segments set mtime = max(mtime, ?) "
+ stmt = Prepare("update segments "
+ "set mtime = coalesce(max(mtime, ?), ?) "
"where segmentid = ?");
sqlite3_bind_double(stmt, 1, age);
"where segmentid = ?");
sqlite3_bind_double(stmt, 1, age);
- sqlite3_bind_int64(stmt, 2, SegmentToId(ref.get_segment()));
+ sqlite3_bind_double(stmt, 2, age);
+ sqlite3_bind_int64(stmt, 3, SegmentToId(ref.get_segment()));
rc = sqlite3_step(stmt);
sqlite3_finalize(stmt);
}
rc = sqlite3_step(stmt);
sqlite3_finalize(stmt);
}