Applied Android changes to v3.34.1 · xamarin/sqlite@daff8f4 (original) (raw)
1
``
`-
--- orig/shell.c 2020-07-09 13:55:18.598783417 +0100
`
2
``
`-
+++ shell.c 2020-10-06 00:01:10.631859326 +0100
`
3
``
`-
@@ -95,6 +95,11 @@
`
``
1
`+
diff --git a/dist/shell.c b/dist/shell.c
`
``
2
`+
index 6f4fee8..96ae749 100644
`
``
3
`+
--- a/dist/shell.c
`
``
4
`+
+++ b/dist/shell.c
`
``
5
`+
@@ -95,6 +95,11 @@ typedef unsigned char u8;
`
4
6
` #endif
`
5
7
` #include <ctype.h>
`
6
8
` #include <stdarg.h>
`
`@@ -12,7 +14,7 @@
`
12
14
``
13
15
` #if !defined(_WIN32) && !defined(WIN32)
`
14
16
` # include <signal.h>
`
15
``
`-
@@ -12957,6 +12962,22 @@
`
``
17
`+
@@ -14673,6 +14678,22 @@ static void open_db(ShellState *p, int openFlags){
`
16
18
` sqlite3_create_function(p->db, "edit", 2, SQLITE_UTF8, 0,
`
17
19
` editFunc, 0, 0);
`
18
20
` #endif
`
`@@ -35,9 +37,11 @@
`
35
37
` if( p->openMode==SHELL_OPEN_ZIPFILE ){
`
36
38
` char *zSql = sqlite3_mprintf(
`
37
39
` "CREATE VIRTUAL TABLE zip USING zipfile(%Q);", p->zDbFilename);
`
38
``
`-
--- orig/sqlite3.c 2020-07-09 13:55:18.706784068 +0100
`
39
``
`-
+++ sqlite3.c 2020-07-09 13:55:18.814784719 +0100
`
40
``
`-
@@ -33395,6 +33395,10 @@
`
``
40
`+
diff --git a/dist/sqlite3.c b/dist/sqlite3.c
`
``
41
`+
index 38874ce..e68646c 100644
`
``
42
`+
--- a/dist/sqlite3.c
`
``
43
`+
+++ b/dist/sqlite3.c
`
``
44
`+
@@ -33579,6 +33579,10 @@ SQLITE_PRIVATE const char *sqlite3OpcodeName(int i){
`
41
45
` # include <sys/mount.h>
`
42
46
` #endif
`
43
47
``
`@@ -48,7 +52,7 @@
`
48
52
` #ifdef HAVE_UTIME
`
49
53
` # include <utime.h>
`
50
54
` #endif
`
51
``
`-
@@ -34155,6 +34159,12 @@
`
``
55
`+
@@ -34339,6 +34343,12 @@ static int robust_open(const char *z, int f, mode_t m){
`
52
56
` #if defined(FD_CLOEXEC) && (!defined(O_CLOEXEC) || O_CLOEXEC==0)
`
53
57
` osFcntl(fd, F_SETFD, osFcntl(fd, F_GETFD, 0) | FD_CLOEXEC);
`
54
58
` #endif
`
`@@ -61,7 +65,7 @@
`
61
65
` }
`
62
66
` return fd;
`
63
67
` }
`
64
``
`-
@@ -34735,7 +34745,13 @@
`
``
68
`+
@@ -34919,7 +34929,13 @@ static int unixLogErrorAtLine(
`
65
69
` ** and move on.
`
66
70
` */
`
67
71
` static void robust_close(unixFile *pFile, int h, int lineno){
`
`@@ -75,7 +79,7 @@
`
75
79
` unixLogErrorAtLine(SQLITE_IOERR_CLOSE, "close",
`
76
80
` pFile ? pFile->zPath : 0, lineno);
`
77
81
` }
`
78
``
`-
@@ -37269,7 +37285,7 @@
`
``
82
`+
@@ -37474,7 +37490,7 @@ static int unixFileSize(sqlite3_file *id, i64 *pSize){
`
79
83
` SimulateIOError( rc=1 );
`
80
84
` if( rc!=0 ){
`
81
85
` storeLastErrno((unixFile*)id, errno);
`
`@@ -84,16 +88,16 @@
`
84
88
` }
`
85
89
` *pSize = buf.st_size;
`
86
90
``
87
``
`-
@@ -37305,7 +37321,7 @@
`
``
91
`+
@@ -37510,7 +37526,7 @@ static int fcntlSizeHint(unixFile *pFile, i64 nByte){
`
88
92
` struct stat buf; /* Used to hold return values of fstat() */
`
89
``
-
``
93
+
90
94
` if( osFstat(pFile->h, &buf) ){
`
91
95
`- return SQLITE_IOERR_FSTAT;
`
92
96
`+ return unixLogError(SQLITE_IOERR_FSTAT, "fstat", pFile->zPath);
`
93
97
` }
`
94
98
``
95
99
` nSize = ((nByte+pFile->szChunk-1) / pFile->szChunk) * pFile->szChunk;
`
96
``
`-
@@ -38000,7 +38016,7 @@
`
``
100
`+
@@ -38206,7 +38222,7 @@ static int unixOpenSharedMemory(unixFile *pDbFd){
`
97
101
` ** with the same permissions.
`
98
102
` */
`
99
103
` if( osFstat(pDbFd->h, &sStat) ){
`
`@@ -102,7 +106,7 @@
`
102
106
` goto shm_open_err;
`
103
107
` }
`
104
108
``
105
``
`-
@@ -128218,7 +128234,7 @@
`
``
109
`+
@@ -129165,7 +129181,7 @@ SQLITE_PRIVATE int sqlite3InitOne(sqlite3 *db, int iDb, char **pzErrMsg, u32 mFl
`
106
110
` }
`
107
111
` if( pDb->pSchema->file_format>SQLITE_MAX_FILE_FORMAT ){
`
108
112
` sqlite3SetString(pzErrMsg, db, "unsupported file format");
`
`@@ -111,10 +115,10 @@
`
111
115
` goto initone_error_out;
`
112
116
` }
`
113
117
``
114
``
`-
@@ -170128,13 +170144,25 @@
`
``
118
`+
@@ -171835,13 +171851,25 @@ SQLITE_PRIVATE int sqlite3Fts3Init(sqlite3 *db){
`
115
119
` ** module with sqlite.
`
116
120
` */
`
117
``
`-
if( SQLITE_OK==rc
`
``
121
`+
if( SQLITE_OK==rc
`
118
122
`+#ifndef ANDROID /* fts3_tokenizer disabled for security reasons */
`
119
123
` && SQLITE_OK==(rc = sqlite3Fts3InitHashTable(db, pHash, "fts3_tokenizer"))
`
120
124
`+#endif
`
`@@ -125,14 +129,14 @@
`
125
129
` && SQLITE_OK==(rc = sqlite3_overload_function(db, "optimize", 1))
`
126
130
` ){
`
127
131
`+#ifdef SQLITE_ENABLE_FTS3_BACKWARDS
`
128
``
`-
- rc = sqlite3_create_module_v2(
`
129
``
`-
- db, "fts1", &fts3Module, (void *)pHash, 0
`
130
``
`-
- );
`
131
``
`-
- if(rc) return rc;
`
132
``
`-
- rc = sqlite3_create_module_v2(
`
``
132
`+
- rc = sqlite3_create_module_v2(
`
``
133
`+
- db, "fts1", &fts3Module, (void *)pHash, 0
`
``
134
`+
- );
`
``
135
`+
- if(rc) return rc;
`
``
136
`+
- rc = sqlite3_create_module_v2(
`
133
137
`+ db, "fts2", &fts3Module, (void *)pHash, 0
`
134
138
`+ );
`
135
``
`-
- if(rc) return rc;
`
``
139
`+
- if(rc) return rc;
`
136
140
`+#endif
`
137
141
` rc = sqlite3_create_module_v2(
`
138
142
` db, "fts3", &fts3Module, (void *)pHash, hashDestroy
`