OLD | NEW |
1 From 4d085cef75bf930afac74457600ddea785b6ac9d Mon Sep 17 00:00:00 2001 | 1 From c0a3343f2b446088f8f721baf8f53e20e8ce4fb5 Mon Sep 17 00:00:00 2001 |
2 From: Scott Hess <shess@chromium.org> | 2 From: Scott Hess <shess@chromium.org> |
3 Date: Thu, 18 Sep 2008 17:00:30 -0700 | 3 Date: Thu, 18 Sep 2008 17:00:30 -0700 |
4 Subject: [PATCH 21/23] [fts2] Detect and handle certain corruption cases. | 4 Subject: [PATCH 14/16] [fts2] Detect and handle certain corruption cases. |
5 | 5 |
6 Detect and handle certain corruption cases for fts2, | 6 Detect and handle certain corruption cases for fts2, |
7 concentrating on high-level structural issues not trying to | 7 concentrating on high-level structural issues not trying to |
8 detect corruption when decoding, for now. These cases handle | 8 detect corruption when decoding, for now. These cases handle |
9 all the in-the-wild corruption examples I have but one. | 9 all the in-the-wild corruption examples I have but one. |
10 | 10 |
11 - During a query, detect when the fts index references a docid | 11 - During a query, detect when the fts index references a docid |
12 which doesn't exist in the content table. | 12 which doesn't exist in the content table. |
13 | 13 |
14 - Detect when leavesReaderInit() receives an empty leaf node, | 14 - Detect when leavesReaderInit() receives an empty leaf node, |
(...skipping 11 matching lines...) Expand all Loading... |
26 previously part of an fts table (as if a page from another | 26 previously part of an fts table (as if a page from another |
27 table were re-used). | 27 table were re-used). |
28 | 28 |
29 Original Gears CL: | 29 Original Gears CL: |
30 https://code.google.com/p/gears/source/detail?r=2855&path=/trunk/third_party/sql
ite_google/ext/fts2/fts2.c | 30 https://code.google.com/p/gears/source/detail?r=2855&path=/trunk/third_party/sql
ite_google/ext/fts2/fts2.c |
31 --- | 31 --- |
32 third_party/sqlite/src/ext/fts2/fts2.c | 152 ++++++++++++++++++++++++++++----- | 32 third_party/sqlite/src/ext/fts2/fts2.c | 152 ++++++++++++++++++++++++++++----- |
33 1 file changed, 132 insertions(+), 20 deletions(-) | 33 1 file changed, 132 insertions(+), 20 deletions(-) |
34 | 34 |
35 diff --git a/third_party/sqlite/src/ext/fts2/fts2.c b/third_party/sqlite/src/ext
/fts2/fts2.c | 35 diff --git a/third_party/sqlite/src/ext/fts2/fts2.c b/third_party/sqlite/src/ext
/fts2/fts2.c |
36 index 7d07137..bdbd747 100644 | 36 index 1c68af5..5cb3fc6 100644 |
37 --- a/third_party/sqlite/src/ext/fts2/fts2.c | 37 --- a/third_party/sqlite/src/ext/fts2/fts2.c |
38 +++ b/third_party/sqlite/src/ext/fts2/fts2.c | 38 +++ b/third_party/sqlite/src/ext/fts2/fts2.c |
39 @@ -349,6 +349,16 @@ | 39 @@ -349,6 +349,16 @@ |
40 # define TRACE(A) | 40 # define TRACE(A) |
41 #endif | 41 #endif |
42 | 42 |
43 +#if 0 | 43 +#if 0 |
44 +/* Useful to set breakpoints. See main.c sqlite3Corrupt(). */ | 44 +/* Useful to set breakpoints. See main.c sqlite3Corrupt(). */ |
45 +static int fts2Corrupt(void){ | 45 +static int fts2Corrupt(void){ |
46 + return SQLITE_CORRUPT; | 46 + return SQLITE_CORRUPT; |
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
300 + } | 300 + } |
301 + | 301 + |
302 + rc = leavesReaderInit(v, 0, iStartBlockid, iEndBlockid, | 302 + rc = leavesReaderInit(v, 0, iStartBlockid, iEndBlockid, |
303 + pRootData, nRootData, &reader); | 303 + pRootData, nRootData, &reader); |
304 if( rc!=SQLITE_OK ) return rc; | 304 if( rc!=SQLITE_OK ) return rc; |
305 | 305 |
306 while( rc==SQLITE_OK && !leavesReaderAtEnd(&reader) ){ | 306 while( rc==SQLITE_OK && !leavesReaderAtEnd(&reader) ){ |
307 -- | 307 -- |
308 2.2.1 | 308 2.2.1 |
309 | 309 |
OLD | NEW |