mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-06-27 14:58:30 +00:00
Upgrade SQLite to 3.40 (#699)
This commit is contained in:
parent
bcae817215
commit
0dc0758574
151 changed files with 27917 additions and 22169 deletions
14
third_party/sqlite3/os.c
vendored
14
third_party/sqlite3/os.c
vendored
|
@ -13,8 +13,7 @@
|
|||
** This file contains OS interface code that is common to all
|
||||
** architectures.
|
||||
*/
|
||||
#include "third_party/sqlite3/sqliteInt.inc"
|
||||
/* clang-format off */
|
||||
#include "third_party/sqlite3/sqliteInt.h"
|
||||
|
||||
/*
|
||||
** If we compile with the SQLITE_TEST macro set, then the following block
|
||||
|
@ -107,9 +106,11 @@ int sqlite3OsFileSize(sqlite3_file *id, i64 *pSize){
|
|||
}
|
||||
int sqlite3OsLock(sqlite3_file *id, int lockType){
|
||||
DO_OS_MALLOC_TEST(id);
|
||||
assert( lockType>=SQLITE_LOCK_SHARED && lockType<=SQLITE_LOCK_EXCLUSIVE );
|
||||
return id->pMethods->xLock(id, lockType);
|
||||
}
|
||||
int sqlite3OsUnlock(sqlite3_file *id, int lockType){
|
||||
assert( lockType==SQLITE_LOCK_NONE || lockType==SQLITE_LOCK_SHARED );
|
||||
return id->pMethods->xUnlock(id, lockType);
|
||||
}
|
||||
int sqlite3OsCheckReservedLock(sqlite3_file *id, int *pResOut){
|
||||
|
@ -162,6 +163,7 @@ int sqlite3OsSectorSize(sqlite3_file *id){
|
|||
return (xSectorSize ? xSectorSize(id) : SQLITE_DEFAULT_SECTOR_SIZE);
|
||||
}
|
||||
int sqlite3OsDeviceCharacteristics(sqlite3_file *id){
|
||||
if( NEVER(id->pMethods==0) ) return 0;
|
||||
return id->pMethods->xDeviceCharacteristics(id);
|
||||
}
|
||||
#ifndef SQLITE_OMIT_WAL
|
||||
|
@ -223,6 +225,7 @@ int sqlite3OsOpen(
|
|||
** down into the VFS layer. Some SQLITE_OPEN_ flags (for example,
|
||||
** SQLITE_OPEN_FULLMUTEX or SQLITE_OPEN_SHAREDCACHE) are blocked before
|
||||
** reaching the VFS. */
|
||||
assert( zPath || (flags & SQLITE_OPEN_EXCLUSIVE) );
|
||||
rc = pVfs->xOpen(pVfs, zPath, pFile, flags & 0x1087f7f, pFlagsOut);
|
||||
assert( rc==SQLITE_OK || pFile->pMethods==0 );
|
||||
return rc;
|
||||
|
@ -230,7 +233,7 @@ int sqlite3OsOpen(
|
|||
int sqlite3OsDelete(sqlite3_vfs *pVfs, const char *zPath, int dirSync){
|
||||
DO_OS_MALLOC_TEST(0);
|
||||
assert( dirSync==0 || dirSync==1 );
|
||||
return pVfs->xDelete(pVfs, zPath, dirSync);
|
||||
return pVfs->xDelete!=0 ? pVfs->xDelete(pVfs, zPath, dirSync) : SQLITE_OK;
|
||||
}
|
||||
int sqlite3OsAccess(
|
||||
sqlite3_vfs *pVfs,
|
||||
|
@ -253,6 +256,8 @@ int sqlite3OsFullPathname(
|
|||
}
|
||||
#ifndef SQLITE_OMIT_LOAD_EXTENSION
|
||||
void *sqlite3OsDlOpen(sqlite3_vfs *pVfs, const char *zPath){
|
||||
assert( zPath!=0 );
|
||||
assert( strlen(zPath)<=SQLITE_MAX_PATHLEN ); /* tag-20210611-1 */
|
||||
return pVfs->xDlOpen(pVfs, zPath);
|
||||
}
|
||||
void sqlite3OsDlError(sqlite3_vfs *pVfs, int nByte, char *zBufOut){
|
||||
|
@ -314,12 +319,15 @@ int sqlite3OsOpenMalloc(
|
|||
rc = sqlite3OsOpen(pVfs, zFile, pFile, flags, pOutFlags);
|
||||
if( rc!=SQLITE_OK ){
|
||||
sqlite3_free(pFile);
|
||||
*ppFile = 0;
|
||||
}else{
|
||||
*ppFile = pFile;
|
||||
}
|
||||
}else{
|
||||
*ppFile = 0;
|
||||
rc = SQLITE_NOMEM_BKPT;
|
||||
}
|
||||
assert( *ppFile!=0 || rc!=SQLITE_OK );
|
||||
return rc;
|
||||
}
|
||||
void sqlite3OsCloseFree(sqlite3_file *pFile){
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue