Merge pull request #1121 from taosdata/hotfix/slguan

#1120 TBASE-1154
This commit is contained in:
haojun Liao 2020-01-11 16:55:48 +08:00 committed by GitHub
commit 6b945b9267
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 4 deletions

View File

@ -79,7 +79,9 @@ void gcStopQueryJson(HttpContext *pContext, HttpSqlCmd *cmd) {
if (jsonBuf == NULL) return;
// write end of target
if (cmd->numOfRows != 0) {
gcWriteTargetEndJson(jsonBuf);
}
}
bool gcBuildQueryJson(HttpContext *pContext, HttpSqlCmd *cmd, TAOS_RES *result, int numOfRows) {
@ -116,8 +118,8 @@ bool gcBuildQueryJson(HttpContext *pContext, HttpSqlCmd *cmd, TAOS_RES *result,
if (groupFields == -1 && cmd->numOfRows == 0) {
gcWriteTargetStartJson(jsonBuf, refIdBuffer, aliasBuffer);
cmd->numOfRows += numOfRows;
}
cmd->numOfRows += numOfRows;
for (int i = 0; i < numOfRows; ++i) {
TAOS_ROW row = taos_fetch_row(result);
@ -158,7 +160,7 @@ bool gcBuildQueryJson(HttpContext *pContext, HttpSqlCmd *cmd, TAOS_RES *result,
}
break;
default:
snprintf(target, HTTP_GC_TARGET_SIZE, "%s%s", aliasBuffer, "invalidcol");
snprintf(target, HTTP_GC_TARGET_SIZE, "%s%s", aliasBuffer, "-");
break;
}
@ -217,7 +219,7 @@ bool gcBuildQueryJson(HttpContext *pContext, HttpSqlCmd *cmd, TAOS_RES *result,
}
break;
default:
httpJsonString(jsonBuf, "invalidcol", 10);
httpJsonString(jsonBuf, "-", 1);
break;
}
}