fix coverity issues continue
This commit is contained in:
parent
e83fd5043a
commit
b7bee06a18
|
@ -32,7 +32,6 @@ int32_t tscGetNumOfTags(const STableMeta* pTableMeta) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pTableMeta->tableType == TSDB_SUPER_TABLE || pTableMeta->tableType == TSDB_CHILD_TABLE) {
|
if (pTableMeta->tableType == TSDB_SUPER_TABLE || pTableMeta->tableType == TSDB_CHILD_TABLE) {
|
||||||
assert(tinfo.numOfTags >= 0);
|
|
||||||
return tinfo.numOfTags;
|
return tinfo.numOfTags;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -354,7 +354,7 @@ static int32_t tscLaunchSecondPhaseSubqueries(SSqlObj* pSql) {
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t numOfCols = taosArrayGetSize(pNewQueryInfo->colList);
|
size_t numOfCols = taosArrayGetSize(pNewQueryInfo->colList);
|
||||||
tscTrace("%p subquery:%p tableIndex:%d, vgroupIndex:%d, type:%d, exprInfo:%d, colList:%d, fieldsInfo:%d, name:%s",
|
tscTrace("%p subquery:%p tableIndex:%d, vgroupIndex:%d, type:%d, exprInfo:%z, colList:%z, fieldsInfo:%d, name:%s",
|
||||||
pSql, pNew, 0, pTableMetaInfo->vgroupIndex, pNewQueryInfo->type, taosArrayGetSize(pNewQueryInfo->exprList),
|
pSql, pNew, 0, pTableMetaInfo->vgroupIndex, pNewQueryInfo->type, taosArrayGetSize(pNewQueryInfo->exprList),
|
||||||
numOfCols, pNewQueryInfo->fieldsInfo.numOfOutput, pTableMetaInfo->name);
|
numOfCols, pNewQueryInfo->fieldsInfo.numOfOutput, pTableMetaInfo->name);
|
||||||
}
|
}
|
||||||
|
@ -551,7 +551,7 @@ static void issueTSCompQuery(SSqlObj* pSql, SJoinSupporter* pSupporter, SSqlObj*
|
||||||
|
|
||||||
tscTrace(
|
tscTrace(
|
||||||
"%p subquery:%p tableIndex:%d, vgroupIndex:%d, numOfVgroups:%d, type:%d, ts_comp query to retrieve timestamps, "
|
"%p subquery:%p tableIndex:%d, vgroupIndex:%d, numOfVgroups:%d, type:%d, ts_comp query to retrieve timestamps, "
|
||||||
"numOfExpr:%d, colList:%d, numOfOutputFields:%d, name:%s",
|
"numOfExpr:%z, colList:%z, numOfOutputFields:%d, name:%s",
|
||||||
pParent, pSql, 0, pTableMetaInfo->vgroupIndex, pTableMetaInfo->vgroupList->numOfVgroups, pQueryInfo->type,
|
pParent, pSql, 0, pTableMetaInfo->vgroupIndex, pTableMetaInfo->vgroupList->numOfVgroups, pQueryInfo->type,
|
||||||
tscSqlExprNumOfExprs(pQueryInfo), numOfCols, pQueryInfo->fieldsInfo.numOfOutput, pTableMetaInfo->name);
|
tscSqlExprNumOfExprs(pQueryInfo), numOfCols, pQueryInfo->fieldsInfo.numOfOutput, pTableMetaInfo->name);
|
||||||
|
|
||||||
|
@ -713,9 +713,8 @@ static void tidTagRetrieveCallback(void* param, TAOS_RES* tres, int32_t numOfRow
|
||||||
if (taosArrayGetSize(s1) == 0 || taosArrayGetSize(s2) == 0) { // no results,return.
|
if (taosArrayGetSize(s1) == 0 || taosArrayGetSize(s2) == 0) { // no results,return.
|
||||||
tscTrace("%p free all sub SqlObj and quit", pParentSql);
|
tscTrace("%p free all sub SqlObj and quit", pParentSql);
|
||||||
freeJoinSubqueryObj(pParentSql);
|
freeJoinSubqueryObj(pParentSql);
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
} else {
|
||||||
// proceed to for ts_comp query
|
// proceed to for ts_comp query
|
||||||
SSqlCmd* pSubCmd1 = &pParentSql->pSubs[0]->cmd;
|
SSqlCmd* pSubCmd1 = &pParentSql->pSubs[0]->cmd;
|
||||||
SSqlCmd* pSubCmd2 = &pParentSql->pSubs[1]->cmd;
|
SSqlCmd* pSubCmd2 = &pParentSql->pSubs[1]->cmd;
|
||||||
|
@ -737,6 +736,10 @@ static void tidTagRetrieveCallback(void* param, TAOS_RES* tres, int32_t numOfRow
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
taosArrayDestroy(s1);
|
||||||
|
taosArrayDestroy(s2);
|
||||||
|
}
|
||||||
|
|
||||||
static void tsCompRetrieveCallback(void* param, TAOS_RES* tres, int32_t numOfRows) {
|
static void tsCompRetrieveCallback(void* param, TAOS_RES* tres, int32_t numOfRows) {
|
||||||
SJoinSupporter* pSupporter = (SJoinSupporter*)param;
|
SJoinSupporter* pSupporter = (SJoinSupporter*)param;
|
||||||
|
|
||||||
|
@ -1242,7 +1245,7 @@ int32_t tscLaunchJoinSubquery(SSqlObj *pSql, int16_t tableIndex, SJoinSupporter
|
||||||
|
|
||||||
tscTrace(
|
tscTrace(
|
||||||
"%p subquery:%p tableIndex:%d, vgroupIndex:%d, type:%d, transfer to tid_tag query to retrieve (tableId, tags), "
|
"%p subquery:%p tableIndex:%d, vgroupIndex:%d, type:%d, transfer to tid_tag query to retrieve (tableId, tags), "
|
||||||
"exprInfo:%d, colList:%d, fieldsInfo:%d, tagIndex:%d, name:%s",
|
"exprInfo:%z, colList:%z, fieldsInfo:%d, tagIndex:%d, name:%s",
|
||||||
pSql, pNew, tableIndex, pTableMetaInfo->vgroupIndex, pNewQueryInfo->type, tscSqlExprNumOfExprs(pNewQueryInfo),
|
pSql, pNew, tableIndex, pTableMetaInfo->vgroupIndex, pNewQueryInfo->type, tscSqlExprNumOfExprs(pNewQueryInfo),
|
||||||
numOfCols, pNewQueryInfo->fieldsInfo.numOfOutput, index.columnIndex, pNewQueryInfo->pTableMetaInfo[0]->name);
|
numOfCols, pNewQueryInfo->fieldsInfo.numOfOutput, index.columnIndex, pNewQueryInfo->pTableMetaInfo[0]->name);
|
||||||
} else {
|
} else {
|
||||||
|
@ -1276,8 +1279,8 @@ int32_t tscLaunchJoinSubquery(SSqlObj *pSql, int16_t tableIndex, SJoinSupporter
|
||||||
size_t numOfCols = taosArrayGetSize(pNewQueryInfo->colList);
|
size_t numOfCols = taosArrayGetSize(pNewQueryInfo->colList);
|
||||||
|
|
||||||
tscTrace(
|
tscTrace(
|
||||||
"%p subquery:%p tableIndex:%d, vgroupIndex:%d, type:%d, transfer to ts_comp query to retrieve timestamps, "
|
"%p subquery:%p tableIndex:%d, vgroupIndex:%d, type:%u, transfer to ts_comp query to retrieve timestamps, "
|
||||||
"exprInfo:%d, colList:%d, fieldsInfo:%d, name:%s",
|
"exprInfo:%z, colList:%z, fieldsInfo:%d, name:%s",
|
||||||
pSql, pNew, tableIndex, pTableMetaInfo->vgroupIndex, pNewQueryInfo->type, tscSqlExprNumOfExprs(pNewQueryInfo),
|
pSql, pNew, tableIndex, pTableMetaInfo->vgroupIndex, pNewQueryInfo->type, tscSqlExprNumOfExprs(pNewQueryInfo),
|
||||||
numOfCols, pNewQueryInfo->fieldsInfo.numOfOutput, pNewQueryInfo->pTableMetaInfo[0]->name);
|
numOfCols, pNewQueryInfo->fieldsInfo.numOfOutput, pNewQueryInfo->pTableMetaInfo[0]->name);
|
||||||
}
|
}
|
||||||
|
@ -1699,7 +1702,7 @@ static void tscRetrieveFromDnodeCallBack(void *param, TAOS_RES *tres, int numOfR
|
||||||
assert(pRes->numOfRows == numOfRows);
|
assert(pRes->numOfRows == numOfRows);
|
||||||
int64_t num = atomic_add_fetch_64(&pState->numOfRetrievedRows, numOfRows);
|
int64_t num = atomic_add_fetch_64(&pState->numOfRetrievedRows, numOfRows);
|
||||||
|
|
||||||
tscTrace("%p sub:%p retrieve numOfRows:%d totalNumOfRows:%d from ip:%s, orderOfSub:%d", pPObj, pSql,
|
tscTrace("%p sub:%p retrieve numOfRows:%" PRId64 " totalNumOfRows:%" PRIu64 " from ip:%s, orderOfSub:%d", pPObj, pSql,
|
||||||
pRes->numOfRows, pState->numOfRetrievedRows, pSql->ipList.fqdn[pSql->ipList.inUse], idx);
|
pRes->numOfRows, pState->numOfRetrievedRows, pSql->ipList.fqdn[pSql->ipList.inUse], idx);
|
||||||
|
|
||||||
if (num > tsMaxNumOfOrderedResults && tscIsProjectionQueryOnSTable(pQueryInfo, 0)) {
|
if (num > tsMaxNumOfOrderedResults && tscIsProjectionQueryOnSTable(pQueryInfo, 0)) {
|
||||||
|
@ -1827,7 +1830,7 @@ void tscRetrieveDataRes(void *param, TAOS_RES *tres, int code) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pParentSql->res.code != TSDB_CODE_SUCCESS) { // at least one peer subquery failed, abort current query
|
if (pParentSql->res.code != TSDB_CODE_SUCCESS) { // at least one peer subquery failed, abort current query
|
||||||
tscTrace("%p sub:%p query failed,ip:%u,vgId:%d,orderOfSub:%d,global code:%d", pParentSql, pSql,
|
tscTrace("%p sub:%p query failed,ip:%s,vgId:%d,orderOfSub:%d,global code:%d", pParentSql, pSql,
|
||||||
pVgroup->ipAddr[0].fqdn, pVgroup->vgId, trsupport->subqueryIndex, pParentSql->res.code);
|
pVgroup->ipAddr[0].fqdn, pVgroup->vgId, trsupport->subqueryIndex, pParentSql->res.code);
|
||||||
|
|
||||||
tscHandleSubqueryError(param, tres, pParentSql->res.code);
|
tscHandleSubqueryError(param, tres, pParentSql->res.code);
|
||||||
|
|
|
@ -220,7 +220,7 @@ static int taos_options_imp(TSDB_OPTION option, const char *pStr) {
|
||||||
|
|
||||||
if (strlen(tsLocale) == 0) { // locale does not set yet
|
if (strlen(tsLocale) == 0) { // locale does not set yet
|
||||||
char* defaultLocale = setlocale(LC_CTYPE, "");
|
char* defaultLocale = setlocale(LC_CTYPE, "");
|
||||||
strcpy(tsLocale, defaultLocale);
|
tstrncpy(tsLocale, defaultLocale, sizeof(tsLocale));
|
||||||
}
|
}
|
||||||
|
|
||||||
// set the user specified locale
|
// set the user specified locale
|
||||||
|
@ -304,7 +304,7 @@ static int taos_options_imp(TSDB_OPTION option, const char *pStr) {
|
||||||
assert(cfg != NULL);
|
assert(cfg != NULL);
|
||||||
|
|
||||||
if (cfg->cfgStatus <= TAOS_CFG_CSTATUS_OPTION) {
|
if (cfg->cfgStatus <= TAOS_CFG_CSTATUS_OPTION) {
|
||||||
strcpy(tsTimezone, pStr);
|
tstrncpy(tsTimezone, pStr, sizeof(tsTimezone));
|
||||||
tsSetTimeZone();
|
tsSetTimeZone();
|
||||||
cfg->cfgStatus = TAOS_CFG_CSTATUS_OPTION;
|
cfg->cfgStatus = TAOS_CFG_CSTATUS_OPTION;
|
||||||
tscTrace("timezone set:%s, input:%s by taos_options", tsTimezone, pStr);
|
tscTrace("timezone set:%s, input:%s by taos_options", tsTimezone, pStr);
|
||||||
|
|
Loading…
Reference in New Issue