Merge pull request #2313 from taosdata/hotfix/figbug-revealby-coverity
fixbug revealed by coverity
This commit is contained in:
commit
ce1c88a8a8
|
@ -3335,7 +3335,7 @@ void setWindowResOutputBufInitCtx(SQueryRuntimeEnv *pRuntimeEnv, SWindowResult *
|
|||
|
||||
int32_t setAdditionalInfo(SQInfo *pQInfo, STableId* pTableId, STableQueryInfo *pTableQueryInfo) {
|
||||
SQueryRuntimeEnv *pRuntimeEnv = &pQInfo->runtimeEnv;
|
||||
assert(pTableQueryInfo->lastKey >= TSKEY_INITIAL_VAL);
|
||||
//assert(pTableQueryInfo->lastKey >= TSKEY_INITIAL_VAL);
|
||||
|
||||
setTagVal(pRuntimeEnv, pTableId, pQInfo->tsdb);
|
||||
|
||||
|
@ -4230,7 +4230,7 @@ static void sequentialTableProcess(SQInfo *pQInfo) {
|
|||
SArray* group = taosArrayGetP(pQInfo->groupInfo.pGroupList, pQInfo->groupIndex);
|
||||
|
||||
qTrace("QInfo:%p last_row query on group:%d, total group:%d, current group:%d", pQInfo, pQInfo->groupIndex,
|
||||
numOfGroups);
|
||||
numOfGroups, group);
|
||||
|
||||
STsdbQueryCond cond = {
|
||||
.twindow = pQuery->window,
|
||||
|
@ -4264,10 +4264,10 @@ static void sequentialTableProcess(SQInfo *pQInfo) {
|
|||
|
||||
setTagVal(pRuntimeEnv, (STableId*) taosArrayGet(s, 0), pQInfo->tsdb);
|
||||
|
||||
taosArrayDestroy(s);
|
||||
if (isFirstLastRowQuery(pQuery)) {
|
||||
assert(taosArrayGetSize(s) == 1);
|
||||
}
|
||||
taosArrayDestroy(s);
|
||||
|
||||
// here we simply set the first table as current table
|
||||
pQuery->current = ((SGroupItem*) taosArrayGet(group, 0))->info;
|
||||
|
@ -5380,6 +5380,7 @@ static int32_t createFilterInfo(void *pQInfo, SQuery *pQuery) {
|
|||
|
||||
if ((lower == TSDB_RELATION_GREATER_EQUAL || lower == TSDB_RELATION_GREATER) &&
|
||||
(upper == TSDB_RELATION_LESS_EQUAL || upper == TSDB_RELATION_LESS)) {
|
||||
assert(rangeFilterArray != NULL);
|
||||
if (lower == TSDB_RELATION_GREATER_EQUAL) {
|
||||
if (upper == TSDB_RELATION_LESS_EQUAL) {
|
||||
pSingleColFilter->fp = rangeFilterArray[4];
|
||||
|
@ -5394,11 +5395,12 @@ static int32_t createFilterInfo(void *pQInfo, SQuery *pQuery) {
|
|||
}
|
||||
}
|
||||
} else { // set callback filter function
|
||||
assert(filterArray != NULL);
|
||||
if (lower != TSDB_RELATION_INVALID) {
|
||||
pSingleColFilter->fp = filterArray[lower];
|
||||
|
||||
if (upper != TSDB_RELATION_INVALID) {
|
||||
qError("pQInfo:%p failed to get filter function, invalid filter condition", pQInfo, type);
|
||||
qError("pQInfo:%p failed to get filter function, invalid filter condition: %d", pQInfo, type);
|
||||
return TSDB_CODE_QRY_INVALID_MSG;
|
||||
}
|
||||
} else {
|
||||
|
|
|
@ -887,7 +887,7 @@ int32_t tVariantTypeSetType(tVariant *pVariant, char type) {
|
|||
free(pVariant->pz);
|
||||
pVariant->dKey = v;
|
||||
} else if (pVariant->nType >= TSDB_DATA_TYPE_BOOL && pVariant->nType <= TSDB_DATA_TYPE_BIGINT) {
|
||||
pVariant->dKey = pVariant->i64Key;
|
||||
pVariant->dKey = (double)(pVariant->i64Key);
|
||||
}
|
||||
|
||||
pVariant->nType = TSDB_DATA_TYPE_DOUBLE;
|
||||
|
|
Loading…
Reference in New Issue