Merge pull request #866 from taosdata/feature/fangstatic
correct static warning
This commit is contained in:
commit
571f0a708b
|
@ -108,12 +108,12 @@ static tSQLSyntaxNode *tSQLSyntaxNodeCreate(SSchema *pSchema, int32_t numOfCols,
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t i = 0;
|
|
||||||
size_t nodeSize = sizeof(tSQLSyntaxNode);
|
size_t nodeSize = sizeof(tSQLSyntaxNode);
|
||||||
tSQLSyntaxNode *pNode = NULL;
|
tSQLSyntaxNode *pNode = NULL;
|
||||||
|
|
||||||
if (pToken->type == TK_ID || pToken->type == TK_TBNAME) {
|
if (pToken->type == TK_ID || pToken->type == TK_TBNAME) {
|
||||||
if (pToken->type == TK_ID) {
|
if (pToken->type == TK_ID) {
|
||||||
|
int32_t i = 0;
|
||||||
do {
|
do {
|
||||||
size_t len = strlen(pSchema[i].name);
|
size_t len = strlen(pSchema[i].name);
|
||||||
if (strncmp(pToken->z, pSchema[i].name, pToken->n) == 0 && pToken->n == len) break;
|
if (strncmp(pToken->z, pSchema[i].name, pToken->n) == 0 && pToken->n == len) break;
|
||||||
|
@ -269,7 +269,7 @@ static tSQLSyntaxNode *createSyntaxTree(SSchema *pSchema, int32_t numOfCols, cha
|
||||||
|
|
||||||
// get the operator of expr
|
// get the operator of expr
|
||||||
uint8_t optr = getBinaryExprOptr(&t0);
|
uint8_t optr = getBinaryExprOptr(&t0);
|
||||||
if (optr <= 0) {
|
if (optr == 0) {
|
||||||
pError("not support binary operator:%d", t0.type);
|
pError("not support binary operator:%d", t0.type);
|
||||||
tSQLSyntaxNodeDestroy(pLeft, NULL);
|
tSQLSyntaxNodeDestroy(pLeft, NULL);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -324,9 +324,10 @@ static tSQLSyntaxNode *createSyntaxTree(SSchema *pSchema, int32_t numOfCols, cha
|
||||||
return pn;
|
return pn;
|
||||||
} else {
|
} else {
|
||||||
uint8_t localOptr = getBinaryExprOptr(&t0);
|
uint8_t localOptr = getBinaryExprOptr(&t0);
|
||||||
if (localOptr <= 0) {
|
if (localOptr == 0) {
|
||||||
pError("not support binary operator:%d", t0.type);
|
pError("not support binary operator:%d", t0.type);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
free(pBinExpr)
|
||||||
}
|
}
|
||||||
|
|
||||||
return parseRemainStr(str, pBinExpr, pSchema, localOptr, numOfCols, i);
|
return parseRemainStr(str, pBinExpr, pSchema, localOptr, numOfCols, i);
|
||||||
|
@ -418,6 +419,7 @@ void tSQLBinaryExprToString(tSQLBinaryExpr *pExpr, char *dst, int32_t *len) {
|
||||||
if (pExpr == NULL) {
|
if (pExpr == NULL) {
|
||||||
*dst = 0;
|
*dst = 0;
|
||||||
*len = 0;
|
*len = 0;
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t lhs = tSQLBinaryExprToStringImpl(pExpr->pLeft, dst, pExpr->pLeft->nodeType);
|
int32_t lhs = tSQLBinaryExprToStringImpl(pExpr->pLeft, dst, pExpr->pLeft->nodeType);
|
||||||
|
@ -650,7 +652,8 @@ void tSQLListTraverseOnResult(struct tSQLBinaryExpr *pExpr, bool (*fp)(tSkipList
|
||||||
// brutal force search
|
// brutal force search
|
||||||
int64_t num = pResult->num;
|
int64_t num = pResult->num;
|
||||||
for (int32_t i = 0, j = 0; i < pResult->num; ++i) {
|
for (int32_t i = 0, j = 0; i < pResult->num; ++i) {
|
||||||
if (fp == NULL || (fp != NULL && fp(pResult->pRes[i], pExpr->info) == true)) {
|
//if (fp == NULL || (fp != NULL && fp(pResult->pRes[i], pExpr->info) == true)) {
|
||||||
|
if (fp == NULL || (fp(pResult->pRes[i], pExpr->info) == true)) {
|
||||||
pResult->pRes[j++] = pResult->pRes[i];
|
pResult->pRes[j++] = pResult->pRes[i];
|
||||||
} else {
|
} else {
|
||||||
num--;
|
num--;
|
||||||
|
|
|
@ -157,7 +157,6 @@ static void tscProcessAsyncRetrieveImpl(void *param, TAOS_RES *tres, int numOfRo
|
||||||
SSqlObj *pSql = (SSqlObj *)tres;
|
SSqlObj *pSql = (SSqlObj *)tres;
|
||||||
if (pSql == NULL) { // error
|
if (pSql == NULL) { // error
|
||||||
tscError("sql object is NULL");
|
tscError("sql object is NULL");
|
||||||
tscQueueAsyncError(pSql->fetchFp, param);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue