commit
13ed8e1000
|
@ -310,7 +310,9 @@ void httpJsonInt(JsonBuf* buf, int num) {
|
||||||
void httpJsonFloat(JsonBuf* buf, float num) {
|
void httpJsonFloat(JsonBuf* buf, float num) {
|
||||||
httpJsonItemToken(buf);
|
httpJsonItemToken(buf);
|
||||||
httpJsonTestBuf(buf, MAX_NUM_STR_SZ);
|
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);
|
buf->lst += snprintf(buf->lst, MAX_NUM_STR_SZ, "%.5e", num);
|
||||||
} else {
|
} else {
|
||||||
buf->lst += snprintf(buf->lst, MAX_NUM_STR_SZ, "%.5f", num);
|
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) {
|
void httpJsonDouble(JsonBuf* buf, double num) {
|
||||||
httpJsonItemToken(buf);
|
httpJsonItemToken(buf);
|
||||||
httpJsonTestBuf(buf, MAX_NUM_STR_SZ);
|
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);
|
buf->lst += snprintf(buf->lst, MAX_NUM_STR_SZ, "%.9e", num);
|
||||||
} else {
|
} else {
|
||||||
buf->lst += snprintf(buf->lst, MAX_NUM_STR_SZ, "%.9f", num);
|
buf->lst += snprintf(buf->lst, MAX_NUM_STR_SZ, "%.9f", num);
|
||||||
|
|
|
@ -67,10 +67,16 @@ bool restProcessSqlRequest(HttpContext* pContext, int timestampFmt) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* for async test
|
||||||
|
* /
|
||||||
|
/*
|
||||||
if (httpCheckUsedbSql(sql)) {
|
if (httpCheckUsedbSql(sql)) {
|
||||||
httpSendErrorResp(pContext, HTTP_NO_EXEC_USEDB);
|
httpSendErrorResp(pContext, HTTP_NO_EXEC_USEDB);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
HttpSqlCmd* cmd = &(pContext->singleCmd);
|
HttpSqlCmd* cmd = &(pContext->singleCmd);
|
||||||
cmd->nativSql = sql;
|
cmd->nativSql = sql;
|
||||||
|
|
Loading…
Reference in New Issue