From a4cc355f6c54b39a59ee37f44a8e26284e293c88 Mon Sep 17 00:00:00 2001 From: Hongze Cheng Date: Thu, 24 Feb 2022 09:42:53 +0000 Subject: [PATCH] more --- source/libs/tdb/src/db/tdbBtree.c | 4 ++-- source/libs/tdb/src/db/tdbPFile.c | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/source/libs/tdb/src/db/tdbBtree.c b/source/libs/tdb/src/db/tdbBtree.c index 8eafbe5f8a..c12f9a601e 100644 --- a/source/libs/tdb/src/db/tdbBtree.c +++ b/source/libs/tdb/src/db/tdbBtree.c @@ -28,11 +28,11 @@ struct SBtCursor { int8_t iPage; }; -typedef struct SBPage { +typedef struct SMemPage { u8 isInit; u8 isLeaf; SPgno pgno; -} SBPage; +} SMemPage; int tdbBtreeOpen(SPgno root, SBTree **ppBt) { *ppBt = NULL; diff --git a/source/libs/tdb/src/db/tdbPFile.c b/source/libs/tdb/src/db/tdbPFile.c index 1c6e5e32fd..a0274c6e65 100644 --- a/source/libs/tdb/src/db/tdbPFile.c +++ b/source/libs/tdb/src/db/tdbPFile.c @@ -77,6 +77,9 @@ SPgHdr *tdbPFileGet(SPFile *pFile, SPgno pgno) { SPgid pgid; SPgHdr *pPage; + memcpy(pgid.fileid, pFile->fid, TDB_FILE_ID_LEN); + pgid.pgno = pgno; + pPage = tdbPCacheFetch(pFile->pCache, &pgid, 1); if (pPage == NULL) { // TODO -- GitLab