From 9784eb618d030b95cd0490ba7d27e21a543fac7e Mon Sep 17 00:00:00 2001 From: xywang Date: Tue, 15 Jun 2021 19:49:51 +0800 Subject: [PATCH] [TD-4721]: NULL column in a row was specially processed --- src/plugins/http/src/httpGcJson.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/plugins/http/src/httpGcJson.c b/src/plugins/http/src/httpGcJson.c index 8c223a1500..397791706d 100644 --- a/src/plugins/http/src/httpGcJson.c +++ b/src/plugins/http/src/httpGcJson.c @@ -133,6 +133,16 @@ bool gcBuildQueryJson(HttpContext *pContext, HttpSqlCmd *cmd, TAOS_RES *result, int32_t len; len = snprintf(target, HTTP_GC_TARGET_SIZE, "%s{", aliasBuffer); for (int32_t i = dataFields + 1; i < num_fields; i++) { + if (row[i] == NULL) { + len += snprintf(target + len, HTTP_GC_TARGET_SIZE - len, "%s:nil", fields[i].name); + + if (i < num_fields - 1) { + len += snprintf(target + len, HTTP_GC_TARGET_SIZE - len, ", "); + } + + continue; + } + switch (fields[i].type) { case TSDB_DATA_TYPE_BOOL: case TSDB_DATA_TYPE_TINYINT: -- GitLab