|
1 | | ---- orig/shell.c 2022-09-01 12:39:01.340032408 +0100 |
2 | | -+++ shell.c 2022-09-01 12:39:01.528030292 +0100 |
3 | | -@@ -107,6 +107,11 @@ |
| 1 | +diff --git a/dist/Android.patch b/dist/Android.patch |
| 2 | +index 3647d10..e69de29 100644 |
| 3 | +--- a/dist/Android.patch |
| 4 | ++++ b/dist/Android.patch |
| 5 | +@@ -1,144 +0,0 @@ |
| 6 | +---- orig/shell.c 2022-09-01 12:39:01.340032408 +0100 |
| 7 | +-+++ shell.c 2022-09-01 12:39:01.528030292 +0100 |
| 8 | +-@@ -107,6 +107,11 @@ |
| 9 | +- #endif |
| 10 | +- #include <ctype.h> |
| 11 | +- #include <stdarg.h> |
| 12 | +-+// Begin Android Add |
| 13 | +-+#ifndef NO_ANDROID_FUNCS |
| 14 | +-+#include <sqlite3_android.h> |
| 15 | +-+#endif |
| 16 | +-+// End Android Add |
| 17 | +- |
| 18 | +- #if !defined(_WIN32) && !defined(WIN32) |
| 19 | +- # include <signal.h> |
| 20 | +-@@ -16177,6 +16182,22 @@ |
| 21 | +- sqlite3_create_function(p->db, "edit", 2, SQLITE_UTF8, 0, |
| 22 | +- editFunc, 0, 0); |
| 23 | +- #endif |
| 24 | +-+ |
| 25 | +-+// Begin Android Add |
| 26 | +-+#ifndef NO_ANDROID_FUNCS |
| 27 | +-+ int err = register_localized_collators(p->db, "en_US", 0); |
| 28 | +-+ if (err != SQLITE_OK) { |
| 29 | +-+ fprintf(stderr, "register_localized_collators() failed\n"); |
| 30 | +-+ exit(1); |
| 31 | +-+ } |
| 32 | +-+ err = register_android_functions(p->db, 0); |
| 33 | +-+ if (err != SQLITE_OK) { |
| 34 | +-+ fprintf(stderr, "register_android_functions() failed\n"); |
| 35 | +-+ exit(1); |
| 36 | +-+ } |
| 37 | +-+#endif |
| 38 | +-+// End Android Add |
| 39 | +-+ |
| 40 | +- if( p->openMode==SHELL_OPEN_ZIPFILE ){ |
| 41 | +- char *zSql = sqlite3_mprintf( |
| 42 | +- "CREATE VIRTUAL TABLE zip USING zipfile(%Q);", zDbFilename); |
| 43 | +---- orig/sqlite3.c 2022-09-01 12:39:01.356032228 +0100 |
| 44 | +-+++ sqlite3.c 2022-09-01 12:39:15.955867966 +0100 |
| 45 | +-@@ -35608,6 +35608,10 @@ |
| 46 | +- # include <sys/mount.h> |
| 47 | +- #endif |
| 48 | +- |
| 49 | +-+#if defined(__BIONIC__) |
| 50 | +-+# include <android/fdsan.h> |
| 51 | +-+#endif |
| 52 | +-+ |
| 53 | +- #ifdef HAVE_UTIME |
| 54 | +- # include <utime.h> |
| 55 | +- #endif |
| 56 | +-@@ -36170,6 +36174,12 @@ |
| 57 | +- #if defined(FD_CLOEXEC) && (!defined(O_CLOEXEC) || O_CLOEXEC==0) |
| 58 | +- osFcntl(fd, F_SETFD, osFcntl(fd, F_GETFD, 0) | FD_CLOEXEC); |
| 59 | +- #endif |
| 60 | +-+ |
| 61 | +-+#if defined(__BIONIC__) && __ANDROID_API__ >= __ANDROID_API_Q__ |
| 62 | +-+ uint64_t tag = android_fdsan_create_owner_tag( |
| 63 | +-+ ANDROID_FDSAN_OWNER_TYPE_SQLITE, fd); |
| 64 | +-+ android_fdsan_exchange_owner_tag(fd, 0, tag); |
| 65 | +-+#endif |
| 66 | +- } |
| 67 | +- return fd; |
| 68 | +- } |
| 69 | +-@@ -36750,7 +36760,13 @@ |
| 70 | +- ** and move on. |
| 71 | +- */ |
| 72 | +- static void robust_close(unixFile *pFile, int h, int lineno){ |
| 73 | +-+#if defined(__BIONIC__) && __ANDROID_API__ >= __ANDROID_API_Q__ |
| 74 | +-+ uint64_t tag = android_fdsan_create_owner_tag( |
| 75 | +-+ ANDROID_FDSAN_OWNER_TYPE_SQLITE, h); |
| 76 | +-+ if( android_fdsan_close_with_tag(h, tag) ){ |
| 77 | +-+#else |
| 78 | +- if( osClose(h) ){ |
| 79 | +-+#endif |
| 80 | +- unixLogErrorAtLine(SQLITE_IOERR_CLOSE, "close", |
| 81 | +- pFile ? pFile->zPath : 0, lineno); |
| 82 | +- } |
| 83 | +-@@ -39305,7 +39321,7 @@ |
| 84 | +- SimulateIOError( rc=1 ); |
| 85 | +- if( rc!=0 ){ |
| 86 | +- storeLastErrno((unixFile*)id, errno); |
| 87 | +-- return SQLITE_IOERR_FSTAT; |
| 88 | +-+ return unixLogError(SQLITE_IOERR_FSTAT, "fstat", ((unixFile*)id)->zPath); |
| 89 | +- } |
| 90 | +- *pSize = buf.st_size; |
| 91 | +- |
| 92 | +-@@ -39341,7 +39357,7 @@ |
| 93 | +- struct stat buf; /* Used to hold return values of fstat() */ |
| 94 | +- |
| 95 | +- if( osFstat(pFile->h, &buf) ){ |
| 96 | +-- return SQLITE_IOERR_FSTAT; |
| 97 | +-+ return unixLogError(SQLITE_IOERR_FSTAT, "fstat", pFile->zPath); |
| 98 | +- } |
| 99 | +- |
| 100 | +- nSize = ((nByte+pFile->szChunk-1) / pFile->szChunk) * pFile->szChunk; |
| 101 | +-@@ -40083,7 +40099,7 @@ |
| 102 | +- ** with the same permissions. |
| 103 | +- */ |
| 104 | +- if( osFstat(pDbFd->h, &sStat) ){ |
| 105 | +-- rc = SQLITE_IOERR_FSTAT; |
| 106 | +-+ rc = unixLogError(SQLITE_IOERR_FSTAT, "fstat", pDbFd->zPath); |
| 107 | +- goto shm_open_err; |
| 108 | +- } |
| 109 | +- |
| 110 | +-@@ -134802,7 +134818,7 @@ |
| 111 | +- } |
| 112 | +- if( pDb->pSchema->file_format>SQLITE_MAX_FILE_FORMAT ){ |
| 113 | +- sqlite3SetString(pzErrMsg, db, "unsupported file format"); |
| 114 | +-- rc = SQLITE_ERROR; |
| 115 | +-+ rc = SQLITE_CORRUPT_BKPT; // Android Change from "rc = SQLITE_ERROR;"; |
| 116 | +- goto initone_error_out; |
| 117 | +- } |
| 118 | +- |
| 119 | +-@@ -180855,7 +180871,9 @@ |
| 120 | +- ** module with sqlite. |
| 121 | +- */ |
| 122 | +- if( SQLITE_OK==rc |
| 123 | +-+#ifndef ANDROID /* fts3_tokenizer disabled for security reasons */ |
| 124 | +- && SQLITE_OK==(rc=sqlite3Fts3InitHashTable(db,&pHash->hash,"fts3_tokenizer")) |
| 125 | +-+#endif |
| 126 | +- && SQLITE_OK==(rc = sqlite3_overload_function(db, "snippet", -1)) |
| 127 | +- && SQLITE_OK==(rc = sqlite3_overload_function(db, "offsets", 1)) |
| 128 | +- && SQLITE_OK==(rc = sqlite3_overload_function(db, "matchinfo", 1)) |
| 129 | +-@@ -180866,6 +180884,20 @@ |
| 130 | +- rc = sqlite3_create_module_v2( |
| 131 | +- db, "fts3", &fts3Module, (void *)pHash, hashDestroy |
| 132 | +- ); |
| 133 | +-+#ifdef SQLITE_ENABLE_FTS3_BACKWARDS |
| 134 | +-+ if( rc==SQLITE_OK ){ |
| 135 | +-+ pHash->nRef++; |
| 136 | +-+ rc = sqlite3_create_module_v2( |
| 137 | +-+ db, "fts1", &fts3Module, (void *)pHash, hashDestroy |
| 138 | +-+ ); |
| 139 | +-+ } |
| 140 | +-+ if( rc==SQLITE_OK ){ |
| 141 | +-+ pHash->nRef++; |
| 142 | +-+ rc = sqlite3_create_module_v2( |
| 143 | +-+ db, "fts2", &fts3Module, (void *)pHash, hashDestroy |
| 144 | +-+ ); |
| 145 | +-+ } |
| 146 | +-+#endif |
| 147 | +- if( rc==SQLITE_OK ){ |
| 148 | +- pHash->nRef++; |
| 149 | +- rc = sqlite3_create_module_v2( |
| 150 | +diff --git a/dist/shell.c b/dist/shell.c |
| 151 | +index 6280ebf..8bf6d38 100644 |
| 152 | +--- a/dist/shell.c |
| 153 | ++++ b/dist/shell.c |
| 154 | +@@ -126,6 +126,11 @@ typedef unsigned char u8; |
4 | 155 | #endif |
5 | 156 | #include <ctype.h> |
6 | 157 | #include <stdarg.h> |
|
12 | 163 |
|
13 | 164 | #if !defined(_WIN32) && !defined(WIN32) |
14 | 165 | # include <signal.h> |
15 | | -@@ -16177,6 +16182,22 @@ |
| 166 | +@@ -19557,6 +19562,22 @@ static void open_db(ShellState *p, int openFlags){ |
16 | 167 | sqlite3_create_function(p->db, "edit", 2, SQLITE_UTF8, 0, |
17 | 168 | editFunc, 0, 0); |
18 | 169 | #endif |
|
35 | 186 | if( p->openMode==SHELL_OPEN_ZIPFILE ){ |
36 | 187 | char *zSql = sqlite3_mprintf( |
37 | 188 | "CREATE VIRTUAL TABLE zip USING zipfile(%Q);", zDbFilename); |
38 | | ---- orig/sqlite3.c 2022-09-01 12:39:01.356032228 +0100 |
39 | | -+++ sqlite3.c 2022-09-01 12:39:15.955867966 +0100 |
40 | | -@@ -35608,6 +35608,10 @@ |
| 189 | +diff --git a/dist/sqlite3.c b/dist/sqlite3.c |
| 190 | +index 2763b1b..4c366a0 100644 |
| 191 | +--- a/dist/sqlite3.c |
| 192 | ++++ b/dist/sqlite3.c |
| 193 | +@@ -36795,6 +36795,10 @@ SQLITE_PRIVATE int sqlite3KvvfsInit(void){ |
41 | 194 | # include <sys/mount.h> |
42 | 195 | #endif |
43 | 196 |
|
|
48 | 201 | #ifdef HAVE_UTIME |
49 | 202 | # include <utime.h> |
50 | 203 | #endif |
51 | | -@@ -36170,6 +36174,12 @@ |
| 204 | +@@ -37357,6 +37361,12 @@ static int robust_open(const char *z, int f, mode_t m){ |
52 | 205 | #if defined(FD_CLOEXEC) && (!defined(O_CLOEXEC) || O_CLOEXEC==0) |
53 | 206 | osFcntl(fd, F_SETFD, osFcntl(fd, F_GETFD, 0) | FD_CLOEXEC); |
54 | 207 | #endif |
|
61 | 214 | } |
62 | 215 | return fd; |
63 | 216 | } |
64 | | -@@ -36750,7 +36760,13 @@ |
| 217 | +@@ -37937,7 +37947,13 @@ static int unixLogErrorAtLine( |
65 | 218 | ** and move on. |
66 | 219 | */ |
67 | 220 | static void robust_close(unixFile *pFile, int h, int lineno){ |
|
75 | 228 | unixLogErrorAtLine(SQLITE_IOERR_CLOSE, "close", |
76 | 229 | pFile ? pFile->zPath : 0, lineno); |
77 | 230 | } |
78 | | -@@ -39305,7 +39321,7 @@ |
| 231 | +@@ -40492,7 +40508,7 @@ static int unixFileSize(sqlite3_file *id, i64 *pSize){ |
79 | 232 | SimulateIOError( rc=1 ); |
80 | 233 | if( rc!=0 ){ |
81 | 234 | storeLastErrno((unixFile*)id, errno); |
|
84 | 237 | } |
85 | 238 | *pSize = buf.st_size; |
86 | 239 |
|
87 | | -@@ -39341,7 +39357,7 @@ |
| 240 | +@@ -40528,7 +40544,7 @@ static int fcntlSizeHint(unixFile *pFile, i64 nByte){ |
88 | 241 | struct stat buf; /* Used to hold return values of fstat() */ |
89 | 242 |
|
90 | 243 | if( osFstat(pFile->h, &buf) ){ |
|
93 | 246 | } |
94 | 247 |
|
95 | 248 | nSize = ((nByte+pFile->szChunk-1) / pFile->szChunk) * pFile->szChunk; |
96 | | -@@ -40083,7 +40099,7 @@ |
| 249 | +@@ -41270,7 +41286,7 @@ static int unixOpenSharedMemory(unixFile *pDbFd){ |
97 | 250 | ** with the same permissions. |
98 | 251 | */ |
99 | 252 | if( osFstat(pDbFd->h, &sStat) ){ |
|
102 | 255 | goto shm_open_err; |
103 | 256 | } |
104 | 257 |
|
105 | | -@@ -134802,7 +134818,7 @@ |
| 258 | +@@ -136541,7 +136557,7 @@ SQLITE_PRIVATE int sqlite3InitOne(sqlite3 *db, int iDb, char **pzErrMsg, u32 mFl |
106 | 259 | } |
107 | 260 | if( pDb->pSchema->file_format>SQLITE_MAX_FILE_FORMAT ){ |
108 | 261 | sqlite3SetString(pzErrMsg, db, "unsupported file format"); |
|
111 | 264 | goto initone_error_out; |
112 | 265 | } |
113 | 266 |
|
114 | | -@@ -180855,7 +180871,9 @@ |
| 267 | +@@ -182688,7 +182704,9 @@ SQLITE_PRIVATE int sqlite3Fts3Init(sqlite3 *db){ |
115 | 268 | ** module with sqlite. |
116 | 269 | */ |
117 | 270 | if( SQLITE_OK==rc |
|
121 | 274 | && SQLITE_OK==(rc = sqlite3_overload_function(db, "snippet", -1)) |
122 | 275 | && SQLITE_OK==(rc = sqlite3_overload_function(db, "offsets", 1)) |
123 | 276 | && SQLITE_OK==(rc = sqlite3_overload_function(db, "matchinfo", 1)) |
124 | | -@@ -180866,6 +180884,20 @@ |
| 277 | +@@ -182699,6 +182717,20 @@ SQLITE_PRIVATE int sqlite3Fts3Init(sqlite3 *db){ |
125 | 278 | rc = sqlite3_create_module_v2( |
126 | 279 | db, "fts3", &fts3Module, (void *)pHash, hashDestroy |
127 | 280 | ); |
|
0 commit comments