diff --git a/source/libs/tdb/src/db/tdbPgFile.c b/source/libs/tdb/src/db/tdbPgFile.c index 030f57de4cd247a22a3476b896ddc0ddf7692246..5db0c4dcc39f0b5241d482132ac386f1b9030152 100644 --- a/source/libs/tdb/src/db/tdbPgFile.c +++ b/source/libs/tdb/src/db/tdbPgFile.c @@ -107,6 +107,21 @@ SPage *pgFileFetch(SPgFile *pPgFile, pgno_t pgno) { SPage * pPage; pgid_t pgid; + // 1. Fetch from the page cache + // pgCacheFetch(pPgCache, pgid); + + // 2. If only get a page frame, no content, maybe + // need to load from the file + if (1 /*page not initialized*/) { + if (pgno < pPgFile->fsize) { + // load the page content from the disk + // ?? How about the freed pages ?? + } else { + // zero the page, make the page as a empty + // page with zero records. + } + } + #if 0 pPgCache = pPgFile->pPgCache; pPage = NULL;