From: drh <> Date: Sat, 25 Oct 2025 20:46:09 +0000 (+0000) Subject: Rename the file control to SQLITE_FCNTL_FILESTAT. Rename the SQL function X-Git-Tag: major-release~41^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a105989856bb3c68736c239a49c7e59bcf38c40a;p=thirdparty%2Fsqlite.git Rename the file control to SQLITE_FCNTL_FILESTAT. Rename the SQL function to sqlite_filestat(). Rename the enable macro to SQLITE_ENABLE_FILESTAT. FossilOrigin-Name: ee797fec4eeace78caa2c5e463108bf1a6568db7c33d94d9fe6624cfc6b0d4fe --- diff --git a/manifest b/manifest index 84c86066cc..b07ae8e88c 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Fix\sa\sbug\sin\ssqlite_file_info()\soutput:\s\sIt\swas\sshowing\sthe\s"pal"\sfor\nthe\smain\sfile\sdescriptor\swhen\straversing\sother\sunused\sfile\sdescriptors\nfor\sthe\ssame\sinode. -D 2025-10-25T19:51:16.580 +C Rename\sthe\sfile\scontrol\sto\sSQLITE_FCNTL_FILESTAT.\s\sRename\sthe\sSQL\sfunction\nto\ssqlite_filestat().\s\sRename\sthe\senable\smacro\sto\sSQLITE_ENABLE_FILESTAT. +D 2025-10-25T20:46:09.210 F .fossil-settings/binary-glob 61195414528fb3ea9693577e1980230d78a1f8b0a54c78cf1b9b24d0a409ed6a x F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea @@ -689,7 +689,7 @@ F src/delete.c 03a77ba20e54f0f42ebd8eddf15411ed6bdb06a2c472ac4b6b336521bf7cea42 F src/expr.c 4d63c8f6d50fe20637de8bdaf57757a0e424e4ac5e2c3313e621d64727a48a1c F src/fault.c 460f3e55994363812d9d60844b2a6de88826e007 F src/fkey.c 928ed2517e8732113d2b9821aa37af639688d752f4ea9ac6e0e393d713eeb76f -F src/func.c a2186f55bd641818bf699c31797fbd780ca8b57142b0f8f4e3883a3727f6c642 +F src/func.c 5a5bf6ff36fcc69ef2d71e296ef193f31dd884be5961203385e8ed065ca16685 F src/global.c a19e4b1ca1335f560e9560e590fc13081e21f670643367f99cb9e8f9dc7d615b F src/hash.c 73934a7f7ab1cb110614a9388cb516893b0cf5b7b69e4fd1a0780ac4ce166be7 F src/hash.h 46b92795a95bfefb210f52f0c316e9d7cdbcdd7e7fcfb0d8be796d3a5767cddf @@ -720,8 +720,8 @@ F src/os.h 1ff5ae51d339d0e30d8a9d814f4b8f8e448169304d83a7ed9db66a65732f3e63 F src/os_common.h 6c0eb8dd40ef3e12fe585a13e709710267a258e2c8dd1c40b1948a1d14582e06 F src/os_kv.c fb7ba8d6204197357f1eb7e1c7450d09c10043bf7e99aba602f4aa46b8fb11a3 F src/os_setup.h 8efc64eda6a6c2f221387eefc2e7e45fd5a3d5c8337a7a83519ba4fbd2957ae2 -F src/os_unix.c 53c7636d5bec7884d7f5d02e78ac16dd43162e6d1e0c0dbd6d58805922b84bd7 -F src/os_win.c 5b14841f9c3ab76841c06a4eca20ba3e7747f44253eba9dfd3d918797e753d49 +F src/os_unix.c bbd3ec01b2023bc41b532666533e087feea457c595d1b63284c8acc8929ea7d5 +F src/os_win.c 27617f334168644b542c9d58ac6e5f051b318136273e78d243384b4eca2df6b3 F src/os_win.h 4c247cdb6d407c75186c94a1e84d5a22cbae4adcec93fcae8d2bc1f956fd1f19 F src/pager.c 113f9149092ccff6cf90e97c2611200e5a237f13d26c394bc9fd933377852764 F src/pager.h 6137149346e6c8a3ddc1eeb40aee46381e9bc8b0fcc6dda8a1efde993c2275b8 @@ -737,7 +737,7 @@ F src/resolve.c f8d1d011aba0964ff1bdccd049d4d2c2fec217efd90d202a4bb775e926b2c25d F src/rowset.c 8432130e6c344b3401a8874c3cb49fefe6873fec593294de077afea2dce5ec97 F src/select.c b95181711d59c36d9789e67f76c4cfec64b99f9629a50be5e6566e117b87d957 F src/shell.c.in e58b0cecf2579c0115253e9c02a44b54fbadf77f4f33b43cfaa48a8274c9aa01 -F src/sqlite.h.in 3285114481f84812b9d8c1dc41a2dcd48ce4e79f610b8392ae398b56d1800e1e +F src/sqlite.h.in 5590236c56ee8640b531e851544c1dfdb2e557db43c53b2e6825045f11271fc9 F src/sqlite3.rc 015537e6ac1eec6c7050e17b616c2ffe6f70fca241835a84a4f0d5937383c479 F src/sqlite3ext.h 7f236ca1b175ffe03316d974ef57df79b3938466c28d2f95caef5e08c57f3a52 F src/sqliteInt.h 88f7fc9ce1630d9a5f7e0a8e1f3287cdc63882fba985c18e7eee1b9f457f59aa @@ -2171,8 +2171,8 @@ F tool/version-info.c 33d0390ef484b3b1cb685d59362be891ea162123cea181cb8e6d2cf6dd F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7 F tool/warnings.sh 1ad0169b022b280bcaaf94a7fa231591be96b514230ab5c98fbf15cd7df842dd F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 5e20a0435b1bd84d90c9a419219afe794fdf8ea73213f4c7ae5612c0375bed55 -R c88309ce7fbaf9b7abfef05cefac35c2 +P 3c4020d76e29c39483f6b92857ea470245afcd514870c63bd3373e0e213cd355 +R 07d3093dc711b476e42052033512d6b3 U drh -Z 5cd0917bc0c47465253ea4be3bf810d7 +Z ef90fc149f30ab4d92213c20fbfd67c0 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 7520d824e6..219d4511cc 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -3c4020d76e29c39483f6b92857ea470245afcd514870c63bd3373e0e213cd355 +ee797fec4eeace78caa2c5e463108bf1a6568db7c33d94d9fe6624cfc6b0d4fe diff --git a/src/func.c b/src/func.c index dfe0e4f770..48f59a066f 100644 --- a/src/func.c +++ b/src/func.c @@ -3083,14 +3083,14 @@ static void percentValue(sqlite3_context *pCtx){ /****** End of percentile family of functions ******/ #endif /* SQLITE_ENABLE_PERCENTILE */ -#if defined(SQLITE_DEBUG) || defined(SQLITE_ENABLE_FILE_INFO) +#if defined(SQLITE_DEBUG) || defined(SQLITE_ENABLE_FILESTAT) /* -** Implementation of sqlite_file_info(SCHEMA). +** Implementation of sqlite_filestat(SCHEMA). ** ** Return JSON text that describes low-level debug/diagnostic information ** about the sqlite3_file object associated with SCHEMA. */ -static void fileInfoFunc( +static void filestatFunc( sqlite3_context *context, int argc, sqlite3_value **argv @@ -3115,12 +3115,12 @@ static void fileInfoFunc( sqlite3_result_error_nomem(context); }else{ sqlite3_str_append(pStr, "{\"db\":", 6); - rc = sqlite3OsFileControl(fd, SQLITE_FCNTL_GET_INFO, pStr); + rc = sqlite3OsFileControl(fd, SQLITE_FCNTL_FILESTAT, pStr); if( rc ) sqlite3_str_append(pStr, "null", 4); fd = sqlite3PagerJrnlFile(pPager); if( fd && fd->pMethods!=0 ){ sqlite3_str_appendall(pStr, ",\"journal\":"); - rc = sqlite3OsFileControl(fd, SQLITE_FCNTL_GET_INFO, pStr); + rc = sqlite3OsFileControl(fd, SQLITE_FCNTL_FILESTAT, pStr); if( rc ) sqlite3_str_append(pStr, "null", 4); } sqlite3_str_append(pStr, "}", 1); @@ -3132,7 +3132,7 @@ static void fileInfoFunc( sqlite3_result_text(context, "{}", 2, SQLITE_STATIC); } } -#endif /* SQLITE_DEBUG || SQLITE_ENABLE_FILE_INFO */ +#endif /* SQLITE_DEBUG || SQLITE_ENABLE_FILESTAT */ #ifdef SQLITE_DEBUG /* @@ -3292,8 +3292,8 @@ void sqlite3RegisterBuiltinFunctions(void){ #ifdef SQLITE_ENABLE_OFFSET_SQL_FUNC INLINE_FUNC(sqlite_offset, 1, INLINEFUNC_sqlite_offset, 0 ), #endif -#if defined(SQLITE_DEBUG) || defined(SQLITE_ENABLE_FILE_INFO) - FUNCTION(sqlite_file_info, 1, 0, 0, fileInfoFunc ), +#if defined(SQLITE_DEBUG) || defined(SQLITE_ENABLE_FILESTAT) + FUNCTION(sqlite_filestat, 1, 0, 0, filestatFunc ), #endif FUNCTION(ltrim, 1, 1, 0, trimFunc ), FUNCTION(ltrim, 2, 1, 0, trimFunc ), diff --git a/src/os_unix.c b/src/os_unix.c index c0416c52e2..bb4ba63502 100644 --- a/src/os_unix.c +++ b/src/os_unix.c @@ -596,7 +596,7 @@ static struct unix_syscall { }; /* End of the overrideable system calls */ -#if defined(SQLITE_DEBUG) || defined(SQLITE_ENABLE_FILE_INFO) +#if defined(SQLITE_DEBUG) || defined(SQLITE_ENABLE_FILESTAT) /* ** Extract Posix Advisory Locking information about file description fd ** from the /proc/PID/fdinfo/FD pseudo-file. Fill the string buffer a[16] @@ -707,7 +707,7 @@ static int unixPosixAdvisoryLocks( } #else # define unixPosixAdvisoryLocks(A,B) SQLITE_ERROR_UNABLE -#endif /* SQLITE_DEBUG || SQLITE_ENABLE_FILE_INFO */ +#endif /* SQLITE_DEBUG || SQLITE_ENABLE_FILESTAT */ /* ** On some systems, calls to fchown() will trigger a message in a security @@ -4115,7 +4115,7 @@ static int unixGetTempname(int nBuf, char *zBuf); #if !defined(SQLITE_WASI) && !defined(SQLITE_OMIT_WAL) static int unixFcntlExternalReader(unixFile*, int*); #endif -#if defined(SQLITE_DEBUG) || defined(SQLITE_ENABLE_FILE_INFO) +#if defined(SQLITE_DEBUG) || defined(SQLITE_ENABLE_FILESTAT) static void unixDescribeShm(sqlite3_str*,unixShm*); #endif @@ -4262,8 +4262,8 @@ static int unixFileControl(sqlite3_file *id, int op, void *pArg){ #endif } -#if defined(SQLITE_DEBUG) || defined(SQLITE_ENABLE_FILE_INFO) - case SQLITE_FCNTL_GET_INFO: { +#if defined(SQLITE_DEBUG) || defined(SQLITE_ENABLE_FILESTAT) + case SQLITE_FCNTL_FILESTAT: { sqlite3_str *pStr = (sqlite3_str*)pArg; char aLck[16]; unixInodeInfo *pInode; @@ -4320,7 +4320,7 @@ static int unixFileControl(sqlite3_file *id, int op, void *pArg){ sqlite3_str_append(pStr, "}", 1); return SQLITE_OK; } -#endif /* SQLITE_DEBUG || SQLITE_ENABLE_FILE_INFO */ +#endif /* SQLITE_DEBUG || SQLITE_ENABLE_FILESTAT */ } return SQLITE_NOTFOUND; } @@ -4587,7 +4587,7 @@ struct unixShm { #define UNIX_SHM_BASE ((22+SQLITE_SHM_NLOCK)*4) /* first lock byte */ #define UNIX_SHM_DMS (UNIX_SHM_BASE+SQLITE_SHM_NLOCK) /* deadman switch */ -#if defined(SQLITE_DEBUG) || defined(SQLITE_ENABLE_FILE_INFO) +#if defined(SQLITE_DEBUG) || defined(SQLITE_ENABLE_FILESTAT) /* ** Describe the pShm object using JSON. Used for diagnostics only. */ @@ -4605,7 +4605,7 @@ static void unixDescribeShm(sqlite3_str *pStr, unixShm *pShm){ } sqlite3_str_append(pStr, "}", 1); } -#endif /* SQLITE_DEBUG || SQLITE_ENABLE_FILE_INFO */ +#endif /* SQLITE_DEBUG || SQLITE_ENABLE_FILESTAT */ /* ** Use F_GETLK to check whether or not there are any readers with open diff --git a/src/os_win.c b/src/os_win.c index af9fdd49fa..b0c176133c 100644 --- a/src/os_win.c +++ b/src/os_win.c @@ -3953,8 +3953,8 @@ static int winFileControl(sqlite3_file *id, int op, void *pArg){ } #endif /* SQLITE_ENABLE_SETLK_TIMEOUT */ -#if defined(SQLITE_DEBUG) || defined(SQLITE_ENABLE_FILE_INFO) - case SQLITE_FCNTL_GET_INFO: { +#if defined(SQLITE_DEBUG) || defined(SQLITE_ENABLE_FILESTAT) + case SQLITE_FCNTL_FILESTAT: { sqlite3_str *pStr = (sqlite3_str*)pArg; sqlite3_str_appendf(pStr, "{\"h\":%llu", (sqlite3_uint64)pFile->h); sqlite3_str_appendf(pStr, ",\"vfs\":\"%s\"", pFile->pVfs->zName); @@ -3973,7 +3973,7 @@ static int winFileControl(sqlite3_file *id, int op, void *pArg){ sqlite3_str_append(pStr, "}", 1); return SQLITE_OK; } -#endif /* SQLITE_DEBUG || SQLITE_ENABLE_FILE_INFO */ +#endif /* SQLITE_DEBUG || SQLITE_ENABLE_FILESTAT */ } OSTRACE(("FCNTL file=%p, rc=SQLITE_NOTFOUND\n", pFile->h)); diff --git a/src/sqlite.h.in b/src/sqlite.h.in index eee24aeb1c..0f58357c28 100644 --- a/src/sqlite.h.in +++ b/src/sqlite.h.in @@ -1230,12 +1230,13 @@ struct sqlite3_io_methods { ** purges the contents of the in-memory page cache. If there is an open ** transaction, or if the db is a temp-db, this opcode is a no-op, not an error. ** -**