Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(68)

Side by Side Diff: third_party/sqlite/patches/0008-fts3-Disable-fts3_tokenizer-and-fts4.patch

Issue 901033002: Import SQLite 3.8.7.4. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Chromium changes to support SQLite 3.8.7.4. Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 From b11ecfada70198bc5b6dc8419d2b7b3c7f6542b8 Mon Sep 17 00:00:00 2001 1 From c18bc2961fbb401a1941e736d81bd048c3b82e88 Mon Sep 17 00:00:00 2001
2 From: Scott Hess <shess@chromium.org> 2 From: Scott Hess <shess@chromium.org>
3 Date: Tue, 16 Dec 2014 13:02:27 -0800 3 Date: Tue, 16 Dec 2014 13:02:27 -0800
4 Subject: [PATCH 10/23] [fts3] Disable fts3_tokenizer and fts4. 4 Subject: [PATCH 08/16] [fts3] Disable fts3_tokenizer and fts4.
5 5
6 fts3_tokenizer allows a SQLite user to specify a pointer to call as a 6 fts3_tokenizer allows a SQLite user to specify a pointer to call as a
7 function, which has obvious sercurity implications. Disable fts4 until 7 function, which has obvious sercurity implications. Disable fts4 until
8 someone explicitly decides to own support for it. 8 someone explicitly decides to own support for it. Disable fts3tokenize
9 virtual table until someone explicitly decides to own support for it.
9 10
10 No original review URL because this was part of the initial Chromium commit. 11 No original review URL because this was part of the initial Chromium commit.
11 --- 12 ---
12 third_party/sqlite/src/ext/fts3/fts3.c | 9 +++++++++ 13 third_party/sqlite/src/ext/fts3/fts3.c | 9 +++++++++
13 1 file changed, 9 insertions(+) 14 1 file changed, 9 insertions(+)
14 15
15 diff --git a/third_party/sqlite/src/ext/fts3/fts3.c b/third_party/sqlite/src/ext /fts3/fts3.c 16 diff --git a/third_party/sqlite/src/ext/fts3/fts3.c b/third_party/sqlite/src/ext /fts3/fts3.c
16 index 20da051..7accb11 100644 17 index 2b93c62..dbd2835 100644
17 --- a/third_party/sqlite/src/ext/fts3/fts3.c 18 --- a/third_party/sqlite/src/ext/fts3/fts3.c
18 +++ b/third_party/sqlite/src/ext/fts3/fts3.c 19 +++ b/third_party/sqlite/src/ext/fts3/fts3.c
19 @@ -291,6 +291,7 @@ 20 @@ -287,6 +287,7 @@
20 ** deletions and duplications. This would basically be a forced merge 21 ** query logic likewise merges doclists so that newer data knocks out
21 ** into a single segment. 22 ** older data.
22 */ 23 */
23 +#define CHROMIUM_FTS3_CHANGES 1 24 +#define CHROMIUM_FTS3_CHANGES 1
24 25
26 #include "fts3Int.h"
25 #if !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) 27 #if !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3)
26 28 @@ -3828,7 +3829,11 @@ int sqlite3Fts3Init(sqlite3 *db){
27 @@ -3646,7 +3647,11 @@ int sqlite3Fts3Init(sqlite3 *db){
28 ** module with sqlite. 29 ** module with sqlite.
29 */ 30 */
30 if( SQLITE_OK==rc 31 if( SQLITE_OK==rc
31 +#if CHROMIUM_FTS3_CHANGES && !SQLITE_TEST 32 +#if CHROMIUM_FTS3_CHANGES && !SQLITE_TEST
32 + /* fts3_tokenizer() disabled for security reasons. */ 33 + /* fts3_tokenizer() disabled for security reasons. */
33 +#else 34 +#else
34 && SQLITE_OK==(rc = sqlite3Fts3InitHashTable(db, pHash, "fts3_tokenizer")) 35 && SQLITE_OK==(rc = sqlite3Fts3InitHashTable(db, pHash, "fts3_tokenizer"))
35 +#endif 36 +#endif
36 && SQLITE_OK==(rc = sqlite3_overload_function(db, "snippet", -1)) 37 && SQLITE_OK==(rc = sqlite3_overload_function(db, "snippet", -1))
37 && SQLITE_OK==(rc = sqlite3_overload_function(db, "offsets", 1)) 38 && SQLITE_OK==(rc = sqlite3_overload_function(db, "offsets", 1))
38 && SQLITE_OK==(rc = sqlite3_overload_function(db, "matchinfo", 1)) 39 && SQLITE_OK==(rc = sqlite3_overload_function(db, "matchinfo", 1))
39 @@ -3656,11 +3661,15 @@ int sqlite3Fts3Init(sqlite3 *db){ 40 @@ -3838,6 +3843,9 @@ int sqlite3Fts3Init(sqlite3 *db){
40 rc = sqlite3_create_module_v2( 41 rc = sqlite3_create_module_v2(
41 db, "fts3", &fts3Module, (void *)pHash, hashDestroy 42 db, "fts3", &fts3Module, (void *)pHash, hashDestroy
42 ); 43 );
43 +#if CHROMIUM_FTS3_CHANGES && !SQLITE_TEST 44 +#if CHROMIUM_FTS3_CHANGES && !SQLITE_TEST
44 + /* Disable fts4 pending review. */ 45 + /* Disable fts4 and tokenizer vtab pending review. */
45 +#else 46 +#else
46 if( rc==SQLITE_OK ){ 47 if( rc==SQLITE_OK ){
47 rc = sqlite3_create_module_v2( 48 rc = sqlite3_create_module_v2(
48 db, "fts4", &fts3Module, (void *)pHash, 0 49 db, "fts4", &fts3Module, (void *)pHash, 0
49 ); 50 @@ -3846,6 +3854,7 @@ int sqlite3Fts3Init(sqlite3 *db){
51 if( rc==SQLITE_OK ){
52 rc = sqlite3Fts3InitTok(db, (void *)pHash);
50 } 53 }
51 +#endif 54 +#endif
52 return rc; 55 return rc;
53 } 56 }
54 57
55 -- 58 --
56 2.2.1 59 2.2.1
57 60
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698