From 1445c34196d5c04d0bdd035e42073659a54700eb Mon Sep 17 00:00:00 2001 From: liu0x54 Date: Sat, 9 May 2020 02:05:25 +0000 Subject: [PATCH] [TD-228] fix rest API to support binary interface change --- src/plugins/http/src/restJson.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/http/src/restJson.c b/src/plugins/http/src/restJson.c index 9277d7d045..2d9c31935c 100644 --- a/src/plugins/http/src/restJson.c +++ b/src/plugins/http/src/restJson.c @@ -94,6 +94,7 @@ bool restBuildSqlJson(HttpContext *pContext, HttpSqlCmd *cmd, TAOS_RES *result, for (int k = 0; k < numOfRows; ++k) { TAOS_ROW row = taos_fetch_row(result); + int32_t* length = taos_fetch_lengths(result); // data row array begin httpJsonItemToken(jsonBuf); @@ -129,7 +130,7 @@ bool restBuildSqlJson(HttpContext *pContext, HttpSqlCmd *cmd, TAOS_RES *result, break; case TSDB_DATA_TYPE_BINARY: case TSDB_DATA_TYPE_NCHAR: - httpJsonStringForTransMean(jsonBuf, row[i], fields[i].bytes); + httpJsonStringForTransMean(jsonBuf, row[i], length[i]); break; case TSDB_DATA_TYPE_TIMESTAMP: if (timestampFormat == REST_TIMESTAMP_FMT_LOCAL_STRING) { -- GitLab