Skip to content
This repository has been archived by the owner on Dec 21, 2024. It is now read-only.

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
* upstream/master:
  Remove AIcu_initializeOrDie call
  Update fix for issue 147928666.
  Update fix for issue 147928666.
  Fix for sqlite3_open_v2 returning errors.
  Fix for sqlite3_open_v2 returning errors.
  sqlite: Upgrade to SQLite 3.32.2
  Update OWNERS for sqlite
  sqlite: Upgrade to SQLite 3.32.2
  Fix 'ALTER RENAME TABLE' compat issue
  Fix CVE-2019-13734CVE-2019-13751CVE-2019-13752, CVE-2019-13753
  [RESTRICT AUTOMERGE] Apply Android.patch to dist directory
  sqlite3_android.cpp: disable _TOKENIZE
  sqlite: Fix code format issue
  • Loading branch information
grendello committed Jan 5, 2021
2 parents 0860d30 + 6dc3f23 commit 0787eb8
Show file tree
Hide file tree
Showing 13 changed files with 37,650 additions and 18,591 deletions.
2 changes: 2 additions & 0 deletions OWNERS
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
zezeozue@google.com
nandana@google.com
omakoto@google.com
jsharkey@android.com
yamasani@google.com
4 changes: 2 additions & 2 deletions README.version
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
URL: https://sqlite.org/2019/sqlite-autoconf-3280000.tar.gz
Version: 3.28.0 884b4b7e
URL: https://www.sqlite.org/2020/sqlite-autoconf-3320200.tar.gz
Version: 3.32.2 44a58d6c
BugComponent: 24950
5 changes: 4 additions & 1 deletion android/Android.bp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ cc_library_static {
],
target: {
android: {
cflags: ["-DSQLITE_ENABLE_ICU"],
cflags: [
"-DSQLITE_ENABLE_ICU",
"-DSQLITE_DEFAULT_LEGACY_ALTER_TABLE",
],
shared_libs: [
"libandroidicu",
],
Expand Down
4 changes: 4 additions & 0 deletions dist/Android.bp
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,12 @@ cc_defaults {
"-DSQLITE_SECURE_DELETE",
"-DSQLITE_ENABLE_BATCH_ATOMIC_WRITE",
"-DBIONIC_IOCTL_NO_SIGNEDNESS_OVERLOAD",
"-DSQLITE_DEFAULT_LEGACY_ALTER_TABLE",
"-Wno-unused-parameter",
"-Werror",

// Default value causes sqlite3_open_v2 to return error if DB is missing.
"-ftrivial-auto-var-init=pattern",
],

target: {
Expand Down
30 changes: 14 additions & 16 deletions dist/Android.patch
Original file line number Diff line number Diff line change
@@ -1,26 +1,24 @@
--- orig/shell.c 2019-06-11 15:05:36.341739007 -0700
+++ shell.c 2019-06-11 15:05:36.401739332 -0700
@@ -87,6 +87,12 @@
--- orig/shell.c 2020-07-09 13:55:18.598783417 +0100
+++ shell.c 2020-10-06 00:01:10.631859326 +0100
@@ -95,6 +95,11 @@
#endif
#include <ctype.h>
#include <stdarg.h>
+// Begin Android Add
+#ifndef NO_ANDROID_FUNCS
+#include <aicu/AIcu.h>
+#include <sqlite3_android.h>
+#endif
+// End Android Add

#if !defined(_WIN32) && !defined(WIN32)
# include <signal.h>
@@ -11698,6 +11704,23 @@
@@ -12957,6 +12962,22 @@
sqlite3_create_function(p->db, "edit", 2, SQLITE_UTF8, 0,
editFunc, 0, 0);
#endif
+
+// Begin Android Add
+#ifndef NO_ANDROID_FUNCS
+ AIcu_initializeIcuOrDie();
+ int err = register_localized_collators(p->db, "en_US", 0);
+ if (err != SQLITE_OK) {
+ fprintf(stderr, "register_localized_collators() failed\n");
Expand All @@ -37,9 +35,9 @@
if( p->openMode==SHELL_OPEN_ZIPFILE ){
char *zSql = sqlite3_mprintf(
"CREATE VIRTUAL TABLE zip USING zipfile(%Q);", p->zDbFilename);
--- orig/sqlite3.c 2019-06-11 15:05:36.393739289 -0700
+++ sqlite3.c 2019-06-11 15:05:36.449739593 -0700
@@ -32438,6 +32438,10 @@
--- orig/sqlite3.c 2020-07-09 13:55:18.706784068 +0100
+++ sqlite3.c 2020-07-09 13:55:18.814784719 +0100
@@ -33395,6 +33395,10 @@
# include <sys/mount.h>
#endif

Expand All @@ -50,7 +48,7 @@
#ifdef HAVE_UTIME
# include <utime.h>
#endif
@@ -33197,6 +33201,12 @@
@@ -34155,6 +34159,12 @@
#if defined(FD_CLOEXEC) && (!defined(O_CLOEXEC) || O_CLOEXEC==0)
osFcntl(fd, F_SETFD, osFcntl(fd, F_GETFD, 0) | FD_CLOEXEC);
#endif
Expand All @@ -63,7 +61,7 @@
}
return fd;
}
@@ -33777,7 +33787,13 @@
@@ -34735,7 +34745,13 @@
** and move on.
*/
static void robust_close(unixFile *pFile, int h, int lineno){
Expand All @@ -77,7 +75,7 @@
unixLogErrorAtLine(SQLITE_IOERR_CLOSE, "close",
pFile ? pFile->zPath : 0, lineno);
}
@@ -36310,7 +36326,7 @@
@@ -37269,7 +37285,7 @@
SimulateIOError( rc=1 );
if( rc!=0 ){
storeLastErrno((unixFile*)id, errno);
Expand All @@ -86,7 +84,7 @@
}
*pSize = buf.st_size;

@@ -36346,7 +36362,7 @@
@@ -37305,7 +37321,7 @@
struct stat buf; /* Used to hold return values of fstat() */

if( osFstat(pFile->h, &buf) ){
Expand All @@ -95,7 +93,7 @@
}

nSize = ((nByte+pFile->szChunk-1) / pFile->szChunk) * pFile->szChunk;
@@ -37032,7 +37048,7 @@
@@ -38000,7 +38016,7 @@
** with the same permissions.
*/
if( osFstat(pDbFd->h, &sStat) ){
Expand All @@ -104,7 +102,7 @@
goto shm_open_err;
}

@@ -123984,7 +124000,7 @@
@@ -128218,7 +128234,7 @@
}
if( pDb->pSchema->file_format>SQLITE_MAX_FILE_FORMAT ){
sqlite3SetString(pzErrMsg, db, "unsupported file format");
Expand All @@ -113,7 +111,7 @@
goto initone_error_out;
}

@@ -164271,13 +164287,25 @@
@@ -170128,13 +170144,25 @@
** module with sqlite.
*/
if( SQLITE_OK==rc
Expand Down
Loading

0 comments on commit 0787eb8

Please sign in to comment.