OLD | NEW |
1 From 89a3eac0dd55f34787abe98a509b7006fe2b7618 Mon Sep 17 00:00:00 2001 | 1 From ab29deaf1d9911e7dfc5f12e1fb131f800c9d4fd Mon Sep 17 00:00:00 2001 |
2 From: cpu <cpu@chromium.org> | 2 From: cpu <cpu@chromium.org> |
3 Date: Mon, 14 Sep 2009 17:37:35 +0000 | 3 Date: Mon, 14 Sep 2009 17:37:35 +0000 |
4 Subject: [PATCH 22/23] [fts2] Fix a crasher in full text search (sqlite) | 4 Subject: [PATCH 15/16] [fts2] Fix a crasher in full text search (sqlite) |
5 | 5 |
6 - If the xxx_segdir table gets corrupted, you can have non-contiguous indexes (i
dx). | 6 - If the xxx_segdir table gets corrupted, you can have non-contiguous indexes (i
dx). |
7 - This causes an assertion in debug, and a crash later on on release | 7 - This causes an assertion in debug, and a crash later on on release |
8 | 8 |
9 With this change it will return 'corrupted db' | 9 With this change it will return 'corrupted db' |
10 | 10 |
11 We shall wait to get a couple more fixes to upstream to sqlite org. | 11 We shall wait to get a couple more fixes to upstream to sqlite org. |
12 | 12 |
13 BUG=21377 | 13 BUG=21377 |
14 TEST=see bug | 14 TEST=see bug |
(...skipping 12 matching lines...) Expand all Loading... |
27 | 27 |
28 BUG=NONE | 28 BUG=NONE |
29 TEST=NONE | 29 TEST=NONE |
30 | 30 |
31 Original review URL: https://codereview.chromium.org/209001/ | 31 Original review URL: https://codereview.chromium.org/209001/ |
32 --- | 32 --- |
33 third_party/sqlite/src/ext/fts2/fts2.c | 15 +++++++++++---- | 33 third_party/sqlite/src/ext/fts2/fts2.c | 15 +++++++++++---- |
34 1 file changed, 11 insertions(+), 4 deletions(-) | 34 1 file changed, 11 insertions(+), 4 deletions(-) |
35 | 35 |
36 diff --git a/third_party/sqlite/src/ext/fts2/fts2.c b/third_party/sqlite/src/ext
/fts2/fts2.c | 36 diff --git a/third_party/sqlite/src/ext/fts2/fts2.c b/third_party/sqlite/src/ext
/fts2/fts2.c |
37 index bdbd747..d5587b3 100644 | 37 index 5cb3fc6..a78e3d3 100644 |
38 --- a/third_party/sqlite/src/ext/fts2/fts2.c | 38 --- a/third_party/sqlite/src/ext/fts2/fts2.c |
39 +++ b/third_party/sqlite/src/ext/fts2/fts2.c | 39 +++ b/third_party/sqlite/src/ext/fts2/fts2.c |
40 @@ -1838,7 +1838,7 @@ static const char *const fulltext_zStatement[MAX_STMT] = { | 40 @@ -1838,7 +1838,7 @@ static const char *const fulltext_zStatement[MAX_STMT] = { |
41 /* SEGDIR_MAX_INDEX */ "select max(idx) from %_segdir where level = ?", | 41 /* SEGDIR_MAX_INDEX */ "select max(idx) from %_segdir where level = ?", |
42 /* SEGDIR_SET */ "insert into %_segdir values (?, ?, ?, ?, ?, ?)", | 42 /* SEGDIR_SET */ "insert into %_segdir values (?, ?, ?, ?, ?, ?)", |
43 /* SEGDIR_SELECT_LEVEL */ | 43 /* SEGDIR_SELECT_LEVEL */ |
44 - "select start_block, leaves_end_block, root from %_segdir " | 44 - "select start_block, leaves_end_block, root from %_segdir " |
45 + "select start_block, leaves_end_block, root, idx from %_segdir " | 45 + "select start_block, leaves_end_block, root, idx from %_segdir " |
46 " where level = ? order by idx", | 46 " where level = ? order by idx", |
47 /* SEGDIR_SPAN */ | 47 /* SEGDIR_SPAN */ |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 + rc = SQLITE_CORRUPT_BKPT; | 80 + rc = SQLITE_CORRUPT_BKPT; |
81 + goto err; | 81 + goto err; |
82 + } | 82 + } |
83 + | 83 + |
84 /* Since leavesReaderReorder() pushes readers at eof to the end, | 84 /* Since leavesReaderReorder() pushes readers at eof to the end, |
85 ** when the first reader is empty, all will be empty. | 85 ** when the first reader is empty, all will be empty. |
86 */ | 86 */ |
87 -- | 87 -- |
88 2.2.1 | 88 2.2.1 |
89 | 89 |
OLD | NEW |