• Home
  • Raw
  • Download

Lines Matching +full:dlclose +full:- +full:skip

6 ---
7 ext/misc/cksumvfs.c | 4 +-
9 src/sqlite3.c | 575 +++++++++++++++++++++---
10 3 files changed, 1552 insertions(+), 71 deletions(-)
13 diff --git a/ext/misc/cksumvfs.c b/ext/misc/cksumvfs.c
15 --- a/ext/misc/cksumvfs.c
17 @@ -966,7 +966,7 @@ static int cksmRegisterVfs(void){
18 cksm_vfs.iVersion = pOrig->iVersion;
20 cksm_vfs.szOsFile = pOrig->szOsFile + sizeof(CksmFile);
21 - rc = sqlite3_vfs_register(&cksm_vfs, 1);
26 @@ -1019,7 +1019,7 @@ int sqlite3_cksumvfs_init(
30 -sqlite3_file *sqlite3_get_orig_file(sqlite3_file *file) {
35 diff --git a/src/compressvfs.c b/src/compressvfs.c
38 --- /dev/null
40 @@ -0,0 +1,1044 @@
42 +** 2025-06-10
67 +** DLL, use compiler command-lines similar to the following:
69 +** (linux) gcc -fPIC -shared compressvfs.c -o sqlitecompressvfs.z.so
183 +typedef sqlite_int64 i64; /* 8-byte signed integer */
184 +typedef sqlite_uint64 u64; /* 8-byte unsigned integer */
185 +typedef UINT32_TYPE u32; /* 4-byte unsigned integer */
186 +typedef UINT16_TYPE u16; /* 2-byte unsigned integer */
187 +typedef INT16_TYPE i16; /* 2-byte signed integer */
188 +typedef UINT8_TYPE u8; /* 1-byte unsigned integer */
189 +typedef INT8_TYPE i8; /* 1-byte signed integer */
260 +/*----------------------------brotli header begin----------------------------*/
278 +/*----------------------------brotli header end----------------------------*/
280 +/*----------------------------zstd header begin----------------------------*/
283 +/*----------------------------zstd header begin----------------------------*/
286 +** Access to a lower-level VFS that (might) implement dynamic loading, access to randomness, etc.
289 +#define ORIGVFS(p) ((sqlite3_vfs*)((p)->pAppData))
327 + dlclose(g_compress_algo_library);
357 + dlclose(g_compress_algo_library);
397 + return -1;
421 + 3, // COMPRESS QUALITY (1-11)
422 + BROTLI_MAX_WINDOW_BITS, // WINDOWS SIZE (10-24)
450 + int ret_len = -1;
482 + if( sqlite3_prepare_v2(db, sql, -1, &stmt, NULL)==SQLITE_OK ){
483 + sqlite3_bind_text(stmt, 1, table_name, -1, SQLITE_STATIC);
500 + if( sqlite3_prepare_v2(db, sql, -1, &stmt, NULL)==SQLITE_OK ){
517 + if( sqlite3_prepare_v2(db, sql, -1, &stmt, NULL)==SQLITE_OK ){
533 + if( sqlite3_prepare_v2(db, sql, -1, &stmt, NULL)==SQLITE_OK ){
547 + pCompress->compression = COMPRESSION_UNDEFINED;
548 + pCompress->page_size = 0;
550 + if( sqlite3_prepare_v2(db, sql, -1, &stmt, NULL)==SQLITE_OK ){
554 + pCompress->compression = sqlite3_column_int(stmt, 1);
555 + pCompress->page_size = sqlite3_column_int(stmt, 2);
570 + sqlite3 *db = pCompress->pDb;
571 + if( pCompress->bBegin==1 ){
576 + pCompress->bBegin = 0;
582 +** Check if another file-handle holds a RESERVED lock on a compress file.
599 + *(int*)pArg = pCompress->persistWalFlag;
601 + pCompress->persistWalFlag = persistFlag>0 ? 1 : 0;
606 + return pFile->pMethods->xFileControl(pFile, op, pArg);
610 +** Return the sector-size in bytes for a file. Use default VFS's xSectorSize.
615 + return pFile->pMethods->xSectorSize(pFile);
625 + return pFile->pMethods->xDeviceCharacteristics(pFile);
650 + sqlite3 *db = pCompress->pDb;
651 + int rc = getCompressPgsize(db, &pCompress->page_size);
655 + int pgsize = pCompress->page_size;
667 + sqlite3 *db = pCompress->pDb;
668 + int rc = getCompressPgsize(db, &pCompress->page_size);
669 + if( rc!=SQLITE_OK || pCompress->page_size==0 ){
672 + int pgsize = pCompress->page_size;
677 + if( pCompress->bBegin!=1 ){
681 + pCompress->bBegin = 1;
685 + if( sqlite3_prepare_v2(db, sql, -1, &stmt, NULL)==SQLITE_OK ){
703 + sqlite3 *db = pCompress->pDb;
704 + int rc = getCompressPgsize(db, &pCompress->page_size);
709 + if( pCompress->page_size<=0 && iAmt >= 512 && iAmt <= 64*1024 && !(iAmt & (iAmt - 1)) ){
715 + pCompress->page_size = iAmt;
717 + int pgsize = pCompress->page_size;
723 + int max_compress_size = compressLen(iAmt, pCompress->compression);
732 + if( compressBuf(compressed_data, max_compress_size, &compress_data_len, pBuf, iAmt, pCompress->c…
736 + if( pCompress->bBegin!=1 ){
741 + pCompress->bBegin = 1;
745 + if( sqlite3_prepare_v2(db, sql, -1, &stmt, NULL)==SQLITE_OK ){
768 + if( pCompress->compression!=COMPRESSION_BROTLI && pCompress->compression!=COMPRESSION_ZSTD ){
773 + sqlite3 *db = pCompress->pDb;
774 + int rc = getCompressPgsize(db, &pCompress->page_size);
775 + if( rc!=SQLITE_OK || pCompress->page_size==0 ){
778 + int pgsize = pCompress->page_size;
785 + rc = sqlite3_prepare_v2(db, sql, -1, &stmt, NULL);
815 + pCompress->compression)!=SQLITE_OK ){
850 + sqlite3 *db = pCompress->pDb;
855 + if( pCompress->bOutterDbOpen ){
861 + pCompress->pDb = NULL;
864 + if( pCompress->bSubDbOpen ){
866 + rc = pFile->pMethods->xClose(pFile);
884 + return pFile->pMethods->xShmMap(pFile, iPg, pgsz, fileFlag, pp);
887 +/* Perform locking on a shared-memory segment */
892 + return pFile->pMethods->xShmLock(pFile, offset, n, flags);
899 + return pFile->pMethods->xShmBarrier(pFile);
907 + return pFile->pMethods->xShmUnmap(pFile, deleteFlag);
910 +/* Fetch a page of a memory-mapped file */
914 + if( pFile->pMethods->iVersion>2 && pFile->pMethods->xFetch ){
915 + return pFile->pMethods->xFetch(pFile, iOfst, iAmt, pp);
921 +/* Release a memory-mapped page */
925 + if( pFile->pMethods->iVersion>2 && pFile->pMethods->xUnfetch ){
926 + return pFile->pMethods->xUnfetch(pFile, iOfst, pPage);
947 + return ORIGVFS(pVfs)->xOpen(ORIGVFS(pVfs), zName, pFile, flags, pOutFlags);
949 + rc = ORIGVFS(pVfs)->xOpen(ORIGVFS(pVfs), zName, pSubFile, flags, pOutFlags);
953 + pCompress->bSubDbOpen = 1;
955 + rc = pSubFile->pMethods->xFileSize(pSubFile, &fileSize);
961 + pFile->pMethods = &compress_io_methods;
962 …qlite3_open_v2(zName, &pCompress->pDb, SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE | SQLITE_OPEN_FU…
967 + pCompress->bOutterDbOpen = 1;
968 + sqlite3 *db = pCompress->pDb;
979 + if( pCompress->compression!=COMPRESSION_BROTLI && pCompress->compression!=COMPRESSION_ZSTD ){
983 + if( loadCompressAlgorithmExtension(pCompress->compression)==SQLITE_ERROR ){
1013 + pCompress->compression = g_compress_algo_load;
1014 + pCompress->page_size = 0;
1033 + return ORIGVFS(pVfs)->xDelete(ORIGVFS(pVfs), zName, syncDir);
1045 + return ORIGVFS(pVfs)->xAccess(ORIGVFS(pVfs), zName, flags, pResOut);
1064 + pVfs->pNext = 0;
1065 + pVfs->zName = COMPRESS_VFS_NAME;
1066 + pVfs->pAppData = default_vfs;
1067 + pVfs->szOsFile = pVfs->szOsFile+sizeof(CompressFile);
1069 + pVfs->xOpen = compressOpen;
1070 + pVfs->xDelete = compressDelete;
1071 + pVfs->xAccess = compressAccess;
1086 diff --git a/src/sqlite3.c b/src/sqlite3.c
1088 --- a/src/sqlite3.c
1090 @@ -881,6 +881,7 @@ SQLITE_API int sqlite3_exec(
1098 @@ -1877,6 +1878,14 @@ struct sqlite3_vfs {
1113 @@ -38370,6 +38379,9 @@ static void MarkLockStatusByRc(int rc, u32 lockIdx, u32 lockLen, u8 lockTyp…
1123 @@ -38639,6 +38651,9 @@ struct unixFile {
1124 UnixUnusedFd *pPreallocatedUnused; /* Pre-allocated UnixUnusedFd */
1133 @@ -39640,6 +39655,9 @@ struct unixInodeInfo {
1143 @@ -42889,14 +42907,23 @@ static int unixShmSystemLock(
1147 - int n /* Number of bytes to lock */
1155 unixShmNode *pShmNode; /* Apply locks to this open shared-memory segment */
1161 + pShmNode = bCompress ? pFile->pInode->pCompressShmNode : pFile->pInode->pShmNode;
1163 pShmNode = pFile->pInode->pShmNode;
1165 assert( pShmNode->nRef==0 || sqlite3_mutex_held(pShmNode->pShmMutex) );
1166 assert( pShmNode->nRef>0 || unixMutexHeld() );
1168 @@ -42984,9 +43011,11 @@ static int unixShmRegionPerMap(void){
1169 ** This is not a VFS shared-memory method; it is a utility function called
1170 ** by VFS shared-memory methods.
1172 -static void unixShmPurge(unixFile *pFd){
1173 - unixShmNode *p = pFd->pInode->pShmNode;
1174 - assert( unixMutexHeld() );
1180 if( p && ALWAYS(p->nRef==0) ){
1183 @@ -43004,11 +43033,35 @@ static void unixShmPurge(unixFile *pFd){
1184 robust_close(pFd, p->hShm, __LINE__);
1185 p->hShm = -1;
1189 + p->pInode->pCompressShmNode = 0;
1191 + p->pInode->pShmNode = 0;
1194 p->pInode->pShmNode = 0;
1203 +** This is not a VFS shared-memory method; it is a utility function called
1204 +** by VFS shared-memory methods.
1209 + unixShmPurgeInner(pFd, pFd->pInode->pCompressShmNode, 1);
1210 + unixShmPurgeInner(pFd, pFd->pInode->pShmNode, 0);
1212 + unixShmPurgeInner(pFd, pFd->pInode->pShmNode);
1219 @@ -43018,7 +43071,11 @@ static void unixShmPurge(unixFile *pFd){
1221 ** SQLITE_READONLY_CANTINIT and set pShmNode->isUnlocked=1.
1231 @@ -43051,7 +43108,11 @@ static int unixLockSharedMemory(unixFile *pDbFd, unixShmNode *pShmNode){
1232 pShmNode->isUnlocked = 1;
1242 /* The first connection to attach must truncate the -shm file. We
1243 @@ -43071,7 +43132,11 @@ static int unixLockSharedMemory(unixFile *pDbFd, unixShmNode *pShmNode){
1255 @@ -43112,8 +43177,15 @@ static int unixLockSharedMemory(unixFile *pDbFd, unixShmNode *pShmNode){
1271 @@ -43133,7 +43205,11 @@ static int unixOpenSharedMemory(unixFile *pDbFd){
1274 pInode = pDbFd->pInode;
1276 + pShmNode = bCompressShm ? pInode->pCompressShmNode : pInode->pShmNode;
1278 pShmNode = pInode->pShmNode;
1283 @@ -43153,6 +43229,11 @@ static int unixOpenSharedMemory(unixFile *pDbFd){
1295 @@ -43169,8 +43250,17 @@ static int unixOpenSharedMemory(unixFile *pDbFd){
1296 sqlite3_snprintf(nShmFilename, zShm, "%s-shm", zBasePath);
1297 sqlite3FileSuffix3(pDbFd->zPath, zShm);
1299 - pShmNode->hShm = -1;
1303 + pDbFd->pInode->pCompressShmNode = pShmNode;
1305 + pDbFd->pInode->pShmNode = pShmNode;
1308 pDbFd->pInode->pShmNode = pShmNode;
1310 + pShmNode->hShm = -1;
1311 pShmNode->pInode = pDbFd->pInode;
1313 pShmNode->pShmMutex = sqlite3_mutex_alloc(SQLITE_MUTEX_FAST);
1314 @@ -43207,7 +43297,11 @@ static int unixOpenSharedMemory(unixFile *pDbFd){
1316 robustFchown(pShmNode->hShm, sStat.st_uid, sStat.st_gid);
1326 @@ -43218,7 +43312,15 @@ static int unixOpenSharedMemory(unixFile *pDbFd){
1327 p->id = pShmNode->nextShmId++;
1329 pShmNode->nRef++;
1332 + pDbFd->pCompressShm = p;
1334 + pDbFd->pShm = p;
1337 pDbFd->pShm = p;
1342 @@ -43250,6 +43352,10 @@ shm_open_err:
1350 ** Otherwise, if the bExtend parameter is 0 and the requested shared-memory
1353 @@ -43260,12 +43366,15 @@ shm_open_err:
1365 - int bExtend, /* True to extend file if necessary */
1370 @@ -43274,18 +43383,33 @@ static int unixShmMap(
1379 /* If the shared-memory file has not yet been opened, open it now. */
1381 + if( (bCompressShm && pDbFd->pCompressShm==0) || ( !bCompressShm && pDbFd->pShm==0 )){
1385 + p = bCompressShm ? pDbFd->pCompressShm : pDbFd->pShm;
1387 if( pDbFd->pShm==0 ){
1391 -
1392 p = pDbFd->pShm;
1394 pShmNode = p->pShmNode;
1395 sqlite3_mutex_enter(pShmNode->pShmMutex);
1396 if( pShmNode->isUnlocked ){
1403 pShmNode->isUnlocked = 0;
1405 @@ -43448,8 +43572,13 @@ static int unixShmLock(
1409 -
1413 + p = bCompress ? pDbFd->pCompressShm : pDbFd->pShm;
1415 p = pDbFd->pShm;
1419 …sqlite3_log(SQLITE_IOERR_SHMLOCK, "unixShmLock-pShm, fd[%d], ofst[%d], n[%d], flags[%d]", pDbFd->h…
1420 @@ -43516,7 +43645,11 @@ static int unixShmLock(
1432 @@ -43540,7 +43673,11 @@ static int unixShmLock(
1444 @@ -43566,7 +43703,11 @@ static int unixShmLock(
1446 ** also update the in-memory values. */
1455 assert( (p->sharedMask & mask)==0 );
1456 @@ -43619,9 +43760,14 @@ static int unixShmUnmap(
1457 unixShmNode *pShmNode; /* The underlying shared-memory file */
1460 -
1465 + p = bCompressShm ? pDbFd->pCompressShm : pDbFd->pShm;
1467 p = pDbFd->pShm;
1470 pShmNode = p->pShmNode;
1472 @@ -43636,7 +43782,15 @@ static int unixShmUnmap(
1478 + pDbFd->pCompressShm = 0;
1480 + pDbFd->pShm = 0;
1483 pDbFd->pShm = 0;
1485 sqlite3_mutex_leave(pShmNode->pShmMutex);
1487 /* If pShmNode->nRef has reached 0, then close the underlying
1488 @@ -50788,8 +50942,15 @@ static int winLockSharedMemory(winShmNode *pShmNode){
1489 ** When opening a new shared-memory file, if no other instances of that
1504 @@ -50804,6 +50965,11 @@ static int winOpenSharedMemory(winFile *pDbFd){
1507 nName = sqlite3Strlen30(pDbFd->zPath);
1516 @@ -50812,6 +50978,11 @@ static int winOpenSharedMemory(winFile *pDbFd){
1517 pNew->zFilename = (char*)&pNew[1];
1518 sqlite3_snprintf(nName+15, pNew->zFilename, "%s-shm", pDbFd->zPath);
1519 sqlite3FileSuffix3(pDbFd->zPath, pNew->zFilename);
1522 + sqlite3_snprintf(nName+15, pNew->zFilename, "%scompress", pNew->zFilename);
1528 @@ -51069,6 +51240,10 @@ static void winShmBarrier(
1536 ** Otherwise, if the isWrite parameter is 0 and the requested shared-memory
1539 @@ -51079,12 +51254,15 @@ static void winShmBarrier(
1551 - int isWrite, /* True to extend file if necessary */
1556 @@ -51092,10 +51270,18 @@ static int winShmMap(
1573 pShm = pDbFd->pShm;
1575 @@ -57775,7 +57961,7 @@ struct PagerSavepoint {
1579 -#if !defined(SQLITE_OS_UNIX) && defined(SQLITE_META_DWR)
1584 @@ -62360,7 +62546,30 @@ SQLITE_PRIVATE int sqlite3PagerOpen(
1594 + ** Database file handle (pVfs->szOsFile bytes)
1595 + ** Sub-journal file handle (journalFileSize bytes)
1608 + if( sqlite3_stricmp(pVfs->zName, "compressvfs")==0 ){
1615 @@ -62371,9 +62580,9 @@ SQLITE_PRIVATE int sqlite3PagerOpen(
1619 - nPathname + 8 + 1 + /* Journal filename */
1622 - nPathname + 4 + 1 + /* WAL filename */
1627 @@ -62407,7 +62616,13 @@ SQLITE_PRIVATE int sqlite3PagerOpen(
1629 pPager->zJournal = (char*)pPtr;
1631 - memcpy(pPtr, "-journal",8); pPtr += 8 + 1;
1632 + memcpy(pPtr, "-journal",8); pPtr += 8;
1638 + pPtr += 1; /* Skip zero suffix */
1640 sqlite3FileSuffix3(zFilename,pPager->zJournal);
1641 pPtr = (u8*)(pPager->zJournal + sqlite3Strlen30(pPager->zJournal)+1);
1642 @@ -62421,7 +62636,13 @@ SQLITE_PRIVATE int sqlite3PagerOpen(
1644 pPager->zWal = (char*)pPtr;
1646 - memcpy(pPtr, "-wal", 4); pPtr += 4 + 1;
1647 + memcpy(pPtr, "-wal", 4); pPtr += 4;
1653 + pPtr += 1; /* Skip zero suffix */
1655 sqlite3FileSuffix3(zFilename, pPager->zWal);
1656 pPtr = (u8*)(pPager->zWal + sqlite3Strlen30(pPager->zWal)+1);
1657 @@ -66177,6 +66398,7 @@ static SQLITE_NOINLINE int walIndexPageRealloc(
1658 pWal->apWiData[iPage] = (u32 volatile *)sqlite3MallocZero(WALINDEX_PGSZ);
1659 if( !pWal->apWiData[iPage] ) rc = SQLITE_NOMEM_BKPT;
1661 + assert( pWal->writeLock==0 || pWal->writeLock==1 );
1662 rc = sqlite3OsShmMap(pWal->pDbFd, iPage, WALINDEX_PGSZ,
1663 pWal->writeLock, (void volatile **)&pWal->apWiData[iPage]
1665 @@ -137863,6 +138085,9 @@ typedef int (*sqlite3_loadext_entry)(
1667 #define sqlite3_clean_binlog sqlite3_api->clean_binlog
1670 +#define sqlite3_compressdb_backup sqlite3_api->compressdb_backup
1675 @@ -183070,6 +183295,188 @@ SQLITE_API int sqlite3_limit(sqlite3 *db, int limitId, int newLimit){
1676 return oldLimit; /* IMP: R-53341-35419 */
1732 + dlclose(g_compress_library);
1738 + dlclose(g_compress_library);
1744 + dlclose(g_compress_library);
1768 + dlclose(g_compress_library);
1780 +** for copying in-memory databases to or from persistent files.
1800 + if( sqlite3_prepare_v2(srcDb, compression_sql, -1, &stmt, NULL) == SQLITE_OK ){
1817 + rc = sqlite3_prepare_v2(srcDb, data_sql, -1, &stmt, NULL);
1862 ** This function is used to parse both URIs and non-URI filenames passed by the
1864 @@ -183314,6 +183721,17 @@ SQLITE_PRIVATE int sqlite3ParseUri(
1882 @@ -254405,6 +254823,50 @@ SQLITE_API int sqlite3_stmt_init(
1901 + }else if( sqlite3_stricmp(vfs->zName, "unix")==0 ){
1903 + }else if( sqlite3_stricmp(vfs->zName, "cksmvfs")==0 ){
1905 + }else if( sqlite3_stricmp(vfs->zName, "compressvfs")==0 ){
1908 + sqlite3_log(SQLITE_WARNING_DUMP, "Not support pVfs type %s", vfs->zName);
1933 @@ -255290,7 +255752,7 @@ CODEC_STATIC void sqlite3CodecTransPgno(Pgno input, unsigned char *output…
1937 -#endif
1942 @@ -256147,26 +256609,8 @@ static int PragmaCksumPersistEnable(sqlite3 *db, int iDb, Parse *parse, …
1946 -extern sqlite3_file *sqlite3_get_orig_file(sqlite3_file *file);
1947 -#else
1948 -static sqlite3_file *sqlite3_get_orig_file(sqlite3_file *file) {
1949 - return file;
1950 -}
1953 -#if SQLITE_OS_UNIX
1954 -#define SQLITE_CHECK_FILE_ID_UNIX 1
1955 -#define SQLITE_CHECK_FILE_ID_CKSM 2
1956 -
1957 -// checkFileId should not be 0, it must be SQLITE_CHECK_FILE_ID_UNIX(1) or SQLITE_CHECK_FILE_ID_CK…
1958 -static unixFile *Sqlite3GetUnixFile(sqlite3_file *file, u8 checkFileId) {
1959 - if (checkFileId == SQLITE_CHECK_FILE_ID_UNIX) {
1960 - return (unixFile*)file;
1961 - }
1962 - return (unixFile*)sqlite3_get_orig_file(file);
1963 -}
1964 -#endif /* SQLITE_OS_UNIX */
1965 -
1969 @@ -256454,15 +256898,7 @@ static MetaDwrHdr *AllocInitMetaHeaderDwr(Pager *pPager) {
1973 - if (pPager->pVfs==NULL) {
1974 - hdr->checkFileId = 0;
1975 - } else if (sqlite3_stricmp(pPager->pVfs->zName, "unix") == 0) {
1976 - hdr->checkFileId = SQLITE_CHECK_FILE_ID_UNIX;
1977 - } else if (sqlite3_stricmp(pPager->pVfs->zName, "cksmvfs") == 0) {
1978 - hdr->checkFileId = SQLITE_CHECK_FILE_ID_CKSM;
1979 - } else {
1980 - hdr->checkFileId = 0;
1981 - }
1982 + hdr->checkFileId = Sqlite3GetCheckFileId(pPager->pVfs);
1986 @@ -257156,25 +257592,19 @@ CHK_RESTORE_OUT:
1990 - if (pPager->pVfs == NULL) {
1991 + u8 checkFileId = Sqlite3GetCheckFileId(pPager->pVfs);
1995 - if (sqlite3_stricmp(pPager->pVfs->zName, "unix") != 0 && sqlite3_stricmp(pPager->pVfs->zName, "c…
1996 - return 0;
1997 - }
1998 - u8 checkFileId = SQLITE_CHECK_FILE_ID_UNIX;
1999 - if (sqlite3_stricmp(pPager->pVfs->zName, "cksmvfs") == 0) {
2000 - checkFileId = SQLITE_CHECK_FILE_ID_CKSM;
2001 - }
2002 unixFile *fd = Sqlite3GetUnixFile(pPager->fd, checkFileId);
2004 - if (fd == NULL || fd->pInode == NULL || fd->pInode->nRef != 1) {
2005 + if (fd == NULL || fd->pInode == NULL || fd->pInode->nRef != (checkFileId==SQLITE_CHECK_FILE_ID_C…
2011 -#endif
2016 @@ -257407,14 +257837,23 @@ static void DumpTrxProcessLocks(unixFile *file, char *dumpBuf, int dump…
2021 + if( (file->pShm == NULL || file->pShm->pShmNode == NULL) &&
2022 + (file->pCompressShm == NULL || file->pCompressShm->pShmNode == NULL) ){
2024 if (file->pShm == NULL || file->pShm->pShmNode == NULL) {
2033 … unixShmNode *pShmNode = (file->pShm == NULL || file->pShm->pShmNode == NULL) ? file->pCompressShm
2035 unixShmNode *pShmNode = file->pShm->pShmNode;
2038 int availLen = dumpBufLen - 1;
2040 @@ -257458,14 +257897,8 @@ static void DumpLocksByWal(Wal *pWal)
2044 - u8 checkFileId = 0;
2045 - if (pWal->pVfs==NULL) {
2046 - return;
2047 - } else if (sqlite3_stricmp(pWal->pVfs->zName, "unix") == 0) {
2048 - checkFileId = SQLITE_CHECK_FILE_ID_UNIX;
2049 - } else if (sqlite3_stricmp(pWal->pVfs->zName, "cksmvfs") == 0) {
2050 - checkFileId = SQLITE_CHECK_FILE_ID_CKSM;
2051 - } else {
2052 + u8 checkFileId = Sqlite3GetCheckFileId(pWal->pVfs);
2056 DumpLocksInfo(Sqlite3GetUnixFile(pWal->pDbFd, checkFileId), 1);
2057 @@ -257478,14 +257911,8 @@ static void DumpLocksByPager(Pager *pPager)
2061 - u8 checkFileId = 0;
2062 - if (pPager->pVfs==NULL) {
2063 - return;
2064 - } else if (sqlite3_stricmp(pPager->pVfs->zName, "unix") == 0) {
2065 - checkFileId = SQLITE_CHECK_FILE_ID_UNIX;
2066 - } else if (sqlite3_stricmp(pPager->pVfs->zName, "cksmvfs") == 0) {
2067 - checkFileId = SQLITE_CHECK_FILE_ID_CKSM;
2068 - } else {
2069 + u8 checkFileId = Sqlite3GetCheckFileId(pPager->pVfs);
2074 @@ -258615,6 +259042,11 @@ struct sqlite3_api_routines_extra {
2086 @@ -258641,6 +259073,11 @@ static const sqlite3_api_routines_extra sqlite3ExtraApis = {
2098 --