From 3189c3ddd454cc311e9a45716a0cd0c0e3368285 Mon Sep 17 00:00:00 2001 From: hjxilinx Date: Thu, 7 May 2020 23:15:35 +0800 Subject: [PATCH] [td-225] fix bugs for tags filter --- src/query/src/qast.c | 2 +- src/query/src/qtokenizer.c | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/query/src/qast.c b/src/query/src/qast.c index 0f5c66d429..98682ce778 100644 --- a/src/query/src/qast.c +++ b/src/query/src/qast.c @@ -598,7 +598,7 @@ static void tQueryIndexColumn(SSkipList* pSkipList, tQueryInfo* pQueryInfo, SArr SSkipListNode* pNode = tSkipListIterGet(iter); if (comp) { - ret = func(SL_GET_NODE_KEY(pSkipList, pNode), cond.end->v); + ret = pQueryInfo->compare(SL_GET_NODE_KEY(pSkipList, pNode), cond.end->v); assert(ret <= 0); } diff --git a/src/query/src/qtokenizer.c b/src/query/src/qtokenizer.c index d5b20e1edd..2b568cfd5a 100644 --- a/src/query/src/qtokenizer.c +++ b/src/query/src/qtokenizer.c @@ -266,8 +266,10 @@ static pthread_once_t keywordsHashTableInit = PTHREAD_ONCE_INIT; int tSQLKeywordCode(const char* z, int n) { pthread_once(&keywordsHashTableInit, doInitKeywordsTable); - - char key[128] = {0}; + + char key[512] = {0}; + assert(tListLen(key) >= n); + for (int32_t j = 0; j < n; ++j) { if (z[j] >= 'a' && z[j] <= 'z') { key[j] = (char)(z[j] & 0xDF); // touppercase and set the null-terminated -- GitLab