diff --git a/source/libs/index/inc/index_fst.h b/source/libs/index/inc/index_fst.h index 23da009b22..b26bd227f8 100644 --- a/source/libs/index/inc/index_fst.h +++ b/source/libs/index/inc/index_fst.h @@ -275,6 +275,7 @@ FstNode* fstGetRoot(Fst *fst); FstType fstGetType(Fst *fst); CompiledAddr fstGetRootAddr(Fst *fst); Output fstEmptyFinalOutput(Fst *fst, bool *null); + bool fstVerify(Fst *fst); diff --git a/source/libs/index/inc/index_fst_automation.h b/source/libs/index/inc/index_fst_automation.h index 4943599104..4a29f2e3a6 100644 --- a/source/libs/index/inc/index_fst_automation.h +++ b/source/libs/index/inc/index_fst_automation.h @@ -50,6 +50,7 @@ typedef struct AutomationFunc { } AutomationFunc; AutomationCtx *automCtxCreate(void *data, AutomationType type); +void autoCtxDestroy(AutomationCtx *ctx); extern AutomationFunc automFuncs[]; #ifdef __cplusplus diff --git a/source/libs/index/src/index_fst.c b/source/libs/index/src/index_fst.c index b1401c30fe..18e617f6ae 100644 --- a/source/libs/index/src/index_fst.c +++ b/source/libs/index/src/index_fst.c @@ -1072,7 +1072,6 @@ bool fstGet(Fst *fst, FstSlice *b, Output *out) { tOut += trn.out; root = fstGetNode(fst, trn.addr); taosArrayPush(nodes, &root); - //fstNodeDestroy(root); } if (!FST_NODE_IS_FINAL(root)) { return false; diff --git a/source/libs/index/src/index_fst_automation.c b/source/libs/index/src/index_fst_automation.c index c777f57b02..748c55c29d 100644 --- a/source/libs/index/src/index_fst_automation.c +++ b/source/libs/index/src/index_fst_automation.c @@ -75,15 +75,23 @@ AutomationFunc automFuncs[] = {{ patternAccept, patternAcceptEof } + // add more search type }; AutomationCtx* automCtxCreate(void *data, AutomationType type) { - AutomationCtx *ctx = calloc(1, sizeof(AutomationCtx)); + AutomationCtx *ctx = calloc(1, sizeof(AutomationCtx)); if (ctx == NULL) { return NULL; } ctx->type = type; - if (type == AUTOMATION_PREFIX) { + if (ctx->type == AUTOMATION_PREFIX) { + } else if (ctx->type == AUTMMATION_MATCH) { + + } else { + // add more search type } + return ctx; } - +void autoCtxDestroy(AutomationCtx *ctx) { + free(ctx); +}