Index: third_party/sqlite/src/src/loadext.c |
diff --git a/third_party/sqlite/src/src/loadext.c b/third_party/sqlite/src/src/loadext.c |
index 2a2afd8654c4aa58e976c8a317d0ec66d277eae5..94298c47635229eaa70cafc0a0e61183e50df00c 100644 |
--- a/third_party/sqlite/src/src/loadext.c |
+++ b/third_party/sqlite/src/src/loadext.c |
@@ -34,7 +34,6 @@ |
# define sqlite3_column_table_name16 0 |
# define sqlite3_column_origin_name 0 |
# define sqlite3_column_origin_name16 0 |
-# define sqlite3_table_column_metadata 0 |
#endif |
#ifdef SQLITE_OMIT_AUTHORIZATION |
@@ -403,7 +402,19 @@ static const sqlite3_api_routines sqlite3Apis = { |
sqlite3_reset_auto_extension, |
sqlite3_result_blob64, |
sqlite3_result_text64, |
- sqlite3_strglob |
+ sqlite3_strglob, |
+ /* Version 3.8.11 and later */ |
+ (sqlite3_value*(*)(const sqlite3_value*))sqlite3_value_dup, |
+ sqlite3_value_free, |
+ sqlite3_result_zeroblob64, |
+ sqlite3_bind_zeroblob64, |
+ /* Version 3.9.0 and later */ |
+ sqlite3_value_subtype, |
+ sqlite3_result_subtype, |
+ /* Version 3.10.0 and later */ |
+ sqlite3_status64, |
+ sqlite3_strlike, |
+ sqlite3_db_cacheflush |
}; |
/* |
@@ -431,7 +442,7 @@ static int sqlite3LoadExtension( |
const char *zEntry; |
char *zAltEntry = 0; |
void **aHandle; |
- int nMsg = 300 + sqlite3Strlen30(zFile); |
+ u64 nMsg = 300 + sqlite3Strlen30(zFile); |
int ii; |
/* Shared library endings to try if zFile cannot be loaded as written */ |
@@ -474,7 +485,7 @@ static int sqlite3LoadExtension( |
#endif |
if( handle==0 ){ |
if( pzErrMsg ){ |
- *pzErrMsg = zErrmsg = sqlite3_malloc(nMsg); |
+ *pzErrMsg = zErrmsg = sqlite3_malloc64(nMsg); |
if( zErrmsg ){ |
sqlite3_snprintf(nMsg, zErrmsg, |
"unable to open shared library [%s]", zFile); |
@@ -500,7 +511,7 @@ static int sqlite3LoadExtension( |
if( xInit==0 && zProc==0 ){ |
int iFile, iEntry, c; |
int ncFile = sqlite3Strlen30(zFile); |
- zAltEntry = sqlite3_malloc(ncFile+30); |
+ zAltEntry = sqlite3_malloc64(ncFile+30); |
if( zAltEntry==0 ){ |
sqlite3OsDlClose(pVfs, handle); |
return SQLITE_NOMEM; |
@@ -522,7 +533,7 @@ static int sqlite3LoadExtension( |
if( xInit==0 ){ |
if( pzErrMsg ){ |
nMsg += sqlite3Strlen30(zEntry); |
- *pzErrMsg = zErrmsg = sqlite3_malloc(nMsg); |
+ *pzErrMsg = zErrmsg = sqlite3_malloc64(nMsg); |
if( zErrmsg ){ |
sqlite3_snprintf(nMsg, zErrmsg, |
"no entry point [%s] in shared library [%s]", zEntry, zFile); |
@@ -621,7 +632,7 @@ static const sqlite3_api_routines sqlite3Apis = { 0 }; |
*/ |
typedef struct sqlite3AutoExtList sqlite3AutoExtList; |
static SQLITE_WSD struct sqlite3AutoExtList { |
- int nExt; /* Number of entries in aExt[] */ |
+ u32 nExt; /* Number of entries in aExt[] */ |
void (**aExt)(void); /* Pointers to the extension init functions */ |
} sqlite3Autoext = { 0, 0 }; |
@@ -654,7 +665,7 @@ int sqlite3_auto_extension(void (*xInit)(void)){ |
}else |
#endif |
{ |
- int i; |
+ u32 i; |
#if SQLITE_THREADSAFE |
sqlite3_mutex *mutex = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MASTER); |
#endif |
@@ -664,9 +675,9 @@ int sqlite3_auto_extension(void (*xInit)(void)){ |
if( wsdAutoext.aExt[i]==xInit ) break; |
} |
if( i==wsdAutoext.nExt ){ |
- int nByte = (wsdAutoext.nExt+1)*sizeof(wsdAutoext.aExt[0]); |
+ u64 nByte = (wsdAutoext.nExt+1)*sizeof(wsdAutoext.aExt[0]); |
void (**aNew)(void); |
- aNew = sqlite3_realloc(wsdAutoext.aExt, nByte); |
+ aNew = sqlite3_realloc64(wsdAutoext.aExt, nByte); |
if( aNew==0 ){ |
rc = SQLITE_NOMEM; |
}else{ |
@@ -698,7 +709,7 @@ int sqlite3_cancel_auto_extension(void (*xInit)(void)){ |
int n = 0; |
wsdAutoextInit; |
sqlite3_mutex_enter(mutex); |
- for(i=wsdAutoext.nExt-1; i>=0; i--){ |
+ for(i=(int)wsdAutoext.nExt-1; i>=0; i--){ |
if( wsdAutoext.aExt[i]==xInit ){ |
wsdAutoext.nExt--; |
wsdAutoext.aExt[i] = wsdAutoext.aExt[wsdAutoext.nExt]; |
@@ -736,7 +747,7 @@ void sqlite3_reset_auto_extension(void){ |
** If anything goes wrong, set an error in the database connection. |
*/ |
void sqlite3AutoLoadExtensions(sqlite3 *db){ |
- int i; |
+ u32 i; |
int go = 1; |
int rc; |
int (*xInit)(sqlite3*,char**,const sqlite3_api_routines*); |