refactor(query): disable file size check when reading data files.
This commit is contained in:
parent
e9490a3235
commit
40b7718078
|
@ -47,17 +47,17 @@ static int32_t tsdbOpenFile(const char *path, int32_t szPage, int32_t flag, STsd
|
||||||
taosMemoryFree(pFD);
|
taosMemoryFree(pFD);
|
||||||
goto _exit;
|
goto _exit;
|
||||||
}
|
}
|
||||||
|
if (flag == TD_FILE_READ) {
|
||||||
if (taosStatFile(path, &pFD->szFile, NULL) < 0) {
|
if (taosStatFile(path, &pFD->szFile, NULL) < 0) {
|
||||||
code = TAOS_SYSTEM_ERROR(errno);
|
code = TAOS_SYSTEM_ERROR(errno);
|
||||||
taosMemoryFree(pFD->pBuf);
|
taosMemoryFree(pFD->pBuf);
|
||||||
taosCloseFile(&pFD->pFD);
|
taosCloseFile(&pFD->pFD);
|
||||||
taosMemoryFree(pFD);
|
taosMemoryFree(pFD);
|
||||||
goto _exit;
|
goto _exit;
|
||||||
|
}
|
||||||
|
ASSERT(pFD->szFile % szPage == 0);
|
||||||
|
pFD->szFile = pFD->szFile / szPage;
|
||||||
}
|
}
|
||||||
|
|
||||||
ASSERT(pFD->szFile % szPage == 0);
|
|
||||||
pFD->szFile = pFD->szFile / szPage;
|
|
||||||
*ppFD = pFD;
|
*ppFD = pFD;
|
||||||
|
|
||||||
_exit:
|
_exit:
|
||||||
|
@ -105,7 +105,7 @@ _exit:
|
||||||
static int32_t tsdbReadFilePage(STsdbFD *pFD, int64_t pgno) {
|
static int32_t tsdbReadFilePage(STsdbFD *pFD, int64_t pgno) {
|
||||||
int32_t code = 0;
|
int32_t code = 0;
|
||||||
|
|
||||||
ASSERT(pgno <= pFD->szFile);
|
// ASSERT(pgno <= pFD->szFile);
|
||||||
|
|
||||||
// seek
|
// seek
|
||||||
int64_t offset = PAGE_OFFSET(pgno, pFD->szPage);
|
int64_t offset = PAGE_OFFSET(pgno, pFD->szPage);
|
||||||
|
@ -177,7 +177,7 @@ static int32_t tsdbReadFile(STsdbFD *pFD, int64_t offset, uint8_t *pBuf, int64_t
|
||||||
int32_t szPgCont = PAGE_CONTENT_SIZE(pFD->szPage);
|
int32_t szPgCont = PAGE_CONTENT_SIZE(pFD->szPage);
|
||||||
int64_t bOffset = fOffset % pFD->szPage;
|
int64_t bOffset = fOffset % pFD->szPage;
|
||||||
|
|
||||||
ASSERT(pgno && pgno <= pFD->szFile);
|
// ASSERT(pgno && pgno <= pFD->szFile);
|
||||||
ASSERT(bOffset < szPgCont);
|
ASSERT(bOffset < szPgCont);
|
||||||
|
|
||||||
while (n < size) {
|
while (n < size) {
|
||||||
|
|
Loading…
Reference in New Issue