From 993be0518a0c1ce2029539c5292f15f414a5d60a Mon Sep 17 00:00:00 2001 From: dengyihao Date: Sun, 14 Jun 2020 12:49:29 +0800 Subject: [PATCH] fix coverity issues --- src/query/src/qast.c | 3 +-- src/query/src/qpercentile.c | 2 +- src/query/src/qtokenizer.c | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/query/src/qast.c b/src/query/src/qast.c index 8d2202563d..36a91ee545 100644 --- a/src/query/src/qast.c +++ b/src/query/src/qast.c @@ -577,8 +577,7 @@ static void tQueryIndexColumn(SSkipList* pSkipList, tQueryInfo* pQueryInfo, SArr assert(0); } } else { - int32_t optr = cond.end->optr; - + int32_t optr = cond.end ? cond.end->optr : TSDB_RELATION_INVALID; if (optr == TSDB_RELATION_LESS || optr == TSDB_RELATION_LESS_EQUAL) { bool comp = true; int32_t ret = 0; diff --git a/src/query/src/qpercentile.c b/src/query/src/qpercentile.c index 367028928b..577fddb808 100644 --- a/src/query/src/qpercentile.c +++ b/src/query/src/qpercentile.c @@ -283,7 +283,7 @@ tMemBucket *tMemBucketCreate(int32_t totalSlots, int32_t nBufferSize, int16_t nE break; }; default: { - uError("MemBucket:%p,not support data type %d,failed", *pBucket, pBucket->dataType); + uError("MemBucket:%p,not support data type %d,failed", pBucket, pBucket->dataType); tfree(pBucket); return NULL; } diff --git a/src/query/src/qtokenizer.c b/src/query/src/qtokenizer.c index e6340cc678..aa9f6fddca 100644 --- a/src/query/src/qtokenizer.c +++ b/src/query/src/qtokenizer.c @@ -655,4 +655,4 @@ SSQLToken tStrGetToken(char* str, int32_t* i, bool isPrevOptr, uint32_t numOfIgn return t0; } -bool isKeyWord(const char* z, int32_t len) { return (tSQLKeywordCode((char*)z, len) != TK_ID); } \ No newline at end of file +bool isKeyWord(const char* z, int32_t len) { return (tSQLKeywordCode((char*)z, len) != TK_ID); } -- GitLab