提交 d8aa6d93 编写于 作者: H hjxilinx

[TD-98] suppress compiler warnings and fix some typo

上级 93bd1471
...@@ -134,6 +134,7 @@ void tscFieldInfoSetBinExpr(SFieldInfo* pFieldInfo, int32_t index, SSqlFunctionE ...@@ -134,6 +134,7 @@ void tscFieldInfoSetBinExpr(SFieldInfo* pFieldInfo, int32_t index, SSqlFunctionE
void tscFieldInfoCalOffset(SQueryInfo* pQueryInfo); void tscFieldInfoCalOffset(SQueryInfo* pQueryInfo);
void tscFieldInfoCopy(SFieldInfo* src, SFieldInfo* dst, const int32_t* indexList, int32_t size); void tscFieldInfoCopy(SFieldInfo* src, SFieldInfo* dst, const int32_t* indexList, int32_t size);
void tscFieldInfoCopyAll(SFieldInfo* dst, SFieldInfo* src); void tscFieldInfoCopyAll(SFieldInfo* dst, SFieldInfo* src);
void tscFieldInfoUpdateOffsetForInterResult(SQueryInfo* pQueryInfo);
TAOS_FIELD* tscFieldInfoGetField(SQueryInfo* pQueryInfo, int32_t index); TAOS_FIELD* tscFieldInfoGetField(SQueryInfo* pQueryInfo, int32_t index);
int16_t tscFieldInfoGetOffset(SQueryInfo* pQueryInfo, int32_t index); int16_t tscFieldInfoGetOffset(SQueryInfo* pQueryInfo, int32_t index);
......
...@@ -343,10 +343,10 @@ static int tscBuildMetricTagProjectionResult(SSqlObj *pSql) { ...@@ -343,10 +343,10 @@ static int tscBuildMetricTagProjectionResult(SSqlObj *pSql) {
} }
static int tscBuildMetricTagSqlFunctionResult(SSqlObj *pSql) { static int tscBuildMetricTagSqlFunctionResult(SSqlObj *pSql) {
SSqlCmd *pCmd = &pSql->cmd; // SSqlCmd *pCmd = &pSql->cmd;
SSqlRes *pRes = &pSql->res; // SSqlRes *pRes = &pSql->res;
SQueryInfo* pQueryInfo = tscGetQueryInfoDetail(pCmd, 0); // SQueryInfo* pQueryInfo = tscGetQueryInfoDetail(pCmd, 0);
#if 0 #if 0
SSuperTableMeta *pMetricMeta = tscGetMetaInfo(pQueryInfo, 0)->pMetricMeta; SSuperTableMeta *pMetricMeta = tscGetMetaInfo(pQueryInfo, 0)->pMetricMeta;
int32_t totalNumOfResults = 1; // count function only produce one result int32_t totalNumOfResults = 1; // count function only produce one result
......
...@@ -131,7 +131,7 @@ bool isValidSchema(struct SSchema* pSchema, int32_t numOfCols) { ...@@ -131,7 +131,7 @@ bool isValidSchema(struct SSchema* pSchema, int32_t numOfCols) {
SSchema* tscGetTableColumnSchema(const STableMeta* pTableMeta, int32_t startCol) { SSchema* tscGetTableColumnSchema(const STableMeta* pTableMeta, int32_t startCol) {
assert(pTableMeta != NULL); assert(pTableMeta != NULL);
SSchema* pSchema = pTableMeta->schema; SSchema* pSchema = (SSchema*) pTableMeta->schema;
#if 0 #if 0
if (pTableMeta->tableType == TSDB_CHILD_TABLE) { if (pTableMeta->tableType == TSDB_CHILD_TABLE) {
assert (pTableMeta->pSTable != NULL); assert (pTableMeta->pSTable != NULL);
......
...@@ -1420,10 +1420,10 @@ int tscProcessDescribeTableRsp(SSqlObj *pSql) { ...@@ -1420,10 +1420,10 @@ int tscProcessDescribeTableRsp(SSqlObj *pSql) {
} }
int tscProcessTagRetrieveRsp(SSqlObj *pSql) { int tscProcessTagRetrieveRsp(SSqlObj *pSql) {
SSqlCmd *pCmd = &pSql->cmd; // SSqlCmd *pCmd = &pSql->cmd;
SQueryInfo * pQueryInfo = tscGetQueryInfoDetail(pCmd, pCmd->clauseIndex); // SQueryInfo * pQueryInfo = tscGetQueryInfoDetail(pCmd, pCmd->clauseIndex);
STableMetaInfo *pTableMetaInfo = tscGetMetaInfo(pQueryInfo, 0); // STableMetaInfo *pTableMetaInfo = tscGetMetaInfo(pQueryInfo, 0);
int32_t numOfRes = 0; int32_t numOfRes = 0;
#if 0 #if 0
...@@ -1569,7 +1569,7 @@ int tscBuildMultiMeterMetaMsg(SSqlObj *pSql, SSqlInfo *pInfo) { ...@@ -1569,7 +1569,7 @@ int tscBuildMultiMeterMetaMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
return pCmd->payloadLen; return pCmd->payloadLen;
} }
static int32_t tscEstimateMetricMetaMsgSize(SSqlCmd *pCmd) { static UNUSED_FUNC int32_t tscEstimateMetricMetaMsgSize(SSqlCmd *pCmd) {
const int32_t defaultSize = const int32_t defaultSize =
minMsgSize() + sizeof(SSuperTableMetaMsg) + sizeof(SMgmtHead) + sizeof(int16_t) * TSDB_MAX_TAGS; minMsgSize() + sizeof(SSuperTableMetaMsg) + sizeof(SMgmtHead) + sizeof(int16_t) * TSDB_MAX_TAGS;
SQueryInfo *pQueryInfo = tscGetQueryInfoDetail(pCmd, 0); SQueryInfo *pQueryInfo = tscGetQueryInfoDetail(pCmd, 0);
...@@ -1884,10 +1884,10 @@ int tscProcessTableMetaRsp(SSqlObj *pSql) { ...@@ -1884,10 +1884,10 @@ int tscProcessTableMetaRsp(SSqlObj *pSql) {
* |...... 1B 1B 4B * |...... 1B 1B 4B
**/ **/
int tscProcessMultiMeterMetaRsp(SSqlObj *pSql) { int tscProcessMultiMeterMetaRsp(SSqlObj *pSql) {
uint8_t ieType; // uint8_t ieType;
int32_t totalNum; // int32_t totalNum;
int32_t i; // int32_t i;
#if 0
char *rsp = pSql->res.pRsp; char *rsp = pSql->res.pRsp;
ieType = *rsp; ieType = *rsp;
...@@ -1985,6 +1985,8 @@ int tscProcessMultiMeterMetaRsp(SSqlObj *pSql) { ...@@ -1985,6 +1985,8 @@ int tscProcessMultiMeterMetaRsp(SSqlObj *pSql) {
pSql->res.code = TSDB_CODE_SUCCESS; pSql->res.code = TSDB_CODE_SUCCESS;
pSql->res.numOfTotal = i; pSql->res.numOfTotal = i;
tscTrace("%p load multi-metermeta resp complete num:%d", pSql, pSql->res.numOfTotal); tscTrace("%p load multi-metermeta resp complete num:%d", pSql, pSql->res.numOfTotal);
#endif
return TSDB_CODE_SUCCESS; return TSDB_CODE_SUCCESS;
} }
...@@ -2467,7 +2469,7 @@ int tscGetSTableVgroupInfo(SSqlObj *pSql, int32_t clauseIndex) { ...@@ -2467,7 +2469,7 @@ int tscGetSTableVgroupInfo(SSqlObj *pSql, int32_t clauseIndex) {
SSqlCmd *pCmd = &pSql->cmd; SSqlCmd *pCmd = &pSql->cmd;
//the query condition is serialized into pCmd->payload, we need to rebuild key for stable meta info in cache. //the query condition is serialized into pCmd->payload, we need to rebuild key for stable meta info in cache.
bool required = false; // bool required = false;
SQueryInfo *pQueryInfo = tscGetQueryInfoDetail(pCmd, clauseIndex); SQueryInfo *pQueryInfo = tscGetQueryInfoDetail(pCmd, clauseIndex);
if (pQueryInfo->pTableMetaInfo[0]->vgroupIdList != NULL) { if (pQueryInfo->pTableMetaInfo[0]->vgroupIdList != NULL) {
......
...@@ -535,11 +535,11 @@ static bool tscHashRemainDataInSubqueryResultSet(SSqlObj *pSql) { ...@@ -535,11 +535,11 @@ static bool tscHashRemainDataInSubqueryResultSet(SSqlObj *pSql) {
continue; continue;
} }
SSqlRes *pRes1 = &pSql->pSubs[i]->res; // SSqlRes *pRes1 = &pSql->pSubs[i]->res;
SSqlCmd *pCmd1 = &pSql->pSubs[i]->cmd; SSqlCmd *pCmd1 = &pSql->pSubs[i]->cmd;
SQueryInfo * pQueryInfo1 = tscGetQueryInfoDetail(pCmd1, pCmd1->clauseIndex); SQueryInfo * pQueryInfo1 = tscGetQueryInfoDetail(pCmd1, pCmd1->clauseIndex);
STableMetaInfo *pMetaInfo = tscGetMetaInfo(pQueryInfo1, 0); // STableMetaInfo *pMetaInfo = tscGetMetaInfo(pQueryInfo1, 0);
assert(pQueryInfo1->numOfTables == 1); assert(pQueryInfo1->numOfTables == 1);
...@@ -576,7 +576,7 @@ static bool tscHashRemainDataInSubqueryResultSet(SSqlObj *pSql) { ...@@ -576,7 +576,7 @@ static bool tscHashRemainDataInSubqueryResultSet(SSqlObj *pSql) {
return hasData; return hasData;
} }
static void **tscBuildResFromSubqueries(SSqlObj *pSql) { static UNUSED_FUNC void **tscBuildResFromSubqueries(SSqlObj *pSql) {
SSqlRes *pRes = &pSql->res; SSqlRes *pRes = &pSql->res;
while (1) { while (1) {
......
...@@ -279,7 +279,7 @@ int32_t tscLaunchSecondPhaseSubqueries(SSqlObj* pSql) { ...@@ -279,7 +279,7 @@ int32_t tscLaunchSecondPhaseSubqueries(SSqlObj* pSql) {
assert(pSubQueryInfo->exprsInfo.numOfExprs == 1); // ts_comp query only requires one resutl columns assert(pSubQueryInfo->exprsInfo.numOfExprs == 1); // ts_comp query only requires one resutl columns
taos_free_result(pPrevSub); taos_free_result(pPrevSub);
SSqlObj *pNew = createSubqueryObj(pSql, (int16_t) i, tscJoinQueryCallback, TSDB_SQL_SELECT, pSupporter, NULL); SSqlObj *pNew = createSubqueryObj(pSql, (int16_t) i, tscJoinQueryCallback, pSupporter, TSDB_SQL_SELECT, NULL);
if (pNew == NULL) { if (pNew == NULL) {
tscDestroyJoinSupporter(pSupporter); tscDestroyJoinSupporter(pSupporter);
success = false; success = false;
...@@ -538,7 +538,7 @@ static void joinRetrieveCallback(void* param, TAOS_RES* tres, int numOfRows) { ...@@ -538,7 +538,7 @@ static void joinRetrieveCallback(void* param, TAOS_RES* tres, int numOfRows) {
} }
if (tscNonOrderedProjectionQueryOnSTable(pQueryInfo, 0) && numOfRows == 0) { if (tscNonOrderedProjectionQueryOnSTable(pQueryInfo, 0) && numOfRows == 0) {
STableMetaInfo* pTableMetaInfo = tscGetMetaInfo(pQueryInfo, 0); // STableMetaInfo* pTableMetaInfo = tscGetMetaInfo(pQueryInfo, 0);
assert(pQueryInfo->numOfTables == 1); assert(pQueryInfo->numOfTables == 1);
// for projection query, need to try next vnode if current vnode is exhausted // for projection query, need to try next vnode if current vnode is exhausted
...@@ -606,7 +606,7 @@ void tscFetchDatablockFromSubquery(SSqlObj* pSql) { ...@@ -606,7 +606,7 @@ void tscFetchDatablockFromSubquery(SSqlObj* pSql) {
SSqlRes *pRes = &pSql->pSubs[i]->res; SSqlRes *pRes = &pSql->pSubs[i]->res;
SQueryInfo* pQueryInfo = tscGetQueryInfoDetail(&pSql->pSubs[i]->cmd, 0); SQueryInfo* pQueryInfo = tscGetQueryInfoDetail(&pSql->pSubs[i]->cmd, 0);
STableMetaInfo *pTableMetaInfo = tscGetMetaInfo(pQueryInfo, 0); // STableMetaInfo *pTableMetaInfo = tscGetMetaInfo(pQueryInfo, 0);
if (tscNonOrderedProjectionQueryOnSTable(pQueryInfo, 0)) { if (tscNonOrderedProjectionQueryOnSTable(pQueryInfo, 0)) {
// if (pRes->row >= pRes->numOfRows && pTableMetaInfo->vnodeIndex < pTableMetaInfo->pMetricMeta->numOfVnodes && // if (pRes->row >= pRes->numOfRows && pTableMetaInfo->vnodeIndex < pTableMetaInfo->pMetricMeta->numOfVnodes &&
...@@ -834,7 +834,7 @@ int32_t tscLaunchJoinSubquery(SSqlObj *pSql, int16_t tableIndex, SJoinSubquerySu ...@@ -834,7 +834,7 @@ int32_t tscLaunchJoinSubquery(SSqlObj *pSql, int16_t tableIndex, SJoinSubquerySu
} }
} }
SSqlObj *pNew = createSubqueryObj(pSql, tableIndex, tscJoinQueryCallback, TSDB_SQL_SELECT, pSupporter, NULL); SSqlObj *pNew = createSubqueryObj(pSql, tableIndex, tscJoinQueryCallback, pSupporter, TSDB_SQL_SELECT, NULL);
if (pNew == NULL) { if (pNew == NULL) {
return TSDB_CODE_CLI_OUT_OF_MEMORY; return TSDB_CODE_CLI_OUT_OF_MEMORY;
} }
...@@ -1237,7 +1237,7 @@ static void tscAllDataRetrievedFromDnode(SRetrieveSupport *trsupport, SSqlObj* p ...@@ -1237,7 +1237,7 @@ static void tscAllDataRetrievedFromDnode(SRetrieveSupport *trsupport, SSqlObj* p
SQueryInfo *pQueryInfo = tscGetQueryInfoDetail(&pSql->cmd, 0); SQueryInfo *pQueryInfo = tscGetQueryInfoDetail(&pSql->cmd, 0);
// data in from current vnode is stored in cache and disk // data in from current vnode is stored in cache and disk
uint32_t numOfRowsFromSubquery = trsupport->pExtMemBuffer[idx]->numOfTotalElems + trsupport->localBuffer->numOfElems; // uint32_t numOfRowsFromSubquery = trsupport->pExtMemBuffer[idx]->numOfTotalElems + trsupport->localBuffer->numOfElems;
// tscTrace("%p sub:%p all data retrieved from ip:%u,vid:%d, numOfRows:%d, orderOfSub:%d", pPObj, pSql, pSvd->ip, // tscTrace("%p sub:%p all data retrieved from ip:%u,vid:%d, numOfRows:%d, orderOfSub:%d", pPObj, pSql, pSvd->ip,
// pSvd->vnode, numOfRowsFromSubquery, idx); // pSvd->vnode, numOfRowsFromSubquery, idx);
...@@ -1333,7 +1333,7 @@ static void tscRetrieveFromDnodeCallBack(void *param, TAOS_RES *tres, int numOfR ...@@ -1333,7 +1333,7 @@ static void tscRetrieveFromDnodeCallBack(void *param, TAOS_RES *tres, int numOfR
SSqlRes * pRes = &pSql->res; SSqlRes * pRes = &pSql->res;
SQueryInfo *pQueryInfo = tscGetQueryInfoDetail(&pSql->cmd, 0); SQueryInfo *pQueryInfo = tscGetQueryInfoDetail(&pSql->cmd, 0);
STableMetaInfo *pTableMetaInfo = tscGetMetaInfo(pQueryInfo, 0); // STableMetaInfo *pTableMetaInfo = tscGetMetaInfo(pQueryInfo, 0);
// SVnodeSidList *vnodeInfo = tscGetVnodeSidList(pTableMetaInfo->pMetricMeta, idx); // SVnodeSidList *vnodeInfo = tscGetVnodeSidList(pTableMetaInfo->pMetricMeta, idx);
// SVnodeSidList *vnodeInfo = 0; // SVnodeSidList *vnodeInfo = 0;
...@@ -1409,10 +1409,10 @@ void tscRetrieveDataRes(void *param, TAOS_RES *tres, int code) { ...@@ -1409,10 +1409,10 @@ void tscRetrieveDataRes(void *param, TAOS_RES *tres, int code) {
SSqlObj* pParentSql = trsupport->pParentSqlObj; SSqlObj* pParentSql = trsupport->pParentSqlObj;
SSqlObj* pSql = (SSqlObj *)tres; SSqlObj* pSql = (SSqlObj *)tres;
STableMetaInfo *pTableMetaInfo = tscGetTableMetaInfoFromCmd(&pSql->cmd, 0, 0); // STableMetaInfo *pTableMetaInfo = tscGetTableMetaInfoFromCmd(&pSql->cmd, 0, 0);
assert(pSql->cmd.numOfClause == 1 && pSql->cmd.pQueryInfo[0]->numOfTables == 1); assert(pSql->cmd.numOfClause == 1 && pSql->cmd.pQueryInfo[0]->numOfTables == 1);
int32_t idx = pTableMetaInfo->vnodeIndex; // int32_t idx = pTableMetaInfo->vnodeIndex;
SVnodeSidList *vnodeInfo = NULL; SVnodeSidList *vnodeInfo = NULL;
SVnodeDesc * pSvd = NULL; SVnodeDesc * pSvd = NULL;
...@@ -1459,7 +1459,7 @@ void tscRetrieveDataRes(void *param, TAOS_RES *tres, int code) { ...@@ -1459,7 +1459,7 @@ void tscRetrieveDataRes(void *param, TAOS_RES *tres, int code) {
pState->code = -TSDB_CODE_CLI_OUT_OF_MEMORY; pState->code = -TSDB_CODE_CLI_OUT_OF_MEMORY;
trsupport->numOfRetry = MAX_NUM_OF_SUBQUERY_RETRY; trsupport->numOfRetry = MAX_NUM_OF_SUBQUERY_RETRY;
} else { } else {
SQueryInfo *pNewQueryInfo = tscGetQueryInfoDetail(&pNew->cmd, 0); // SQueryInfo *pNewQueryInfo = tscGetQueryInfoDetail(&pNew->cmd, 0);
// assert(pNewQueryInfo->pTableMetaInfo[0]->pTableMeta != NULL && pNewQueryInfo->pTableMetaInfo[0]->pMetricMeta != NULL); // assert(pNewQueryInfo->pTableMetaInfo[0]->pTableMeta != NULL && pNewQueryInfo->pTableMetaInfo[0]->pMetricMeta != NULL);
tscProcessSql(pNew); tscProcessSql(pNew);
return; return;
......
...@@ -993,20 +993,6 @@ void tscFieldInfoCalOffset(SQueryInfo* pQueryInfo) { ...@@ -993,20 +993,6 @@ void tscFieldInfoCalOffset(SQueryInfo* pQueryInfo) {
} }
void tscFieldInfoUpdateOffsetForInterResult(SQueryInfo* pQueryInfo) { void tscFieldInfoUpdateOffsetForInterResult(SQueryInfo* pQueryInfo) {
// SFieldInfo* pFieldInfo = &pQueryInfo->fieldsInfo;
// if (pFieldInfo->numOfOutputCols == 0) {
// return;
// }
//
// pFieldInfo->pOffset[0] = 0;
//
// /*
// * the retTypeLen is used to store the intermediate result length
// * for potential secondary merge exists
// */
// for (int32_t i = 1; i < pFieldInfo->numOfOutputCols; ++i) {
// pFieldInfo->pOffset[i] = pFieldInfo->pOffset[i - 1] + tscSqlExprGet(pQueryInfo, i - 1)->resBytes;
// }
SSqlExprInfo* pExprInfo = &pQueryInfo->exprsInfo; SSqlExprInfo* pExprInfo = &pQueryInfo->exprsInfo;
if (pExprInfo->numOfExprs == 0) { if (pExprInfo->numOfExprs == 0) {
return; return;
......
...@@ -19,7 +19,7 @@ typedef struct SColumnInfoEx { ...@@ -19,7 +19,7 @@ typedef struct SColumnInfoEx {
void* pData; // the corresponding block data in memory void* pData; // the corresponding block data in memory
} SColumnInfoEx; } SColumnInfoEx;
int32_t extractTableName(const char *tableId, char *name); void extractTableName(const char *tableId, char *name);
char* extractDBName(const char *tableId, char *name); char* extractDBName(const char *tableId, char *name);
......
...@@ -24,11 +24,11 @@ static FORCE_INLINE size_t copy(char* dst, const char* src, char delimiter) { ...@@ -24,11 +24,11 @@ static FORCE_INLINE size_t copy(char* dst, const char* src, char delimiter) {
return len; return len;
} }
int32_t extractTableName(const char* tableId, char* name) { void extractTableName(const char* tableId, char* name) {
size_t offset = strcspn(tableId, &TS_PATH_DELIMITER[0]); size_t offset = strcspn(tableId, &TS_PATH_DELIMITER[0]);
offset = strcspn(&tableId[offset], &TS_PATH_DELIMITER[0]); offset = strcspn(&tableId[offset], &TS_PATH_DELIMITER[0]);
return strncpy(name, &tableId[offset], TSDB_TABLE_NAME_LEN); strncpy(name, &tableId[offset], TSDB_TABLE_NAME_LEN);
// char* r = skipSegments(tableId, TS_PATH_DELIMITER[0], 2); // char* r = skipSegments(tableId, TS_PATH_DELIMITER[0], 2);
// return copy(name, r, TS_PATH_DELIMITER[0]); // return copy(name, r, TS_PATH_DELIMITER[0]);
......
...@@ -2011,9 +2011,8 @@ static int32_t mgmtRetrieveShowTables(SShowObj *pShow, char *data, int32_t rows, ...@@ -2011,9 +2011,8 @@ static int32_t mgmtRetrieveShowTables(SShowObj *pShow, char *data, int32_t rows,
} }
char tableName[TSDB_TABLE_NAME_LEN] = {0}; char tableName[TSDB_TABLE_NAME_LEN] = {0};
memset(tableName, 0, tListLen(tableName));
// pattern compare for meter name // pattern compare for table name
mgmtExtractTableName(pTable->info.tableId, tableName); mgmtExtractTableName(pTable->info.tableId, tableName);
if (pShow->payloadLen > 0 && if (pShow->payloadLen > 0 &&
......
...@@ -36,4 +36,6 @@ bool isWindowResClosed(SWindowResInfo *pWindowResInfo, int32_t slot); ...@@ -36,4 +36,6 @@ bool isWindowResClosed(SWindowResInfo *pWindowResInfo, int32_t slot);
void createQueryResultInfo(SQuery *pQuery, SWindowResult *pResultRow, bool isSTableQuery, SPosInfo *posInfo); void createQueryResultInfo(SQuery *pQuery, SWindowResult *pResultRow, bool isSTableQuery, SPosInfo *posInfo);
char *getPosInResultPage(SQueryRuntimeEnv *pRuntimeEnv, int32_t columnIndex, SWindowResult *pResult);
#endif // TDENGINE_QUERYUTIL_H #endif // TDENGINE_QUERYUTIL_H
...@@ -901,173 +901,3 @@ void setDefaultCreateDbOption(SCreateDBInfo *pDBInfo) { ...@@ -901,173 +901,3 @@ void setDefaultCreateDbOption(SCreateDBInfo *pDBInfo) {
memset(&pDBInfo->precision, 0, sizeof(SSQLToken)); memset(&pDBInfo->precision, 0, sizeof(SSQLToken));
} }
static bool isExprLeafNode(tSQLExpr* pExpr) {
return (pExpr->pRight == NULL && pExpr->pLeft == NULL) &&
(pExpr->nSQLOptr == TK_ID || (pExpr->nSQLOptr >= TK_BOOL && pExpr->nSQLOptr <= TK_NCHAR) ||
pExpr->nSQLOptr == TK_SET);
}
static bool isExprParentOfLeafNode(tSQLExpr* pExpr) {
return (pExpr->pLeft != NULL && pExpr->pRight != NULL) &&
(isExprLeafNode(pExpr->pLeft) && isExprLeafNode(pExpr->pRight));
}
static int32_t tSQLExprNodeToString(tSQLExpr* pExpr, SStringBuilder* pBuilder) {
if (pExpr->nSQLOptr == TK_ID) { // column name
// strncpy(*str, pExpr->colInfo.z, pExpr->colInfo.n);
// *str += pExpr->colInfo.n;
} else if (pExpr->nSQLOptr >= TK_BOOL && pExpr->nSQLOptr <= TK_STRING) { // value
// *str += tVariantToString(&pExpr->val, *str);
// taosStringBuilderAppendStringLen()
} else if (pExpr->nSQLOptr >= TK_COUNT && pExpr->nSQLOptr <= TK_AVG_IRATE) {
taosStringBuilderAppendStringLen(pBuilder, pExpr->operand.z, pExpr->operand.n);
} else { // not supported operation
assert(false);
}
return TSDB_CODE_SUCCESS;
}
static int32_t optrToString(tSQLExpr* pExpr, char** exprString) {
const char* le = "<=";
const char* ge = ">=";
const char* ne = "<>";
const char* likeOptr = "LIKE";
switch (pExpr->nSQLOptr) {
case TK_LE: {
*(int16_t*)(*exprString) = *(int16_t*)le;
*exprString += 1;
break;
}
case TK_GE: {
*(int16_t*)(*exprString) = *(int16_t*)ge;
*exprString += 1;
break;
}
case TK_NE: {
*(int16_t*)(*exprString) = *(int16_t*)ne;
*exprString += 1;
break;
}
case TK_LT:
*(*exprString) = '<';
break;
case TK_GT:
*(*exprString) = '>';
break;
case TK_EQ:
*(*exprString) = '=';
break;
case TK_PLUS:
*(*exprString) = '+';
break;
case TK_MINUS:
*(*exprString) = '-';
break;
case TK_STAR:
*(*exprString) = '*';
break;
case TK_DIVIDE:
*(*exprString) = '/';
break;
case TK_REM:
*(*exprString) = '%';
break;
case TK_LIKE: {
int32_t len = sprintf(*exprString, " %s ", likeOptr);
*exprString += (len - 1);
break;
}
default:
return TSDB_CODE_INVALID_SQL;
}
*exprString += 1;
return TSDB_CODE_SUCCESS;
}
static int32_t tSQLExprLeafToBinary(tSQLExpr* pExpr, SStringBuilder* pBuilder) {
if (!isExprParentOfLeafNode(pExpr)) {
return TSDB_CODE_INVALID_SQL;
}
tSQLExpr* pLeft = pExpr->pLeft;
tSQLExpr* pRight = pExpr->pRight;
// if (addParentheses) {
// *(*output) = '(';
// *output += 1;
// }
tSQLExprNodeToString(pLeft, pBuilder);
tSQLExprNodeToString(pRight, pBuilder);
if (optrToString(pExpr, pBuilder) != TSDB_CODE_SUCCESS) {
return TSDB_CODE_INVALID_SQL;
}
// if (addParentheses) {
// *(*output) = ')';
// *output += 1;
// }
return TSDB_CODE_SUCCESS;
}
static void relToString(tSQLExpr* pExpr, SStringBuilder* pBuilder) {
assert(pExpr->nSQLOptr == TK_AND || pExpr->nSQLOptr == TK_OR);
const char* or = "OR";
const char*and = "AND";
// if (pQueryInfo->tagCond.relType == TSQL_STABLE_QTYPE_COND) {
// if (pExpr->nSQLOptr == TK_AND) {
// strcpy(*str, and);
// *str += strlen(and);
// } else {
// strcpy(*str, or);
// *str += strlen(or);
// }
}
static int32_t doSQLExprToBinary(tSQLExpr* pExpr, SStringBuilder* pBuilder) {
if (pExpr == NULL) {
return TSDB_CODE_SUCCESS;
}
if (!isExprParentOfLeafNode(pExpr)) {
// *(*str) = '(';
// *str += 1;
int32_t ret = doSQLExprToBinary(pExpr->pLeft, pBuilder);
if (ret != TSDB_CODE_SUCCESS) {
return ret;
}
ret = doSQLExprToBinary(pExpr->pRight, pBuilder);
if (ret != TSDB_CODE_SUCCESS) {
return ret;
}
relToString(pExpr, pBuilder);
// *(*str) = ')';
// *str += 1;
return ret;
}
return tSQLExprLeafToBinary(pExpr, pBuilder);
}
// post order seralize to binary data
int32_t tSQLExprToBinary(tSQLExpr* pExpr, SStringBuilder* pBuilder) {
assert(pExpr != NULL && pBuilder != NULL);
}
\ No newline at end of file
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
#define SET_SUPPLEMENT_SCAN_FLAG(runtime) ((runtime)->scanFlag = SUPPLEMENTARY_SCAN) #define SET_SUPPLEMENT_SCAN_FLAG(runtime) ((runtime)->scanFlag = SUPPLEMENTARY_SCAN)
#define SET_MASTER_SCAN_FLAG(runtime) ((runtime)->scanFlag = MASTER_SCAN) #define SET_MASTER_SCAN_FLAG(runtime) ((runtime)->scanFlag = MASTER_SCAN)
#define GET_QINFO_ADDR(x) ((char *)(x)-offsetof(SQInfo, runtimeEnv)) #define GET_QINFO_ADDR(x) ((void*)((char *)(x)-offsetof(SQInfo, runtimeEnv)))
#define GET_COL_DATA_POS(query, index, step) ((query)->pos + (index) * (step)) #define GET_COL_DATA_POS(query, index, step) ((query)->pos + (index) * (step))
...@@ -1140,13 +1140,13 @@ static int32_t rowwiseApplyAllFunctions(SQueryRuntimeEnv *pRuntimeEnv, SDataStat ...@@ -1140,13 +1140,13 @@ static int32_t rowwiseApplyAllFunctions(SQueryRuntimeEnv *pRuntimeEnv, SDataStat
bool hasNull = hasNullValue(pQuery, k, pDataBlockInfo, pStatis, &pColStatis); bool hasNull = hasNullValue(pQuery, k, pDataBlockInfo, pStatis, &pColStatis);
char *dataBlock = getDataBlocks(pRuntimeEnv, &sasArray[k], k, pDataBlockInfo->size, pDataBlock); char *dataBlock = getDataBlocks(pRuntimeEnv, &sasArray[k], k, pDataBlockInfo->size, pDataBlock);
setExecParams(pQuery, &pCtx[k], dataBlock, (char *)primaryKeyCol, pDataBlockInfo->size, functionId, pColStatis, setExecParams(pQuery, &pCtx[k], dataBlock, primaryKeyCol, pDataBlockInfo->size, functionId, pColStatis,
hasNull, &sasArray[k], pRuntimeEnv->scanFlag); hasNull, &sasArray[k], pRuntimeEnv->scanFlag);
} }
// set the input column data // set the input column data
for (int32_t k = 0; k < pQuery->numOfFilterCols; ++k) { for (int32_t k = 0; k < pQuery->numOfFilterCols; ++k) {
SSingleColumnFilterInfo *pFilterInfo = &pQuery->pFilterInfo[k]; // SSingleColumnFilterInfo *pFilterInfo = &pQuery->pFilterInfo[k];
assert(0); assert(0);
/* /*
* NOTE: here the tbname/tags column cannot reach here, since it will never be a filter column, * NOTE: here the tbname/tags column cannot reach here, since it will never be a filter column,
...@@ -1465,7 +1465,7 @@ static int32_t setupQueryRuntimeEnv(SQueryRuntimeEnv *pRuntimeEnv, SColumnModel ...@@ -1465,7 +1465,7 @@ static int32_t setupQueryRuntimeEnv(SQueryRuntimeEnv *pRuntimeEnv, SColumnModel
pRuntimeEnv->offset[0] = 0; pRuntimeEnv->offset[0] = 0;
for (int32_t i = 0; i < pQuery->numOfOutputCols; ++i) { for (int32_t i = 0; i < pQuery->numOfOutputCols; ++i) {
SSqlFuncExprMsg *pSqlFuncMsg = &pQuery->pSelectExpr[i].pBase; SSqlFuncExprMsg *pSqlFuncMsg = &pQuery->pSelectExpr[i].pBase;
SColIndexEx * pColIndexEx = &pSqlFuncMsg->colInfo; // SColIndexEx * pColIndexEx = &pSqlFuncMsg->colInfo;
SQLFunctionCtx *pCtx = &pRuntimeEnv->pCtx[i]; SQLFunctionCtx *pCtx = &pRuntimeEnv->pCtx[i];
pCtx->inputType = GET_COLUMN_TYPE(pQuery, i); pCtx->inputType = GET_COLUMN_TYPE(pQuery, i);
...@@ -1586,7 +1586,7 @@ static bool isQueryKilled(SQInfo *pQInfo) { ...@@ -1586,7 +1586,7 @@ static bool isQueryKilled(SQInfo *pQInfo) {
#endif #endif
} }
static bool setQueryKilled(SQInfo* pQInfo) { static void setQueryKilled(SQInfo* pQInfo) {
pQInfo->code = TSDB_CODE_QUERY_CANCELLED; pQInfo->code = TSDB_CODE_QUERY_CANCELLED;
} }
...@@ -1738,6 +1738,7 @@ static UNUSED_FUNC bool doGetQueryPos(TSKEY key, SQInfo *pQInfo, SPointInterpoSu ...@@ -1738,6 +1738,7 @@ static UNUSED_FUNC bool doGetQueryPos(TSKEY key, SQInfo *pQInfo, SPointInterpoSu
} }
} }
#endif #endif
return true;
} }
static UNUSED_FUNC bool doSetDataInfo(SQInfo *pQInfo, SPointInterpoSupporter *pPointInterpSupporter, void *pMeterObj, static UNUSED_FUNC bool doSetDataInfo(SQInfo *pQInfo, SPointInterpoSupporter *pPointInterpSupporter, void *pMeterObj,
...@@ -2924,11 +2925,11 @@ int32_t tableResultComparFn(const void *pLeft, const void *pRight, void *param) ...@@ -2924,11 +2925,11 @@ int32_t tableResultComparFn(const void *pLeft, const void *pRight, void *param)
} }
int32_t mergeResultsToGroup(SQInfo *pQInfo) { int32_t mergeResultsToGroup(SQInfo *pQInfo) {
SQueryRuntimeEnv *pRuntimeEnv = &pQInfo->runtimeEnv; // SQueryRuntimeEnv *pRuntimeEnv = &pQInfo->runtimeEnv;
SQuery * pQuery = pRuntimeEnv->pQuery; // SQuery * pQuery = pRuntimeEnv->pQuery;
int64_t st = taosGetTimestampMs(); // int64_t st = taosGetTimestampMs();
int32_t ret = TSDB_CODE_SUCCESS; // int32_t ret = TSDB_CODE_SUCCESS;
// while (pQInfo->subgroupIdx < pQInfo->pSidSet->numOfSubSet) { // while (pQInfo->subgroupIdx < pQInfo->pSidSet->numOfSubSet) {
// int32_t start = pQInfo->pSidSet->starterPos[pQInfo->subgroupIdx]; // int32_t start = pQInfo->pSidSet->starterPos[pQInfo->subgroupIdx];
...@@ -2994,7 +2995,7 @@ void copyResToQueryResultBuf(SQInfo *pQInfo, SQuery *pQuery) { ...@@ -2994,7 +2995,7 @@ void copyResToQueryResultBuf(SQInfo *pQInfo, SQuery *pQuery) {
for (int32_t i = 0; i < pQuery->numOfOutputCols; ++i) { for (int32_t i = 0; i < pQuery->numOfOutputCols; ++i) {
int32_t bytes = pRuntimeEnv->pCtx[i].outputBytes; int32_t bytes = pRuntimeEnv->pCtx[i].outputBytes;
char * pDest = pQuery->sdata[i]; char * pDest = pQuery->sdata[i]->data;
memcpy(pDest + offset * bytes, pData->data + pRuntimeEnv->offset[i] * pData->numOfElems, memcpy(pDest + offset * bytes, pData->data + pRuntimeEnv->offset[i] * pData->numOfElems,
bytes * pData->numOfElems); bytes * pData->numOfElems);
...@@ -3033,7 +3034,7 @@ int64_t getNumOfResultWindowRes(SQueryRuntimeEnv *pRuntimeEnv, SWindowResult *pW ...@@ -3033,7 +3034,7 @@ int64_t getNumOfResultWindowRes(SQueryRuntimeEnv *pRuntimeEnv, SWindowResult *pW
return maxOutput; return maxOutput;
} }
int32_t doMergeMetersResultsToGroupRes(SQInfo *pQInfo, STableDataInfo *pTableDataInfo, int32_t start, int32_t end) { UNUSED_FUNC int32_t doMergeMetersResultsToGroupRes(SQInfo *pQInfo, STableDataInfo *pTableDataInfo, int32_t start, int32_t end) {
SQueryRuntimeEnv *pRuntimeEnv = &pQInfo->runtimeEnv; SQueryRuntimeEnv *pRuntimeEnv = &pQInfo->runtimeEnv;
SQuery * pQuery = pQInfo->runtimeEnv.pQuery; SQuery * pQuery = pQInfo->runtimeEnv.pQuery;
...@@ -3204,7 +3205,7 @@ int32_t flushFromResultBuf(SQInfo *pQInfo) { ...@@ -3204,7 +3205,7 @@ int32_t flushFromResultBuf(SQInfo *pQInfo) {
void resetMergeResultBuf(SQuery *pQuery, SQLFunctionCtx *pCtx, SResultInfo *pResultInfo) { void resetMergeResultBuf(SQuery *pQuery, SQLFunctionCtx *pCtx, SResultInfo *pResultInfo) {
for (int32_t k = 0; k < pQuery->numOfOutputCols; ++k) { for (int32_t k = 0; k < pQuery->numOfOutputCols; ++k) {
pCtx[k].aOutputBuf = pQuery->sdata[k] - pCtx[k].outputBytes; pCtx[k].aOutputBuf = pQuery->sdata[k]->data - pCtx[k].outputBytes;
pCtx[k].size = 1; pCtx[k].size = 1;
pCtx[k].startOffset = 0; pCtx[k].startOffset = 0;
pCtx[k].resultInfo = &pResultInfo[k]; pCtx[k].resultInfo = &pResultInfo[k];
...@@ -3561,7 +3562,7 @@ void scanAllDataBlocks(SQueryRuntimeEnv *pRuntimeEnv) { ...@@ -3561,7 +3562,7 @@ void scanAllDataBlocks(SQueryRuntimeEnv *pRuntimeEnv) {
} }
// set the correct start position, and load the corresponding block in buffer for next round scan all data blocks. // set the correct start position, and load the corresponding block in buffer for next round scan all data blocks.
int32_t ret = tsdbDataBlockSeek(pRuntimeEnv->pQueryHandle, pos); /*int32_t ret =*/ tsdbDataBlockSeek(pRuntimeEnv->pQueryHandle, pos);
status = pQuery->status; status = pQuery->status;
pRuntimeEnv->windowResInfo.curIndex = activeSlot; pRuntimeEnv->windowResInfo.curIndex = activeSlot;
...@@ -3582,7 +3583,7 @@ void scanAllDataBlocks(SQueryRuntimeEnv *pRuntimeEnv) { ...@@ -3582,7 +3583,7 @@ void scanAllDataBlocks(SQueryRuntimeEnv *pRuntimeEnv) {
pQuery->window.skey = skey; pQuery->window.skey = skey;
pQuery->window.ekey = pQuery->lastKey - step; pQuery->window.ekey = pQuery->lastKey - step;
tsdbpos_t current = tsdbDataBlockTell(pRuntimeEnv->pQueryHandle); /*tsdbpos_t current =*/ tsdbDataBlockTell(pRuntimeEnv->pQueryHandle);
doSingleMeterSupplementScan(pRuntimeEnv); doSingleMeterSupplementScan(pRuntimeEnv);
...@@ -3591,7 +3592,7 @@ void scanAllDataBlocks(SQueryRuntimeEnv *pRuntimeEnv) { ...@@ -3591,7 +3592,7 @@ void scanAllDataBlocks(SQueryRuntimeEnv *pRuntimeEnv) {
pQuery->lastKey = lkey; pQuery->lastKey = lkey;
pQuery->window.ekey = ekey; pQuery->window.ekey = ekey;
STimeWindow win = {.skey = pQuery->window.skey, .ekey = pQuery->window.ekey}; // STimeWindow win = {.skey = pQuery->window.skey, .ekey = pQuery->window.ekey};
// tsdbResetQuery(pRuntimeEnv->pQueryHandle, &win, current, pQuery->order.order); // tsdbResetQuery(pRuntimeEnv->pQueryHandle, &win, current, pQuery->order.order);
// tsdbNextDataBlock(pRuntimeEnv->pQueryHandle); // tsdbNextDataBlock(pRuntimeEnv->pQueryHandle);
} }
...@@ -4020,7 +4021,7 @@ bool vnodeHasRemainResults(void *handle) { ...@@ -4020,7 +4021,7 @@ bool vnodeHasRemainResults(void *handle) {
// query has completed // query has completed
if (Q_STATUS_EQUAL(pQuery->status, QUERY_COMPLETED)) { if (Q_STATUS_EQUAL(pQuery->status, QUERY_COMPLETED)) {
TSKEY ekey = taosGetRevisedEndKey(pQuery->window.ekey, pQuery->order.order, pQuery->intervalTime, /*TSKEY ekey =*/ taosGetRevisedEndKey(pQuery->window.ekey, pQuery->order.order, pQuery->intervalTime,
pQuery->slidingTimeUnit, pQuery->precision); pQuery->slidingTimeUnit, pQuery->precision);
// int32_t numOfTotal = taosGetNumOfResultWithInterpo(pInterpoInfo, (TSKEY // int32_t numOfTotal = taosGetNumOfResultWithInterpo(pInterpoInfo, (TSKEY
// *)pRuntimeEnv->pInterpoBuf[0]->data, // *)pRuntimeEnv->pInterpoBuf[0]->data,
...@@ -4088,8 +4089,8 @@ static void doCopyQueryResultToMsg(SQInfo *pQInfo, int32_t numOfRows, char *data ...@@ -4088,8 +4089,8 @@ static void doCopyQueryResultToMsg(SQInfo *pQInfo, int32_t numOfRows, char *data
int32_t vnodeQueryResultInterpolate(SQInfo *pQInfo, tFilePage **pDst, tFilePage **pDataSrc, int32_t numOfRows, int32_t vnodeQueryResultInterpolate(SQInfo *pQInfo, tFilePage **pDst, tFilePage **pDataSrc, int32_t numOfRows,
int32_t *numOfInterpo) { int32_t *numOfInterpo) {
SQueryRuntimeEnv *pRuntimeEnv = &pQInfo->runtimeEnv; // SQueryRuntimeEnv *pRuntimeEnv = &pQInfo->runtimeEnv;
SQuery * pQuery = pRuntimeEnv->pQuery; // SQuery * pQuery = pRuntimeEnv->pQuery;
#if 0 #if 0
while (1) { while (1) {
numOfRows = taosNumOfRemainPoints(&pRuntimeEnv->interpoInfo); numOfRows = taosNumOfRemainPoints(&pRuntimeEnv->interpoInfo);
...@@ -4390,8 +4391,8 @@ static int64_t queryOnDataBlocks(SQInfo *pQInfo) { ...@@ -4390,8 +4391,8 @@ static int64_t queryOnDataBlocks(SQInfo *pQInfo) {
static bool multimeterMultioutputHelper(SQInfo *pQInfo, bool *dataInDisk, bool *dataInCache, int32_t index, static bool multimeterMultioutputHelper(SQInfo *pQInfo, bool *dataInDisk, bool *dataInCache, int32_t index,
int32_t start) { int32_t start) {
// STableIdInfo **pMeterSidExtInfo = pQInfo->pMeterSidExtInfo; // STableIdInfo **pMeterSidExtInfo = pQInfo->pMeterSidExtInfo;
SQueryRuntimeEnv *pRuntimeEnv = &pQInfo->runtimeEnv; // SQueryRuntimeEnv *pRuntimeEnv = &pQInfo->runtimeEnv;
SQuery * pQuery = &pRuntimeEnv->pQuery; // SQuery * pQuery = pRuntimeEnv->pQuery;
#if 0 #if 0
setQueryStatus(pQuery, QUERY_NOT_COMPLETED); setQueryStatus(pQuery, QUERY_NOT_COMPLETED);
...@@ -4438,7 +4439,7 @@ static bool multimeterMultioutputHelper(SQInfo *pQInfo, bool *dataInDisk, bool * ...@@ -4438,7 +4439,7 @@ static bool multimeterMultioutputHelper(SQInfo *pQInfo, bool *dataInDisk, bool *
#endif #endif
initCtxOutputBuf(pRuntimeEnv); // initCtxOutputBuf(pRuntimeEnv);
return true; return true;
} }
...@@ -5457,8 +5458,8 @@ static int32_t convertQueryMsg(SQueryTableMsg *pQueryMsg, SArray **pTableIdList, ...@@ -5457,8 +5458,8 @@ static int32_t convertQueryMsg(SQueryTableMsg *pQueryMsg, SArray **pTableIdList,
} }
static int32_t buildAirthmeticExprFromMsg(SSqlFunctionExpr *pExpr, SQueryTableMsg *pQueryMsg) { static int32_t buildAirthmeticExprFromMsg(SSqlFunctionExpr *pExpr, SQueryTableMsg *pQueryMsg) {
SSqlBinaryExprInfo *pBinaryExprInfo = &pExpr->binExprInfo; // SSqlBinaryExprInfo *pBinaryExprInfo = &pExpr->binExprInfo;
SColumnInfo * pColMsg = pQueryMsg->colList; // SColumnInfo * pColMsg = pQueryMsg->colList;
#if 0 #if 0
tExprNode* pBinExpr = NULL; tExprNode* pBinExpr = NULL;
SSchema* pSchema = toSchema(pQueryMsg, pColMsg, pQueryMsg->numOfCols); SSchema* pSchema = toSchema(pQueryMsg, pColMsg, pQueryMsg->numOfCols);
...@@ -5874,7 +5875,7 @@ static bool isValidQInfo(void *param) { ...@@ -5874,7 +5875,7 @@ static bool isValidQInfo(void *param) {
* pQInfo->signature may be changed by another thread, so we assign value of signature * pQInfo->signature may be changed by another thread, so we assign value of signature
* into local variable, then compare by using local variable * into local variable, then compare by using local variable
*/ */
uint64_t sig = pQInfo->signature; uint64_t sig = (uint64_t) pQInfo->signature;
return (sig == (uint64_t)pQInfo); return (sig == (uint64_t)pQInfo);
} }
......
...@@ -1100,6 +1100,10 @@ static void rpcProcessConnError(void *param, void *id) { ...@@ -1100,6 +1100,10 @@ static void rpcProcessConnError(void *param, void *id) {
SRpcInfo *pRpc = pContext->pRpc; SRpcInfo *pRpc = pContext->pRpc;
SRpcMsg rpcMsg; SRpcMsg rpcMsg;
if (pRpc == NULL) {
return;
}
tTrace("%s connection error happens", pRpc->label); tTrace("%s connection error happens", pRpc->label);
if ( pContext->numOfTry >= pContext->ipSet.numOfIps ) { if ( pContext->numOfTry >= pContext->ipSet.numOfIps ) {
......
...@@ -645,7 +645,7 @@ void * taosbsearch(const void *key, const void *base, size_t nmemb, size_t size, ...@@ -645,7 +645,7 @@ void * taosbsearch(const void *key, const void *base, size_t nmemb, size_t size,
} }
} }
if ((*compar)(key, elePtrAt(base, size, idx) < 0)) { if ((*compar)(key, elePtrAt(base, size, idx)) < 0) {
return elePtrAt(base, size, idx); return elePtrAt(base, size, idx);
} else { } else {
if (idx + 1 > nmemb - 1) { if (idx + 1 > nmemb - 1) {
......
...@@ -301,6 +301,7 @@ tsdb_query_handle_t *tsdbQueryByTableId(tsdb_repo_t* tsdb, STsdbQueryCond *pCond ...@@ -301,6 +301,7 @@ tsdb_query_handle_t *tsdbQueryByTableId(tsdb_repo_t* tsdb, STsdbQueryCond *pCond
.pCompInfo = calloc(1, 1024), .pCompInfo = calloc(1, 1024),
}; };
assert(info.pTableObj != NULL);
taosArrayPush(pQueryHandle->pTableCheckInfo, &info); taosArrayPush(pQueryHandle->pTableCheckInfo, &info);
} }
...@@ -1008,17 +1009,21 @@ SArray *tsdbRetrieveDataBlock(tsdb_query_handle_t *pQueryHandle, SArray *pIdList ...@@ -1008,17 +1009,21 @@ SArray *tsdbRetrieveDataBlock(tsdb_query_handle_t *pQueryHandle, SArray *pIdList
} }
} }
int32_t tsdbResetQuery(tsdb_query_handle_t *pQueryHandle, STimeWindow *window, tsdbpos_t position, int16_t order) {} int32_t tsdbResetQuery(tsdb_query_handle_t *pQueryHandle, STimeWindow *window, tsdbpos_t position, int16_t order) {
return 0;
}
int32_t tsdbDataBlockSeek(tsdb_query_handle_t *pQueryHandle, tsdbpos_t pos) {} int32_t tsdbDataBlockSeek(tsdb_query_handle_t *pQueryHandle, tsdbpos_t pos) { return 0;}
tsdbpos_t tsdbDataBlockTell(tsdb_query_handle_t *pQueryHandle) { return NULL; } tsdbpos_t tsdbDataBlockTell(tsdb_query_handle_t *pQueryHandle) { return NULL; }
SArray *tsdbRetrieveDataRow(tsdb_query_handle_t *pQueryHandle, SArray *pIdList, SQueryRowCond *pCond) {} SArray *tsdbRetrieveDataRow(tsdb_query_handle_t *pQueryHandle, SArray *pIdList, SQueryRowCond *pCond) { return NULL;}
tsdb_query_handle_t *tsdbQueryFromTagConds(STsdbQueryCond *pCond, int16_t stableId, const char *pTagFilterStr) {} tsdb_query_handle_t *tsdbQueryFromTagConds(STsdbQueryCond *pCond, int16_t stableId, const char *pTagFilterStr) {
return NULL;
}
SArray *tsdbGetTableList(tsdb_query_handle_t *pQueryHandle) {} SArray *tsdbGetTableList(tsdb_query_handle_t *pQueryHandle) { return NULL; }
static SArray* createTableIdArrayList(STsdbRepo* tsdb, int64_t uid) { static SArray* createTableIdArrayList(STsdbRepo* tsdb, int64_t uid) {
STable* pTable = tsdbGetTableByUid(tsdbGetMeta(tsdb), uid); STable* pTable = tsdbGetTableByUid(tsdbGetMeta(tsdb), uid);
...@@ -1303,7 +1308,7 @@ static int32_t doQueryTableList(STable* pSTable, SArray* pRes, const char* pCond ...@@ -1303,7 +1308,7 @@ static int32_t doQueryTableList(STable* pSTable, SArray* pRes, const char* pCond
STColumn* stcol = schemaColAt(pSTable->tagSchema, 0); STColumn* stcol = schemaColAt(pSTable->tagSchema, 0);
tExprNode* pExpr = NULL; tExprNode* pExpr = NULL;
tSQLBinaryExprFromString(&pExpr, stcol, schemaNCols(pSTable->tagSchema), pCond, strlen(pCond)); tSQLBinaryExprFromString(&pExpr, stcol, schemaNCols(pSTable->tagSchema), (char*) pCond, strlen(pCond));
// failed to build expression, no result, return immediately // failed to build expression, no result, return immediately
if (pExpr == NULL) { if (pExpr == NULL) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册