| Index: third_party/sqlite/mac_time_machine.patch
|
| ===================================================================
|
| --- third_party/sqlite/mac_time_machine.patch (revision 0)
|
| +++ third_party/sqlite/mac_time_machine.patch (revision 0)
|
| @@ -0,0 +1,118 @@
|
| +Index: src/sqliteInt.h
|
| +===================================================================
|
| +--- src/sqliteInt.h (revision 86831)
|
| ++++ src/sqliteInt.h (working copy)
|
| +@@ -2522,6 +2522,16 @@
|
| + #endif
|
| +
|
| + /*
|
| ++** The CoreServices.h and CoreFoundation.h headers are needed for excluding a
|
| ++** -journal file from Time Machine backups when its associated database has
|
| ++** previously been excluded by the client code.
|
| ++*/
|
| ++#if defined(__APPLE__)
|
| ++#include <CoreServices/CoreServices.h>
|
| ++#include <CoreFoundation/CoreFoundation.h>
|
| ++#endif
|
| ++
|
| ++/*
|
| + ** The following macros mimic the standard library functions toupper(),
|
| + ** isspace(), isalnum(), isdigit() and isxdigit(), respectively. The
|
| + ** sqlite versions only work for ASCII characters, regardless of locale.
|
| +Index: src/pager.c
|
| +===================================================================
|
| +--- src/pager.c (revision 86831)
|
| ++++ src/pager.c (working copy)
|
| +@@ -429,6 +429,11 @@
|
| + #define MAX_SECTOR_SIZE 0x10000
|
| +
|
| + /*
|
| ++** The string appended to the database file name giving the journal file name.
|
| ++*/
|
| ++static const char kPagerJournalSuffix[] = "-journal";
|
| ++
|
| ++/*
|
| + ** An instance of the following structure is allocated for each active
|
| + ** savepoint and statement transaction in the system. All such structures
|
| + ** are stored in the Pager.aSavepoint[] array, which is allocated and
|
| +@@ -5130,7 +5135,20 @@
|
| + }
|
| + }
|
| +
|
| ++#if defined(__APPLE__)
|
| + /*
|
| ++** Create and return a CFURLRef given a cstring containing the path to a file.
|
| ++*/
|
| ++static CFURLRef create_cfurl_from_cstring(const char* file_path){
|
| ++ CFURLRef url_ref = CFURLCreateWithFileSystemPath(kCFAllocatorDefault,
|
| ++ CFStringCreateWithFileSystemRepresentation(
|
| ++ kCFAllocatorDefault, file_path),
|
| ++ kCFURLPOSIXPathStyle, FALSE);
|
| ++ return url_ref;
|
| ++}
|
| ++#endif
|
| ++
|
| ++/*
|
| + ** This function is called at the start of every write transaction.
|
| + ** There must already be a RESERVED or EXCLUSIVE lock on the database
|
| + ** file when this routine is called.
|
| +@@ -5191,6 +5209,28 @@
|
| + #endif
|
| + }
|
| + assert( rc!=SQLITE_OK || isOpen(pPager->jfd) );
|
| ++#if defined(__APPLE__)
|
| ++ // Set the TimeMachine exclusion metadata for the journal if it has
|
| ++ // been set for the database.
|
| ++ if( rc == SQLITE_OK && pPager->zJournal ){
|
| ++ int database_path_size = strlen(pPager->zJournal)
|
| ++ - strlen(kPagerJournalSuffix) + 1;
|
| ++ char *database_path = sqlite3Malloc(database_path_size);
|
| ++ CFURLRef database_url = NULL;
|
| ++ strlcpy(database_path, pPager->zJournal, database_path_size);
|
| ++ database_url = create_cfurl_from_cstring(database_path);
|
| ++ sqlite3_free(database_path);
|
| ++ Boolean exclude_by_path;
|
| ++ if( CSBackupIsItemExcluded(database_url, &exclude_by_path)
|
| ++ && !exclude_by_path){
|
| ++ CFURLRef journal_url = create_cfurl_from_cstring(pPager->zJournal);
|
| ++ // Ignore errors from the following exclusion call.
|
| ++ CSBackupSetItemExcluded(journal_url, TRUE, FALSE);
|
| ++ CFRelease(journal_url);
|
| ++ }
|
| ++ CFRelease(database_url);
|
| ++ }
|
| ++#endif
|
| + }
|
| +
|
| +
|
| +Index: ext/fts3/fts3_porter.c
|
| +===================================================================
|
| +--- ext/fts3/fts3_porter.c (revision 86831)
|
| ++++ ext/fts3/fts3_porter.c (working copy)
|
| +@@ -129,7 +129,7 @@
|
| + /*
|
| + ** Vowel or consonant
|
| + */
|
| +-static const char cType[] = {
|
| ++static const char vOrCType[] = {
|
| + 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 @@
|
| + char x = *z;
|
| + if( x==0 ) return 0;
|
| + assert( x>='a' && x<='z' );
|
| +- j = cType[x-'a'];
|
| ++ j = vOrCType[x-'a'];
|
| + if( j<2 ) return j;
|
| + return z[1]==0 || isVowel(z + 1);
|
| + }
|
| +@@ -162,7 +162,7 @@
|
| + char x = *z;
|
| + if( x==0 ) return 0;
|
| + assert( x>='a' && x<='z' );
|
| +- j = cType[x-'a'];
|
| ++ j = vOrCType[x-'a'];
|
| + if( j<2 ) return 1-j;
|
| + return isConsonant(z + 1);
|
| + }
|
|
|