未验证 提交 bf916610 编写于 作者: dengyihao's avatar dengyihao 提交者: GitHub

Merge pull request #11213 from taosdata/feature/indexUpdate

handle except
...@@ -642,6 +642,9 @@ static const char* fstNodeState(FstNode* node) { ...@@ -642,6 +642,9 @@ static const char* fstNodeState(FstNode* node) {
} }
void fstNodeDestroy(FstNode* node) { void fstNodeDestroy(FstNode* node) {
if (node == NULL) {
return;
}
fstSliceDestroy(&node->data); fstSliceDestroy(&node->data);
taosMemoryFree(node); taosMemoryFree(node);
} }
...@@ -1247,7 +1250,10 @@ bool streamWithStateSeekMin(StreamWithState* sws, FstBoundWithData* min) { ...@@ -1247,7 +1250,10 @@ bool streamWithStateSeekMin(StreamWithState* sws, FstBoundWithData* min) {
// autState = sws->aut->accept(preState, b); // autState = sws->aut->accept(preState, b);
autState = automFuncs[aut->type].accept(aut, preState, b); autState = automFuncs[aut->type].accept(aut, preState, b);
taosArrayPush(sws->inp, &b); taosArrayPush(sws->inp, &b);
StreamState s = {.node = node, .trans = res + 1, .out = {.null = false, .out = out}, .autState = preState}; StreamState s = {.node = node, .trans = res + 1, .out = {.null = false, .out = out}, .autState = preState};
node = NULL;
taosArrayPush(sws->stack, &s); taosArrayPush(sws->stack, &s);
out += trn.out; out += trn.out;
node = fstGetNode(sws->fst, trn.addr); node = fstGetNode(sws->fst, trn.addr);
...@@ -1271,6 +1277,9 @@ bool streamWithStateSeekMin(StreamWithState* sws, FstBoundWithData* min) { ...@@ -1271,6 +1277,9 @@ bool streamWithStateSeekMin(StreamWithState* sws, FstBoundWithData* min) {
return true; return true;
} }
} }
fstNodeDestroy(node);
uint32_t sz = taosArrayGetSize(sws->stack); uint32_t sz = taosArrayGetSize(sws->stack);
if (sz != 0) { if (sz != 0) {
StreamState* s = taosArrayGet(sws->stack, sz - 1); StreamState* s = taosArrayGet(sws->stack, sz - 1);
......
...@@ -480,6 +480,15 @@ void checkFstCheckIteratorRange2() { ...@@ -480,6 +480,15 @@ void checkFstCheckIteratorRange2() {
assert(result.size() == 4); assert(result.size() == 4);
automCtxDestroy(ctx); automCtxDestroy(ctx);
} }
{
// range search
std::vector<uint64_t> result;
AutomationCtx* ctx = automCtxCreate((void*)"he", AUTOMATION_ALWAYS);
// [b, e)
m->SearchRange(ctx, "bb", GE, "ed", LT, result);
assert(result.size() == 3);
automCtxDestroy(ctx);
}
{ {
// range search // range search
std::vector<uint64_t> result; std::vector<uint64_t> result;
...@@ -635,11 +644,11 @@ int main(int argc, char* argv[]) { ...@@ -635,11 +644,11 @@ int main(int argc, char* argv[]) {
// path suid colName ver // path suid colName ver
// iterTFileReader(argv[1], argv[2], argv[3], argv[4]); // iterTFileReader(argv[1], argv[2], argv[3], argv[4]);
//} //}
// checkFstCheckIterator1(); checkFstCheckIterator1();
// checkFstCheckIterator2(); checkFstCheckIterator2();
// checkFstCheckIteratorPrefix(); checkFstCheckIteratorPrefix();
// checkFstCheckIteratorRange1(); checkFstCheckIteratorRange1();
// checkFstCheckIteratorRange2(); checkFstCheckIteratorRange2();
checkFstCheckIteratorRange3(); checkFstCheckIteratorRange3();
// checkFstLongTerm(); // checkFstLongTerm();
// checkFstPrefixSearch(); // checkFstPrefixSearch();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册