Index: third_party/sqlite/patches/0004-Exclude-journal-file-from-Time-Machine-if-database-i.patch |
diff --git a/third_party/sqlite/patches/0005-Exclude-journal-file-from-Time-Machine-if-database-i.patch b/third_party/sqlite/patches/0004-Exclude-journal-file-from-Time-Machine-if-database-i.patch |
similarity index 70% |
rename from third_party/sqlite/patches/0005-Exclude-journal-file-from-Time-Machine-if-database-i.patch |
rename to third_party/sqlite/patches/0004-Exclude-journal-file-from-Time-Machine-if-database-i.patch |
index eee979e21f149a617548172444793e9cb970d6f9..b9cf9d517401bc0428cdc2a2620a62461c8f691f 100644 |
--- a/third_party/sqlite/patches/0005-Exclude-journal-file-from-Time-Machine-if-database-i.patch |
+++ b/third_party/sqlite/patches/0004-Exclude-journal-file-from-Time-Machine-if-database-i.patch |
@@ -1,7 +1,7 @@ |
-From 74d49159b2d2e227095872b96aacc0f40edc4a20 Mon Sep 17 00:00:00 2001 |
+From edfff157e1d9292bfcce6553b76ee913b53b1aa1 Mon Sep 17 00:00:00 2001 |
From: mrossetti <mrossetti@chromium.org> |
Date: Tue, 31 May 2011 23:12:11 +0000 |
-Subject: [PATCH 05/23] Exclude journal file from Time Machine if database is |
+Subject: [PATCH 04/16] Exclude journal file from Time Machine if database is |
excluded. |
BUG=74053 |
@@ -11,6 +11,8 @@ Original review URL: http://codereview.chromium.org/6990066 |
TODO(shess): The fts3_porter.c change is due to a conflict with an included |
Apple library. Perhaps move the operative code to a .c file, and firewall |
SQLite from that include. |
+ |
+TODO(shess): Revisit this for -wal mode. http://crbug.com/78507 |
--- |
third_party/sqlite/src/Makefile.linux-gcc | 4 ++++ |
third_party/sqlite/src/ext/fts3/fts3_porter.c | 6 ++--- |
@@ -36,10 +38,10 @@ index 6d67ba7..554bf56 100644 |
#### Leave SQLITE_DEBUG undefined for maximum speed. Use SQLITE_DEBUG=1 |
# to check for memory leaks. Use SQLITE_DEBUG=2 to print a log of all |
diff --git a/third_party/sqlite/src/ext/fts3/fts3_porter.c b/third_party/sqlite/src/ext/fts3/fts3_porter.c |
-index 27f9cf3..f7f047c 100644 |
+index db175ac..933602a 100644 |
--- a/third_party/sqlite/src/ext/fts3/fts3_porter.c |
+++ b/third_party/sqlite/src/ext/fts3/fts3_porter.c |
-@@ -129,7 +129,7 @@ static int porterClose(sqlite3_tokenizer_cursor *pCursor){ |
+@@ -128,7 +128,7 @@ static int porterClose(sqlite3_tokenizer_cursor *pCursor){ |
/* |
** Vowel or consonant |
*/ |
@@ -48,7 +50,7 @@ index 27f9cf3..f7f047c 100644 |
0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, |
1, 1, 1, 2, 1 |
}; |
-@@ -153,7 +153,7 @@ static int isConsonant(const char *z){ |
+@@ -152,7 +152,7 @@ static int isConsonant(const char *z){ |
char x = *z; |
if( x==0 ) return 0; |
assert( x>='a' && x<='z' ); |
@@ -57,7 +59,7 @@ index 27f9cf3..f7f047c 100644 |
if( j<2 ) return j; |
return z[1]==0 || isVowel(z + 1); |
} |
-@@ -162,7 +162,7 @@ static int isVowel(const char *z){ |
+@@ -161,7 +161,7 @@ static int isVowel(const char *z){ |
char x = *z; |
if( x==0 ) return 0; |
assert( x>='a' && x<='z' ); |
@@ -67,24 +69,24 @@ index 27f9cf3..f7f047c 100644 |
return isConsonant(z + 1); |
} |
diff --git a/third_party/sqlite/src/main.mk b/third_party/sqlite/src/main.mk |
-index e1df7a7..b0aa4b2 100644 |
+index 4a7ac02..dc56b0d 100644 |
--- a/third_party/sqlite/src/main.mk |
+++ b/third_party/sqlite/src/main.mk |
-@@ -513,7 +513,7 @@ TESTFIXTURE_FLAGS += -DSQLITE_SERVER=1 -DSQLITE_PRIVATE="" -DSQLITE_CORE |
+@@ -591,7 +591,7 @@ TESTFIXTURE_FLAGS += -DSQLITE_SERVER=1 -DSQLITE_PRIVATE="" -DSQLITE_CORE |
testfixture$(EXE): $(TESTSRC2) libsqlite3.a $(TESTSRC) $(TOP)/src/tclsqlite.c |
$(TCCX) $(TCL_FLAGS) -DTCLSH=1 $(TESTFIXTURE_FLAGS) \ |
$(TESTSRC) $(TESTSRC2) $(TOP)/src/tclsqlite.c \ |
-- -o testfixture$(EXE) $(LIBTCL) $(THREADLIB) libsqlite3.a |
-+ -o testfixture$(EXE) $(LIBTCL) $(THREADLIB) libsqlite3.a $(TLIBS) |
+- -o testfixture$(EXE) $(LIBTCL) libsqlite3.a $(THREADLIB) |
++ -o testfixture$(EXE) $(LIBTCL) libsqlite3.a $(THREADLIB) $(TLIBS) |
amalgamation-testfixture$(EXE): sqlite3.c $(TESTSRC) $(TOP)/src/tclsqlite.c |
$(TCCX) $(TCL_FLAGS) -DTCLSH=1 $(TESTFIXTURE_FLAGS) \ |
diff --git a/third_party/sqlite/src/src/pager.c b/third_party/sqlite/src/src/pager.c |
-index e6d1cde..a4fe318 100644 |
+index d840a39..34fa50f 100644 |
--- a/third_party/sqlite/src/src/pager.c |
+++ b/third_party/sqlite/src/src/pager.c |
-@@ -5093,6 +5093,20 @@ void sqlite3PagerUnref(DbPage *pPg){ |
- } |
+@@ -5467,6 +5467,20 @@ void sqlite3PagerUnref(DbPage *pPg){ |
+ if( pPg ) sqlite3PagerUnrefNotNull(pPg); |
} |
+#if defined(__APPLE__) |
@@ -104,36 +106,36 @@ index e6d1cde..a4fe318 100644 |
/* |
** This function is called at the start of every write transaction. |
** There must already be a RESERVED or EXCLUSIVE lock on the database |
-@@ -5152,6 +5166,24 @@ static int pager_open_journal(Pager *pPager){ |
- #else |
- rc = sqlite3OsOpen(pVfs, pPager->zJournal, pPager->jfd, flags, 0); |
- #endif |
+@@ -5531,6 +5545,24 @@ static int pager_open_journal(Pager *pPager){ |
+ #else |
+ rc = sqlite3OsOpen(pVfs, pPager->zJournal, pPager->jfd, flags, 0); |
+ #endif |
+#if defined(__APPLE__) |
-+ /* Set the TimeMachine exclusion metadata for the journal if it has |
-+ ** been set for the database. Only do this for unix-type vfs |
-+ ** implementations. */ |
-+ if( rc==SQLITE_OK && pPager->zFilename!=NULL |
-+ && strlen(pPager->zFilename)>0 |
-+ && strncmp(pVfs->zName, "unix", 4)==0 |
-+ && ( pVfs->zName[4]=='-' || pVfs->zName[4]=='\0' ) ){ |
-+ CFURLRef database = create_cfurl_from_cstring(pPager->zFilename); |
-+ if( CSBackupIsItemExcluded(database, NULL) ){ |
-+ CFURLRef journal = create_cfurl_from_cstring(pPager->zJournal); |
-+ /* Ignore errors from the following exclusion call. */ |
-+ CSBackupSetItemExcluded(journal, TRUE, FALSE); |
-+ CFRelease(journal); |
++ /* Set the TimeMachine exclusion metadata for the journal if it has |
++ ** been set for the database. Only do this for unix-type vfs |
++ ** implementations. */ |
++ if( rc==SQLITE_OK && pPager->zFilename!=NULL |
++ && strlen(pPager->zFilename)>0 |
++ && strncmp(pVfs->zName, "unix", 4)==0 |
++ && ( pVfs->zName[4]=='-' || pVfs->zName[4]=='\0' ) ){ |
++ CFURLRef database = create_cfurl_from_cstring(pPager->zFilename); |
++ if( CSBackupIsItemExcluded(database, NULL) ){ |
++ CFURLRef journal = create_cfurl_from_cstring(pPager->zJournal); |
++ /* Ignore errors from the following exclusion call. */ |
++ CSBackupSetItemExcluded(journal, TRUE, FALSE); |
++ CFRelease(journal); |
++ } |
++ CFRelease(database); |
+ } |
-+ CFRelease(database); |
-+ } |
+#endif |
+ } |
} |
assert( rc!=SQLITE_OK || isOpen(pPager->jfd) ); |
- } |
diff --git a/third_party/sqlite/src/src/sqliteInt.h b/third_party/sqlite/src/src/sqliteInt.h |
-index ea0925e..684fa57 100644 |
+index 63036c5..9d6a7d8 100644 |
--- a/third_party/sqlite/src/src/sqliteInt.h |
+++ b/third_party/sqlite/src/src/sqliteInt.h |
-@@ -2522,6 +2522,16 @@ int sqlite3CantopenError(int); |
+@@ -2985,6 +2985,16 @@ int sqlite3CantopenError(int); |
#endif |
/* |