[td-4231]fix bug by regression test.
This commit is contained in:
parent
61ea20334f
commit
6488456b86
|
@ -7291,11 +7291,15 @@ int32_t doValidateSqlNode(SSqlObj* pSql, SQuerySqlNode* pQuerySqlNode, int32_t i
|
||||||
}
|
}
|
||||||
|
|
||||||
if(tscQueryTags(pQueryInfo)) {
|
if(tscQueryTags(pQueryInfo)) {
|
||||||
int32_t numOfCols = (int32_t) taosArrayGetSize(pQueryInfo->colList);
|
SSqlExpr* pExpr1 = tscSqlExprGet(pQueryInfo, 0);
|
||||||
for(int32_t i = 0; i < numOfCols; ++i) {
|
|
||||||
SColumn* pCols = taosArrayGetP(pQueryInfo->colList, i);
|
if (pExpr1->functionId != TSDB_FUNC_TID_TAG) {
|
||||||
if (pCols->numOfFilters > 0) {
|
int32_t numOfCols = (int32_t)taosArrayGetSize(pQueryInfo->colList);
|
||||||
return invalidSqlErrMsg(tscGetErrorMsgPayload(pCmd), msg9);
|
for (int32_t i = 0; i < numOfCols; ++i) {
|
||||||
|
SColumn* pCols = taosArrayGetP(pQueryInfo->colList, i);
|
||||||
|
if (pCols->numOfFilters > 0) {
|
||||||
|
return invalidSqlErrMsg(tscGetErrorMsgPayload(pCmd), msg9);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -215,7 +215,7 @@ static void tscProcessSubscriptionTimer(void *handle, void *tmrId) {
|
||||||
taosTmrReset(tscProcessSubscriptionTimer, pSub->interval, pSub, tscTmr, &pSub->pTimer);
|
taosTmrReset(tscProcessSubscriptionTimer, pSub->interval, pSub, tscTmr, &pSub->pTimer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//TODO refactor: extract table list name not simply from the sql
|
||||||
static SArray* getTableList( SSqlObj* pSql ) {
|
static SArray* getTableList( SSqlObj* pSql ) {
|
||||||
const char* p = strstr( pSql->sqlstr, " from " );
|
const char* p = strstr( pSql->sqlstr, " from " );
|
||||||
assert(p != NULL); // we are sure this is a 'select' statement
|
assert(p != NULL); // we are sure this is a 'select' statement
|
||||||
|
@ -224,11 +224,11 @@ static SArray* getTableList( SSqlObj* pSql ) {
|
||||||
|
|
||||||
SSqlObj* pNew = taos_query(pSql->pTscObj, sql);
|
SSqlObj* pNew = taos_query(pSql->pTscObj, sql);
|
||||||
if (pNew == NULL) {
|
if (pNew == NULL) {
|
||||||
tscError("0x%"PRIx64"failed to retrieve table id: cannot create new sql object.", pSql->self);
|
tscError("0x%"PRIx64" failed to retrieve table id: cannot create new sql object.", pSql->self);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
} else if (taos_errno(pNew) != TSDB_CODE_SUCCESS) {
|
} else if (taos_errno(pNew) != TSDB_CODE_SUCCESS) {
|
||||||
tscError("0x%"PRIx64"failed to retrieve table id,error: %s", pSql->self, tstrerror(taos_errno(pNew)));
|
tscError("0x%"PRIx64" failed to retrieve table id,error: %s", pSql->self, tstrerror(taos_errno(pNew)));
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue