提交 4000b0e9 编写于 作者: S slguan

#1120 TBASE-1154

上级 97c6bebf
...@@ -79,7 +79,9 @@ void gcStopQueryJson(HttpContext *pContext, HttpSqlCmd *cmd) { ...@@ -79,7 +79,9 @@ void gcStopQueryJson(HttpContext *pContext, HttpSqlCmd *cmd) {
if (jsonBuf == NULL) return; if (jsonBuf == NULL) return;
// write end of target // write end of target
gcWriteTargetEndJson(jsonBuf); if (cmd->numOfRows != 0) {
gcWriteTargetEndJson(jsonBuf);
}
} }
bool gcBuildQueryJson(HttpContext *pContext, HttpSqlCmd *cmd, TAOS_RES *result, int numOfRows) { bool gcBuildQueryJson(HttpContext *pContext, HttpSqlCmd *cmd, TAOS_RES *result, int numOfRows) {
...@@ -116,8 +118,8 @@ bool gcBuildQueryJson(HttpContext *pContext, HttpSqlCmd *cmd, TAOS_RES *result, ...@@ -116,8 +118,8 @@ bool gcBuildQueryJson(HttpContext *pContext, HttpSqlCmd *cmd, TAOS_RES *result,
if (groupFields == -1 && cmd->numOfRows == 0) { if (groupFields == -1 && cmd->numOfRows == 0) {
gcWriteTargetStartJson(jsonBuf, refIdBuffer, aliasBuffer); gcWriteTargetStartJson(jsonBuf, refIdBuffer, aliasBuffer);
cmd->numOfRows += numOfRows;
} }
cmd->numOfRows += numOfRows;
for (int i = 0; i < numOfRows; ++i) { for (int i = 0; i < numOfRows; ++i) {
TAOS_ROW row = taos_fetch_row(result); TAOS_ROW row = taos_fetch_row(result);
...@@ -158,7 +160,7 @@ bool gcBuildQueryJson(HttpContext *pContext, HttpSqlCmd *cmd, TAOS_RES *result, ...@@ -158,7 +160,7 @@ bool gcBuildQueryJson(HttpContext *pContext, HttpSqlCmd *cmd, TAOS_RES *result,
} }
break; break;
default: default:
snprintf(target, HTTP_GC_TARGET_SIZE, "%s%s", aliasBuffer, "invalidcol"); snprintf(target, HTTP_GC_TARGET_SIZE, "%s%s", aliasBuffer, "-");
break; break;
} }
...@@ -217,7 +219,7 @@ bool gcBuildQueryJson(HttpContext *pContext, HttpSqlCmd *cmd, TAOS_RES *result, ...@@ -217,7 +219,7 @@ bool gcBuildQueryJson(HttpContext *pContext, HttpSqlCmd *cmd, TAOS_RES *result,
} }
break; break;
default: default:
httpJsonString(jsonBuf, "invalidcol", 10); httpJsonString(jsonBuf, "-", 1);
break; break;
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册