Merge pull request #17548 from taosdata/szhou/fixbugs
fix: get next row from rb tree from last files when backward scaning
This commit is contained in:
commit
88c52d567b
|
@ -536,6 +536,10 @@ static FORCE_INLINE int32_t tLDataIterCmprFn(const SRBTreeNode *p1, const SRBTre
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static FORCE_INLINE int32_t tLDataIterDescCmprFn(const SRBTreeNode *p1, const SRBTreeNode *p2) {
|
||||||
|
return -1 * tLDataIterCmprFn(p1, p2);
|
||||||
|
}
|
||||||
|
|
||||||
int32_t tMergeTreeOpen(SMergeTree *pMTree, int8_t backward, SDataFReader *pFReader, uint64_t suid, uint64_t uid,
|
int32_t tMergeTreeOpen(SMergeTree *pMTree, int8_t backward, SDataFReader *pFReader, uint64_t suid, uint64_t uid,
|
||||||
STimeWindow *pTimeWindow, SVersionRange *pVerRange, SSttBlockLoadInfo *pBlockLoadInfo,
|
STimeWindow *pTimeWindow, SVersionRange *pVerRange, SSttBlockLoadInfo *pBlockLoadInfo,
|
||||||
bool destroyLoadInfo, const char *idStr) {
|
bool destroyLoadInfo, const char *idStr) {
|
||||||
|
@ -547,8 +551,11 @@ int32_t tMergeTreeOpen(SMergeTree *pMTree, int8_t backward, SDataFReader *pFRead
|
||||||
}
|
}
|
||||||
|
|
||||||
pMTree->idStr = idStr;
|
pMTree->idStr = idStr;
|
||||||
|
if (!pMTree->backward) { // asc
|
||||||
tRBTreeCreate(&pMTree->rbt, tLDataIterCmprFn);
|
tRBTreeCreate(&pMTree->rbt, tLDataIterCmprFn);
|
||||||
|
} else { // desc
|
||||||
|
tRBTreeCreate(&pMTree->rbt, tLDataIterDescCmprFn);
|
||||||
|
}
|
||||||
int32_t code = TSDB_CODE_SUCCESS;
|
int32_t code = TSDB_CODE_SUCCESS;
|
||||||
|
|
||||||
pMTree->pLoadInfo = pBlockLoadInfo;
|
pMTree->pLoadInfo = pBlockLoadInfo;
|
||||||
|
|
|
@ -920,7 +920,7 @@ int32_t acquireUdfFuncHandle(char *udfName, UdfcFuncHandle *pHandle) {
|
||||||
code = doSetupUdf(udfName, pHandle);
|
code = doSetupUdf(udfName, pHandle);
|
||||||
if (code == TSDB_CODE_SUCCESS) {
|
if (code == TSDB_CODE_SUCCESS) {
|
||||||
SUdfcFuncStub stub = {0};
|
SUdfcFuncStub stub = {0};
|
||||||
strcpy(stub.udfName, udfName);
|
strncpy(stub.udfName, udfName, TSDB_FUNC_NAME_LEN);
|
||||||
stub.handle = *pHandle;
|
stub.handle = *pHandle;
|
||||||
++stub.refCount;
|
++stub.refCount;
|
||||||
stub.lastRefTime = taosGetTimestampUs();
|
stub.lastRefTime = taosGetTimestampUs();
|
||||||
|
|
Loading…
Reference in New Issue