Merge pull request #5158 from taosdata/hotfix/TD-2944

[TD-2944]taosd crashes when executing stddev query
This commit is contained in:
haojun Liao 2021-02-06 11:26:19 +08:00 committed by GitHub
commit 91eedf66be
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

View File

@ -1569,8 +1569,10 @@ static void stddev_dst_function(SQLFunctionCtx *pCtx) {
avg = p->avg; avg = p->avg;
} else { // todo opt performance by using iterator since the timestamp lsit is matched with the output result } else { // todo opt performance by using iterator since the timestamp lsit is matched with the output result
SResPair* p = bsearch(&pCtx->startTs, resList->pData, len, sizeof(SResPair), tsCompare); SResPair* p = bsearch(&pCtx->startTs, resList->pData, len, sizeof(SResPair), tsCompare);
assert(p != NULL); if (p == NULL) {
return;
}
avg = p->avg; avg = p->avg;
} }