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

Unified Diff: third_party/sqlite/amalgamation/sqlite3.c

Side-by-side diff isn't available for this file because of its large size.
Issue 2623083002: [sql] Move time-machine support from third_party/sqlite to sql/ (Closed)
Patch Set: scoped-ref in test, too, iwyu pass to remove leftover-from-prototype includes. Created 3 years, 11 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:
Download patch
Index: third_party/sqlite/amalgamation/sqlite3.c
diff --git a/third_party/sqlite/amalgamation/sqlite3.c b/third_party/sqlite/amalgamation/sqlite3.c
index 97d1ab9912109aba2d8c6268f4967449c2b4b28c..09fb4874fbfbb9eb8c96c2a48d9d929d2e8402d4 100644
--- a/third_party/sqlite/amalgamation/sqlite3.c
+++ b/third_party/sqlite/amalgamation/sqlite3.c
@@ -13995,16 +13995,6 @@ SQLITE_PRIVATE int sqlite3CantopenError(int);
#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.
@@ -48994,20 +48984,6 @@ SQLITE_PRIVATE void sqlite3PagerUnref(DbPage *pPg){
if( pPg ) sqlite3PagerUnrefNotNull(pPg);
}
-#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* filePath){
- CFStringRef urlString = CFStringCreateWithFileSystemRepresentation(
- kCFAllocatorDefault, filePath);
- CFURLRef urlRef = CFURLCreateWithFileSystemPath(kCFAllocatorDefault,
- urlString, kCFURLPOSIXPathStyle, FALSE);
- CFRelease(urlString);
- return urlRef;
-}
-#endif
-
/*
** This function is called at the start of every write transaction.
** There must already be a RESERVED or EXCLUSIVE lock on the database
@@ -49072,24 +49048,6 @@ 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);
- }
- CFRelease(database);
- }
-#endif
}
}
assert( rc!=SQLITE_OK || isOpen(pPager->jfd) );
@@ -145687,7 +145645,7 @@ static int porterClose(sqlite3_tokenizer_cursor *pCursor){
/*
** Vowel or consonant
*/
-static const char vOrCType[] = {
+static const char cType[] = {
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
};
@@ -145711,7 +145669,7 @@ static int isConsonant(const char *z){
char x = *z;
if( x==0 ) return 0;
assert( x>='a' && x<='z' );
- j = vOrCType[x-'a'];
+ j = cType[x-'a'];
if( j<2 ) return j;
return z[1]==0 || isVowel(z + 1);
}
@@ -145720,7 +145678,7 @@ static int isVowel(const char *z){
char x = *z;
if( x==0 ) return 0;
assert( x>='a' && x<='z' );
- j = vOrCType[x-'a'];
+ j = cType[x-'a'];
if( j<2 ) return 1-j;
return isConsonant(z + 1);
}
« no previous file with comments | « sql/vfs_wrapper.cc ('k') | third_party/sqlite/patches/0003-Exclude-journal-file-from-Time-Machine-if-database-i.patch » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698