From 8c05d36082850d830135c85555bfc160b0a22735 Mon Sep 17 00:00:00 2001 From: slguan Date: Mon, 13 Jan 2020 19:03:01 +0800 Subject: [PATCH 1/2] for async test --- src/modules/http/src/restHandle.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/modules/http/src/restHandle.c b/src/modules/http/src/restHandle.c index 58509e693d..a307700866 100644 --- a/src/modules/http/src/restHandle.c +++ b/src/modules/http/src/restHandle.c @@ -67,10 +67,16 @@ bool restProcessSqlRequest(HttpContext* pContext, int timestampFmt) { return false; } + + /* + * for async test + * / + /* if (httpCheckUsedbSql(sql)) { httpSendErrorResp(pContext, HTTP_NO_EXEC_USEDB); return false; } + */ HttpSqlCmd* cmd = &(pContext->singleCmd); cmd->nativSql = sql; From 981d7c5e0231f4025ad5b3e73e9b65dd6ab39b00 Mon Sep 17 00:00:00 2001 From: slguan Date: Tue, 14 Jan 2020 10:36:50 +0800 Subject: [PATCH 2/2] #1130 TBASE-1484 --- src/modules/http/src/httpJson.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/modules/http/src/httpJson.c b/src/modules/http/src/httpJson.c index 2bb768e801..ca88de59e6 100644 --- a/src/modules/http/src/httpJson.c +++ b/src/modules/http/src/httpJson.c @@ -310,7 +310,9 @@ void httpJsonInt(JsonBuf* buf, int num) { void httpJsonFloat(JsonBuf* buf, float num) { httpJsonItemToken(buf); httpJsonTestBuf(buf, MAX_NUM_STR_SZ); - if (num > 1E10 || num < -1E10) { + if (isinf(num) || isnan(num)) { + buf->lst += snprintf(buf->lst, MAX_NUM_STR_SZ, "null"); + } else if (num > 1E10 || num < -1E10) { buf->lst += snprintf(buf->lst, MAX_NUM_STR_SZ, "%.5e", num); } else { buf->lst += snprintf(buf->lst, MAX_NUM_STR_SZ, "%.5f", num); @@ -320,7 +322,9 @@ void httpJsonFloat(JsonBuf* buf, float num) { void httpJsonDouble(JsonBuf* buf, double num) { httpJsonItemToken(buf); httpJsonTestBuf(buf, MAX_NUM_STR_SZ); - if (num > 1E10 || num < -1E10) { + if (isinf(num) || isnan(num)) { + buf->lst += snprintf(buf->lst, MAX_NUM_STR_SZ, "null"); + } else if (num > 1E10 || num < -1E10) { buf->lst += snprintf(buf->lst, MAX_NUM_STR_SZ, "%.9e", num); } else { buf->lst += snprintf(buf->lst, MAX_NUM_STR_SZ, "%.9f", num);