未验证 提交 905e2820 编写于 作者: S slguan 提交者: GitHub

Merge pull request #1727 from taosdata/feature/web

Feature/web
......@@ -33,4 +33,5 @@ Target/
*.failed
*.sql
sim/
*DS_Store
......@@ -233,7 +233,7 @@ static int32_t mgmtCheckDbCfg(SDbCfg *pCfg) {
return TSDB_CODE_INVALID_OPTION;
}
if (pCfg->precision != TSDB_MIN_PRECISION && pCfg->precision != TSDB_MAX_PRECISION) {
if (pCfg->precision < TSDB_MIN_PRECISION && pCfg->precision > TSDB_MAX_PRECISION) {
mError("invalid db option timePrecision:%d valid value: [%d, %d]", pCfg->precision, TSDB_MIN_PRECISION,
TSDB_MAX_PRECISION);
return TSDB_CODE_INVALID_OPTION;
......
......@@ -199,7 +199,7 @@ void httpSendTaosdInvalidSqlErrorResp(HttpContext *pContext, char* errMsg) {
} else {}
}
httpSendErrorRespImp(pContext, httpCode, "Bad Request", TSDB_CODE_INVALID_SQL, temp);
httpSendErrorRespImp(pContext, httpCode, "Bad Request", 1000, temp);
}
void httpSendSuccResp(HttpContext *pContext, char *desc) {
......
......@@ -239,7 +239,7 @@ void httpProcessSingleSqlCallBack(void *param, TAOS_RES *result, int code) {
if (code < 0) {
SSqlObj *pObj = (SSqlObj *)result;
if (code == TSDB_CODE_INVALID_SQL) {
httpError("context:%p, fd:%d, ip:%s, user:%s, query error, taos:%p, code:%s:invalidsql, sqlObj:%p, error:%s",
httpError("context:%p, fd:%d, ip:%s, user:%s, query error, taos:%p, code:%s, sqlObj:%p, error:%s",
pContext, pContext->fd, pContext->ipstr, pContext->user, pContext->session->taos, tstrerror(code), pObj, pObj->cmd.payload);
httpSendTaosdInvalidSqlErrorResp(pContext, pObj->cmd.payload);
} else {
......
......@@ -83,19 +83,19 @@ print =============== step2 - no db
#11
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d 'show databases' 192.168.0.1:6020/rest/sql
print 11-> $system_content
if $system_content != @{"status":"succ","head":["name","created time","ntables","vgroups","replica","days","keep1,keep2,keep(D)","tables","rows","cache(b)","ablocks","tblocks","ctime(s)","clog","comp","time precision","status"],"data":[],"rows":0}@ then
if $system_content != @{"status":"succ","head":["name","create time","ntables","vgroups","replica","days","keep1,keep2,keep(D)","tables","cache(MB)","blocks","minrows","maxrows","ctime(s)","clog","comp","precision","status"],"data":[],"rows":0}@ then
return -1
endi
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d 'create database d1' 192.168.0.1:6020/rest/sql
print 12-> $system_content
if $system_content != @{"status":"succ","head":["affected_rows"],"data":[[1]],"rows":1}@ then
if $system_content != @{"status":"succ","head":["affected_rows"],"data":[[0]],"rows":0}@ then
return -1
endi
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d 'create database d1' 192.168.0.1:6020/rest/sql
print 13-> $system_content
if $system_content != @{"status":"error","code":33,"desc":"DB already there"}@ then
if $system_content != @{"status":"error","code":1000,"desc":"DB already there"}@ then
return -1
endi
......@@ -121,14 +121,14 @@ endi
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d ' used1' 192.168.0.1:6020/rest/sql
print 17-> $system_content
if $system_content != @{"status":"error","code":28,"desc":"invalid SQL: invalid SQL: syntax error near 'used1'"}@ then
if $system_content != @{"status":"error","code":1000,"desc":"invalid SQL: invalid SQL: syntax error near 'used1'"}@ then
return -1
endi
#18
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d ' show tables;' 192.168.0.1:6020/rest/sql
print 18-> $system_content
if $system_content != @{"status":"error","code":38,"desc":"DB not selected"}@ then
if $system_content != @{"status":"error","code":1000,"desc":"db not selected"}@ then
return -1
endi
......@@ -137,7 +137,7 @@ print =============== step3 - db
#19
#system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d ' show tables;' 192.168.0.1:6020/rest/sql/d4
#print 19-> $system_content
#if $system_content != @{"status":"error","code":102,"desc":"invalid DB"}@ then
#if $system_content != @{"status":"error","code":1000,"desc":"invalid DB"}@ then
# return -1
#endi
......@@ -149,13 +149,13 @@ print =============== step3 - db
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d ' select * from d1.t1;' 192.168.0.1:6020/rest/sql
print 21-> $system_content
if $system_content != @{"status":"error","code":32,"desc":"invalid table"}@ then
if $system_content != @{"status":"error","code":1000,"desc":"invalid table name"}@ then
return -1
endi
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d ' create table d1.t1 (ts timestamp, speed int)' 192.168.0.1:6020/rest/sql
print 22-> $system_content
if $system_content != @{"status":"succ","head":["affected_rows"],"data":[[1]],"rows":1}@ then
if $system_content != @{"status":"succ","head":["affected_rows"],"data":[[0]],"rows":0}@ then
return -1
endi
......@@ -209,13 +209,13 @@ endi
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d 'create database d2' 192.168.0.1:6020/rest/sql
print 28-> $system_content
if $system_content != @{"status":"succ","head":["affected_rows"],"data":[[1]],"rows":1}@ then
if $system_content != @{"status":"succ","head":["affected_rows"],"data":[[0]],"rows":0}@ then
return -1
endi
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d ' create table d2.t1 (ts timestamp, speed int)' 192.168.0.1:6020/rest/sql
print 29-> $system_content
if $system_content != @{"status":"succ","head":["affected_rows"],"data":[[1]],"rows":1}@ then
if $system_content != @{"status":"succ","head":["affected_rows"],"data":[[0]],"rows":0}@ then
return -1
endi
......
......@@ -106,7 +106,7 @@ if $system_content != @{"status":"error","code":1029,"desc":"metric name length
return -1
endi
system_content curl -u root:taosdata -d '{"fields":{"Percent_DPC_Time":0,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":"a1234567890123456789012345678901234a1234567890123456789012345678901234a1234567890123456789012345678901234","tags":{"host":"windows","instance":"1","objectname":"Processor"},"timestamp":1535784122}' 127.0.0.1:6020/telegraf/db/root/taosdata1
system_content curl -u root:taosdata -d '{"fields":{"Percent_DPC_Time":0,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":"a1234567890123456789012345678901234a1234567890123456789012345678901234a1234567890123456789012345678901234a1234567890123456789012345678901234a1234567890123456789012345678901234a1234567890123456789012345678901234a1234567890123456789012345678901234a1234567890123456789012345678901234a1234567890123456789012345678901234a1234567890123456789012345678901234a1234567890123456789012345678901234a1234567890123456789012345678901234","tags":{"host":"windows","instance":"1","objectname":"Processor"},"timestamp":1535784122}' 127.0.0.1:6020/telegraf/db/root/taosdata1
print $system_content
if $system_content != @{"status":"error","code":1030,"desc":"metric name length too long"}@ then
......@@ -204,7 +204,7 @@ if $system_content != @{"status":"error","code":1042,"desc":"table is null"}@ th
return -1
endi
system_content curl -u root:taosdata -d '{"fields":{"Percent_DPC_Time":0,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":"win_cpu","tags":{"host":"host111111111111222222222222222222222host111111111111222222222222222222222"},"timestamp":1535784122}' 127.0.0.1:6020/telegraf/db/root/taosdata1
system_content curl -u root:taosdata -d '{"fields":{"Percent_DPC_Time":0,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":"win_cpu","tags":{"host":"host111111111111222222222222222222222host111111111111222222222222222222222host111111111111222222222222222222222host111111111111222222222222222222222host111111111111222222222222222222222host111111111111222222222222222222222host111111111111222222222222222222222host111111111111222222222222222222222"},"timestamp":1535784122}' 127.0.0.1:6020/telegraf/db/root/taosdata1
print $system_content
if $system_content != @{"status":"error","code":1043,"desc":"table name length too long"}@ then
......
......@@ -3,6 +3,6 @@ run general/http/restful_insert.sim
#run general/http/restful_limit.sim
#run general/http/restful_full.sim
#run general/http/prepare.sim
run general/http/telegraf.sim
run general/http/grafana_bug.sim
run general/http/grafana.sim
#run general/http/telegraf.sim
#run general/http/grafana_bug.sim
#run general/http/grafana.sim
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册