Ticket #143: smallpatch

File smallpatch, 1.5 KB (added by Richard Boulton, 18 years ago)

Small patch to change database format to allow metadata to be added later

Line 
1Index: backends/flint/flint_version.cc
2===================================================================
3--- backends/flint/flint_version.cc (revision 8457)
4+++ backends/flint/flint_version.cc (working copy)
5@@ -36,7 +36,9 @@
6 using std::string;
7
8 // YYYYMMDDX where X allows multiple format revisions in a day
9-#define FLINT_VERSION 200704230u
10+#define FLINT_VERSION 200705040u
11+// 200705040 Change metainfo format slightly, so that more items can be added
12+// in future without breaking old databases
13 // 200704230 Use zlib compression of tags for record and termlist tables
14 // 200611200 Fixed occasional, architecture-dependent surplus bits in
15 // interpolative coding; "flicklock" -> "flintlock".
16Index: backends/flint/flint_postlist.cc
17===================================================================
18--- backends/flint/flint_postlist.cc (revision 8458)
19+++ backends/flint/flint_postlist.cc (working copy)
20@@ -54,7 +54,7 @@
21 DEBUGCALL(DB, void, "FlintPostListTable::set_total_length_and_lastdocid",
22 totlen << ", " << did);
23 string tag = pack_uint(did);
24- tag += pack_uint_last(totlen);
25+ tag += pack_uint(totlen);
26 add(METAINFO_KEY, tag);
27 }
28
29@@ -73,7 +73,7 @@
30 if (!unpack_uint(&data, end, &did)) {
31 throw Xapian::DatabaseCorruptError("Record containing meta information is corrupt.");
32 }
33- if (!unpack_uint_last(&data, end, &totlen)) {
34+ if (!unpack_uint(&data, end, &totlen)) {
35 throw Xapian::DatabaseCorruptError("Record containing meta information is corrupt.");
36 }
37 RETURN(totlen);