From f2ab7c8aada77719724a92e1fd60bf51e67a9f64 Mon Sep 17 00:00:00 2001 From: ryne3366 Date: Wed, 18 Jun 2025 20:21:26 +0800 Subject: [PATCH] getenv fixed Signed-off-by: ryne3366 --- patch/0010-Bug-fixes-on-current-version.patch | 71 +++++++++++-------- 1 file changed, 41 insertions(+), 30 deletions(-) diff --git a/patch/0010-Bug-fixes-on-current-version.patch b/patch/0010-Bug-fixes-on-current-version.patch index 1c5aaf3..1a631cb 100644 --- a/patch/0010-Bug-fixes-on-current-version.patch +++ b/patch/0010-Bug-fixes-on-current-version.patch @@ -1,18 +1,18 @@ -From 7bb232b30ce94a323c92c93a30df658a02d4d702 Mon Sep 17 00:00:00 2001 -From: MartinChoo <214582617@qq.com> -Date: Sat, 7 Jun 2025 23:07:45 +0800 -Subject: [PATCH] Bug fixes on current version +From 948dcf3ee3d80a26d13d548b0552a05911fd0b28 Mon Sep 17 00:00:00 2001 +From: ryne3366 +Date: Wed, 18 Jun 2025 20:16:10 +0800 +Subject: [PATCH] fix getenv -Signed-off-by: MartinChoo <214582617@qq.com> +Signed-off-by: ryne3366 --- - src/sqlite3.c | 239 ++++++++++++++++++++++++++++++++++++++++---------- - 1 file changed, 193 insertions(+), 46 deletions(-) + src/sqlite3.c | 241 ++++++++++++++++++++++++++++++++++++++++---------- + 1 file changed, 195 insertions(+), 46 deletions(-) diff --git a/src/sqlite3.c b/src/sqlite3.c -index 80d7979..6ab872e 100644 +index ebbc11d..5eef007 100644 --- a/src/sqlite3.c +++ b/src/sqlite3.c -@@ -38786,8 +38786,8 @@ static void enableDbFileDelMonitor(int32_t fd) +@@ -38793,8 +38793,8 @@ static void enableDbFileDelMonitor(int32_t fd) } flags |= HMFS_MONITOR_FL; ret = ioctl(fd, HMFS_IOCTL_HW_SET_FLAGS, &flags); @@ -23,7 +23,18 @@ index 80d7979..6ab872e 100644 } } -@@ -57786,6 +57786,8 @@ static void MetaDwrCheckVacuum(BtShared *pBt); +@@ -44379,8 +44379,10 @@ static const char *azTempDirs[] = { + ** Initialize first two members of azTempDirs[] array. + */ + static void unixTempFileInit(void){ ++#ifndef HARMONY_OS + azTempDirs[0] = getenv("SQLITE_TMPDIR"); + azTempDirs[1] = getenv("TMPDIR"); ++#endif + } + + /* +@@ -57793,6 +57795,8 @@ static void MetaDwrCheckVacuum(BtShared *pBt); static int MetaDwrRecoverAndBeginTran(Btree *pBt, int wrflag, int *pSchemaVersion); static int MetaDwrOpenAndCheck(Btree *pBt); static void MetaDwrDisable(Btree *pBt); @@ -32,7 +43,7 @@ index 80d7979..6ab872e 100644 #define META_HEADER_CHANGED 1 #define META_SCHEMA_CHANGED 2 #define META_IN_RECOVERY 1 -@@ -59564,11 +59566,12 @@ static int pager_end_transaction(Pager *pPager, int hasSuper, int bCommit){ +@@ -59571,11 +59575,12 @@ static int pager_end_transaction(Pager *pPager, int hasSuper, int bCommit){ sqlite3PcacheTruncate(pPager->pPCache, pPager->dbSize); } #ifdef SQLITE_META_DWR @@ -50,7 +61,7 @@ index 80d7979..6ab872e 100644 } #endif if( pagerUseWal(pPager) ){ -@@ -74672,6 +74675,11 @@ static int lockBtree(BtShared *pBt){ +@@ -74679,6 +74684,11 @@ static int lockBtree(BtShared *pBt){ } if( nPage>nPageFile ){ if( sqlite3WritableSchema(pBt->db)==0 ){ @@ -62,7 +73,7 @@ index 80d7979..6ab872e 100644 rc = SQLITE_CORRUPT_BKPT; goto page1_init_failed; }else{ -@@ -121520,8 +121528,8 @@ static void attachFunc( +@@ -121539,8 +121549,8 @@ static void attachFunc( if( rc==SQLITE_OK ){ extern int sqlite3CodecAttach(sqlite3*, int, const void*, int); extern void sqlite3CodecGetKey(sqlite3*, int, void**, int*); @@ -73,7 +84,7 @@ index 80d7979..6ab872e 100644 int t = sqlite3_value_type(argv[2]); switch( t ){ case SQLITE_INTEGER: -@@ -121538,14 +121546,7 @@ static void attachFunc( +@@ -121557,14 +121567,7 @@ static void attachFunc( break; case SQLITE_NULL: @@ -89,7 +100,7 @@ index 80d7979..6ab872e 100644 break; } } -@@ -183717,10 +183718,12 @@ opendb_out: +@@ -183736,10 +183739,12 @@ opendb_out: db->eOpenState = SQLITE_STATE_SICK; } #ifdef SQLITE_ENABLE_DROPTABLE_CALLBACK @@ -106,7 +117,7 @@ index 80d7979..6ab872e 100644 #endif /* SQLITE_ENABLE_DROPTABLE_CALLBACK */ #ifdef SQLITE_ENABLE_BINLOG sqlite3BinlogReset(db); -@@ -204166,6 +204169,39 @@ static int fts3ExprTermOffsetInit(Fts3Expr *pExpr, int iPhrase, void *ctx){ +@@ -204185,6 +204190,39 @@ static int fts3ExprTermOffsetInit(Fts3Expr *pExpr, int iPhrase, void *ctx){ return rc; } @@ -146,7 +157,7 @@ index 80d7979..6ab872e 100644 /* ** Implementation of offsets() function. */ -@@ -204202,6 +204238,12 @@ SQLITE_PRIVATE void sqlite3Fts3Offsets( +@@ -204221,6 +204259,12 @@ SQLITE_PRIVATE void sqlite3Fts3Offsets( sCtx.iDocid = pCsr->iPrevId; sCtx.pCsr = pCsr; @@ -159,7 +170,7 @@ index 80d7979..6ab872e 100644 /* Loop through the table columns, appending offset information to ** string-buffer res for each column. */ -@@ -254388,7 +254430,20 @@ SQLITE_API int sqlite3_stmt_init( +@@ -254407,7 +254451,20 @@ SQLITE_API int sqlite3_stmt_init( /* Return the source-id for this library */ SQLITE_API const char *sqlite3_sourceid(void){ return SQLITE_SOURCE_ID; } /************************** End of sqlite3.c ******************************/ @@ -181,7 +192,7 @@ index 80d7979..6ab872e 100644 #ifdef SQLITE_HAS_CODEC /************** Begin file hw_codec_openssl.h *******************************/ #ifndef EXPOSE_INTERNAL_FUNC -@@ -255582,6 +255637,7 @@ int sqlite3CodecAttach(sqlite3* db, int nDb, const void *pKey, int nKey){ +@@ -255601,6 +255658,7 @@ int sqlite3CodecAttach(sqlite3* db, int nDb, const void *pKey, int nKey){ } } #endif @@ -189,7 +200,7 @@ index 80d7979..6ab872e 100644 #ifdef SQLITE_CODEC_ATTACH_CHANGED int rc = sqlite3CodecInitContext(ctx, p, pKey, nKey, nDb); #else -@@ -256176,7 +256232,12 @@ typedef struct MetaDwrHdr { +@@ -256195,7 +256253,12 @@ typedef struct MetaDwrHdr { u32 pageSz; u32 pageCnt; u64 dbFileInode; @@ -203,7 +214,7 @@ index 80d7979..6ab872e 100644 u32 checkSum; u8 *zones; Pgno *pages; -@@ -256539,6 +256600,87 @@ static inline u64 CaculateMetaDwrWriteOffset(int pageSz, u32 idx, u8 zone) { +@@ -256558,6 +256621,87 @@ static inline u64 CaculateMetaDwrWriteOffset(int pageSz, u32 idx, u8 zone) { return META_DWR_HEADER_PAGE_SIZE + pageSz * (idx * 2 + zone); } @@ -291,7 +302,7 @@ index 80d7979..6ab872e 100644 static void MetaDwrUpdateHeaderDbInfo(BtShared *pBt) { MetaDwrHdr *hdr = pBt->pPager->metaHdr; // 28 offset: dbSize, freelist pageNo, freelist pages count, schema cookie -@@ -256759,11 +256901,12 @@ static int MetaDwrOpenFile(Pager *pPager, u8 openCreate) { +@@ -256778,11 +256922,12 @@ static int MetaDwrOpenFile(Pager *pPager, u8 openCreate) { if (pPager->metaMapPage == NULL) { sqlite3_int64 sz = META_DWR_HEADER_PAGE_SIZE; sqlite3OsFileControlHint(metaFd, SQLITE_FCNTL_CHUNK_SIZE, &sz); @@ -309,7 +320,7 @@ index 80d7979..6ab872e 100644 } } #endif /* SQLITE_OS_UNIX */ -@@ -257137,7 +257280,7 @@ CHK_RESTORE_OUT: +@@ -257156,7 +257301,7 @@ CHK_RESTORE_OUT: return rc; } @@ -318,7 +329,7 @@ index 80d7979..6ab872e 100644 { #if SQLITE_OS_UNIX if (pPager->pVfs == NULL) { -@@ -257151,10 +257294,18 @@ static inline u8 IsConnectionValidForCheck(Pager *pPager) +@@ -257170,10 +257315,18 @@ static inline u8 IsConnectionValidForCheck(Pager *pPager) checkFileId = SQLITE_CHECK_FILE_ID_CKSM; } unixFile *fd = Sqlite3GetUnixFile(pPager->fd, checkFileId); @@ -338,7 +349,7 @@ index 80d7979..6ab872e 100644 return 1; #else return 0; -@@ -257164,7 +257315,7 @@ static inline u8 IsConnectionValidForCheck(Pager *pPager) +@@ -257183,7 +257336,7 @@ static inline u8 IsConnectionValidForCheck(Pager *pPager) static int MetaDwrOpenAndCheck(Btree *pBt) { Pager *pPager = pBt->pBt->pPager; @@ -347,7 +358,7 @@ index 80d7979..6ab872e 100644 return SQLITE_OK; } #ifdef SQLITE_HAS_CODEC -@@ -257209,7 +257360,7 @@ DWR_OPEN_OUT: +@@ -257228,7 +257381,7 @@ DWR_OPEN_OUT: static void MetaDwrDisable(Btree *pBt) { Pager *pPager = pBt->pBt->pPager; @@ -356,7 +367,7 @@ index 80d7979..6ab872e 100644 return; } #ifdef SQLITE_HAS_CODEC -@@ -257235,19 +257386,6 @@ static void MetaDwrDisable(Btree *pBt) +@@ -257254,19 +257407,6 @@ static void MetaDwrDisable(Btree *pBt) #endif /* SQLITE_META_DWR */ #if SQLITE_OS_UNIX @@ -376,7 +387,7 @@ index 80d7979..6ab872e 100644 static void ResetLockStatus(void) { (void)memset(&g_lockStatus, 0, sizeof(g_lockStatus)); -@@ -257351,8 +257489,13 @@ static inline const char *FlockToName(int l_type) +@@ -257370,8 +257510,13 @@ static inline const char *FlockToName(int l_type) static int DumpProcessLocks(int fd, struct flock *lock, const char *lockName, char *dumpBuf, int bufLen) { @@ -391,7 +402,7 @@ index 80d7979..6ab872e 100644 sqlite3_log(SQLITE_ERROR, "[SQLite]Get wal file lock ofs %u failed, errno: %d", lock->l_start, errno); return 0; } -@@ -258422,7 +258565,11 @@ struct sqlite3_api_routines_hw { +@@ -258602,7 +258747,11 @@ struct sqlite3_api_routines_hw { int (*rekey_v2)(sqlite3*,const char*,const void*,int); int (*is_support_binlog)(void); int (*replay_binlog)(sqlite3*, sqlite3*); @@ -404,5 +415,5 @@ index 80d7979..6ab872e 100644 typedef struct sqlite3_api_routines_hw sqlite3_api_routines_hw; -- -2.47.0.windows.2 +2.28.0.windows.1 -- Gitee