Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Rattenking
TDengine
提交
58c603d1
T
TDengine
项目概览
Rattenking
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
58c603d1
编写于
4月 24, 2020
作者:
S
slguan
提交者:
GitHub
4月 24, 2020
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #1710 from taosdata/feature/alter
Feature/alter
上级
ecad71a1
f410f009
变更
27
隐藏空白更改
内联
并排
Showing
27 changed file
with
172 addition
and
178 deletion
+172
-178
src/client/src/TSDBJNIConnector.c
src/client/src/TSDBJNIConnector.c
+3
-3
src/client/src/tscSystem.c
src/client/src/tscSystem.c
+1
-9
src/inc/taoserror.h
src/inc/taoserror.h
+55
-55
src/mnode/src/mgmtShell.c
src/mnode/src/mgmtShell.c
+1
-1
src/mnode/src/mgmtTable.c
src/mnode/src/mgmtTable.c
+2
-2
src/plugins/http/src/gcHandle.c
src/plugins/http/src/gcHandle.c
+4
-2
src/plugins/http/src/gcJson.c
src/plugins/http/src/gcJson.c
+2
-4
src/plugins/http/src/httpAuth.c
src/plugins/http/src/httpAuth.c
+3
-1
src/plugins/http/src/httpCode.c
src/plugins/http/src/httpCode.c
+3
-0
src/plugins/http/src/httpHandle.c
src/plugins/http/src/httpHandle.c
+7
-10
src/plugins/http/src/httpJson.c
src/plugins/http/src/httpJson.c
+5
-10
src/plugins/http/src/httpResp.c
src/plugins/http/src/httpResp.c
+8
-9
src/plugins/http/src/httpServer.c
src/plugins/http/src/httpServer.c
+1
-0
src/plugins/http/src/httpSession.c
src/plugins/http/src/httpSession.c
+7
-9
src/plugins/http/src/httpSql.c
src/plugins/http/src/httpSql.c
+31
-30
src/plugins/http/src/httpSystem.c
src/plugins/http/src/httpSystem.c
+5
-5
src/plugins/http/src/httpUtil.c
src/plugins/http/src/httpUtil.c
+4
-3
src/plugins/http/src/restHandle.c
src/plugins/http/src/restHandle.c
+3
-1
src/plugins/http/src/restJson.c
src/plugins/http/src/restJson.c
+1
-0
src/plugins/http/src/tgHandle.c
src/plugins/http/src/tgHandle.c
+4
-3
src/plugins/http/src/tgJson.c
src/plugins/http/src/tgJson.c
+10
-9
tests/script/general/http/restful.sim
tests/script/general/http/restful.sim
+2
-2
tests/script/general/http/restful_full.sim
tests/script/general/http/restful_full.sim
+5
-5
tests/script/general/http/testSuite.sim
tests/script/general/http/testSuite.sim
+1
-2
tests/script/sh/deploy.sh
tests/script/sh/deploy.sh
+2
-2
tests/script/unique/http/opentsdb.sim
tests/script/unique/http/opentsdb.sim
+0
-0
tests/script/unique/http/testSuite.sim
tests/script/unique/http/testSuite.sim
+2
-1
未找到文件。
src/client/src/TSDBJNIConnector.c
浏览文件 @
58c603d1
...
...
@@ -281,7 +281,7 @@ JNIEXPORT jint JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_executeQueryImp(J
int
code
=
taos_query
(
tscon
,
dst
);
if
(
code
!=
0
)
{
jniError
(
"jobj:%p, conn:%p, code:%
d, msg:%s"
,
jobj
,
tscon
,
code
,
taos_errstr
(
tscon
));
jniError
(
"jobj:%p, conn:%p, code:%
s, msg:%s"
,
jobj
,
tscon
,
tstrerror
(
code
)
,
taos_errstr
(
tscon
));
free
(
dst
);
return
JNI_TDENGINE_ERROR
;
}
else
{
...
...
@@ -290,9 +290,9 @@ JNIEXPORT jint JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_executeQueryImp(J
if
(
pSql
->
cmd
.
command
==
TSDB_SQL_INSERT
)
{
affectRows
=
taos_affected_rows
(
tscon
);
jniTrace
(
"jobj:%p, conn:%p, code:%
d, affect rows:%d"
,
jobj
,
tscon
,
code
,
affectRows
);
jniTrace
(
"jobj:%p, conn:%p, code:%
s, affect rows:%d"
,
jobj
,
tscon
,
tstrerror
(
code
)
,
affectRows
);
}
else
{
jniTrace
(
"jobj:%p, conn:%p, code:%
d"
,
jobj
,
tscon
,
code
);
jniTrace
(
"jobj:%p, conn:%p, code:%
s"
,
jobj
,
tscon
,
tstrerror
(
code
)
);
}
free
(
dst
);
...
...
src/client/src/tscSystem.c
浏览文件 @
58c603d1
...
...
@@ -42,7 +42,6 @@ void * tscTmr;
void
*
tscQhandle
;
void
*
tscCheckDiskUsageTmr
;
int
tsInsertHeadSize
;
char
tsLastUser
[
TSDB_USER_LEN
+
1
];
int
tscNumOfThreads
;
...
...
@@ -81,13 +80,6 @@ int32_t tscInitRpc(const char *user, const char *secret) {
}
}
// not stop service, switch users
if
(
strcmp
(
tsLastUser
,
user
)
!=
0
&&
pTscMgmtConn
!=
NULL
)
{
tscTrace
(
"switch user from %s to %s"
,
user
,
tsLastUser
);
rpcClose
(
pTscMgmtConn
);
pTscMgmtConn
=
NULL
;
}
if
(
pTscMgmtConn
==
NULL
)
{
memset
(
&
rpcInit
,
0
,
sizeof
(
rpcInit
));
rpcInit
.
localIp
=
tsLocalIp
;
...
...
@@ -101,8 +93,8 @@ int32_t tscInitRpc(const char *user, const char *secret) {
rpcInit
.
idleTime
=
2000
;
rpcInit
.
user
=
(
char
*
)
user
;
rpcInit
.
ckey
=
"key"
;
rpcInit
.
spi
=
1
;
rpcInit
.
secret
=
secretEncrypt
;
strcpy
(
tsLastUser
,
user
);
pTscMgmtConn
=
rpcOpen
(
&
rpcInit
);
if
(
pTscMgmtConn
==
NULL
)
{
...
...
src/inc/taoserror.h
浏览文件 @
58c603d1
...
...
@@ -99,71 +99,71 @@ TAOS_DEFINE_ERROR(TSDB_CODE_NOT_ACTIVE_TABLE, 0, 205, "not active tabl
TAOS_DEFINE_ERROR
(
TSDB_CODE_TABLE_ID_MISMATCH
,
0
,
206
,
"table id mismatch"
)
// dnode & mnode
TAOS_DEFINE_ERROR
(
TSDB_CODE_NO_ENOUGH_DNODES
,
0
,
30
0
,
"no enough dnodes"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_DNODE_ALREADY_EXIST
,
0
,
30
1
,
"dnode already exist"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_DNODE_NOT_EXIST
,
0
,
30
2
,
"dnode not exist"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_NO_MASTER
,
0
,
30
3
,
"no master"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_NO_REMOVE_MASTER
,
0
,
30
4
,
"no remove master"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_INVALID_QUERY_ID
,
0
,
30
5
,
"invalid query id"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_INVALID_STREAM_ID
,
0
,
30
6
,
"invalid stream id"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_INVALID_CONNECTION
,
0
,
30
7
,
"invalid connection"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_SDB_ERROR
,
0
,
30
8
,
"sdb error"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_NO_ENOUGH_DNODES
,
0
,
25
0
,
"no enough dnodes"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_DNODE_ALREADY_EXIST
,
0
,
25
1
,
"dnode already exist"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_DNODE_NOT_EXIST
,
0
,
25
2
,
"dnode not exist"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_NO_MASTER
,
0
,
25
3
,
"no master"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_NO_REMOVE_MASTER
,
0
,
25
4
,
"no remove master"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_INVALID_QUERY_ID
,
0
,
25
5
,
"invalid query id"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_INVALID_STREAM_ID
,
0
,
25
6
,
"invalid stream id"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_INVALID_CONNECTION
,
0
,
25
7
,
"invalid connection"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_SDB_ERROR
,
0
,
25
8
,
"sdb error"
)
// acct
TAOS_DEFINE_ERROR
(
TSDB_CODE_ACCT_ALREADY_EXIST
,
0
,
4
00
,
"accounts already exist"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_INVALID_ACCT
,
0
,
4
01
,
"invalid account"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_INVALID_ACCT_PARAMETER
,
0
,
4
02
,
"invalid account parameter"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_TOO_MANY_ACCTS
,
0
,
4
03
,
"too many accounts"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_TOO_MANY_USERS
,
0
,
4
04
,
"too many users"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_TOO_MANY_TABLES
,
0
,
4
05
,
"too many tables"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_TOO_MANY_DATABASES
,
0
,
4
06
,
"too many databases"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_TOO_MANY_TIME_SERIES
,
0
,
4
07
,
"not enough time series"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_ACCT_ALREADY_EXIST
,
0
,
3
00
,
"accounts already exist"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_INVALID_ACCT
,
0
,
3
01
,
"invalid account"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_INVALID_ACCT_PARAMETER
,
0
,
3
02
,
"invalid account parameter"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_TOO_MANY_ACCTS
,
0
,
3
03
,
"too many accounts"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_TOO_MANY_USERS
,
0
,
3
04
,
"too many users"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_TOO_MANY_TABLES
,
0
,
3
05
,
"too many tables"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_TOO_MANY_DATABASES
,
0
,
3
06
,
"too many databases"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_TOO_MANY_TIME_SERIES
,
0
,
3
07
,
"not enough time series"
)
// grant
TAOS_DEFINE_ERROR
(
TSDB_CODE_AUTH_FAILURE
,
0
,
40
0
,
"auth failure"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_NO_RIGHTS
,
0
,
40
1
,
"no rights"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_NO_WRITE_ACCESS
,
0
,
40
2
,
"no write access"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_NO_READ_ACCESS
,
0
,
40
3
,
"no read access"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_GRANT_EXPIRED
,
0
,
40
4
,
"grant expired"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_GRANT_DNODE_LIMITED
,
0
,
40
5
,
"grant dnode limited"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_GRANT_ACCT_LIMITED
,
0
,
40
6
,
"grant account limited"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_GRANT_TIMESERIES_LIMITED
,
0
,
40
7
,
"grant timeseries limited"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_GRANT_DB_LIMITED
,
0
,
40
8
,
"grant db limited"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_GRANT_USER_LIMITED
,
0
,
40
9
,
"grant user limited"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_GRANT_CONN_LIMITED
,
0
,
41
0
,
"grant conn limited"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_GRANT_STREAM_LIMITED
,
0
,
41
1
,
"grant stream limited"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_GRANT_SPEED_LIMITED
,
0
,
41
2
,
"grant speed limited"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_GRANT_STORAGE_LIMITED
,
0
,
41
3
,
"grant storage limited"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_GRANT_QUERYTIME_LIMITED
,
0
,
41
4
,
"grant query time limited"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_GRANT_CPU_LIMITED
,
0
,
41
5
,
"grant cpu limited"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_AUTH_FAILURE
,
0
,
35
0
,
"auth failure"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_NO_RIGHTS
,
0
,
35
1
,
"no rights"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_NO_WRITE_ACCESS
,
0
,
35
2
,
"no write access"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_NO_READ_ACCESS
,
0
,
35
3
,
"no read access"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_GRANT_EXPIRED
,
0
,
35
4
,
"grant expired"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_GRANT_DNODE_LIMITED
,
0
,
35
5
,
"grant dnode limited"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_GRANT_ACCT_LIMITED
,
0
,
35
6
,
"grant account limited"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_GRANT_TIMESERIES_LIMITED
,
0
,
35
7
,
"grant timeseries limited"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_GRANT_DB_LIMITED
,
0
,
35
8
,
"grant db limited"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_GRANT_USER_LIMITED
,
0
,
35
9
,
"grant user limited"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_GRANT_CONN_LIMITED
,
0
,
36
0
,
"grant conn limited"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_GRANT_STREAM_LIMITED
,
0
,
36
1
,
"grant stream limited"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_GRANT_SPEED_LIMITED
,
0
,
36
2
,
"grant speed limited"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_GRANT_STORAGE_LIMITED
,
0
,
36
3
,
"grant storage limited"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_GRANT_QUERYTIME_LIMITED
,
0
,
36
4
,
"grant query time limited"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_GRANT_CPU_LIMITED
,
0
,
36
5
,
"grant cpu limited"
)
// server
TAOS_DEFINE_ERROR
(
TSDB_CODE_INVALID_VGROUP_ID
,
0
,
5
00
,
"invalid vgroup id"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_INVALID_VNODE_ID
,
0
,
5
01
,
"invalid vnode id"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_NOT_ACTIVE_VNODE
,
0
,
5
02
,
"not active vnode"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_VG_INIT_FAILED
,
0
,
5
03
,
"vg init failed"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_SERV_NO_DISKSPACE
,
0
,
5
04
,
"server no diskspace"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_SERV_OUT_OF_MEMORY
,
0
,
5
05
,
"server out of memory"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_NO_DISK_PERMISSIONS
,
0
,
5
06
,
"no disk permissions"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_FILE_CORRUPTED
,
0
,
5
07
,
"file corrupted"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_MEMORY_CORRUPTED
,
0
,
5
08
,
"memory corrupted"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_INVALID_VGROUP_ID
,
0
,
4
00
,
"invalid vgroup id"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_INVALID_VNODE_ID
,
0
,
4
01
,
"invalid vnode id"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_NOT_ACTIVE_VNODE
,
0
,
4
02
,
"not active vnode"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_VG_INIT_FAILED
,
0
,
4
03
,
"vg init failed"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_SERV_NO_DISKSPACE
,
0
,
4
04
,
"server no diskspace"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_SERV_OUT_OF_MEMORY
,
0
,
4
05
,
"server out of memory"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_NO_DISK_PERMISSIONS
,
0
,
4
06
,
"no disk permissions"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_FILE_CORRUPTED
,
0
,
4
07
,
"file corrupted"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_MEMORY_CORRUPTED
,
0
,
4
08
,
"memory corrupted"
)
// client
TAOS_DEFINE_ERROR
(
TSDB_CODE_INVALID_CLIENT_VERSION
,
0
,
60
1
,
"invalid client version"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_CLI_OUT_OF_MEMORY
,
0
,
60
2
,
"client out of memory"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_CLI_NO_DISKSPACE
,
0
,
60
3
,
"client no disk space"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_INVALID_TIME_STAMP
,
0
,
60
4
,
"invalid timestamp"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_INVALID_SQL
,
0
,
60
5
,
"invalid sql"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_QUERY_CACHE_ERASED
,
0
,
60
6
,
"query cache erased"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_INVALID_QUERY_MSG
,
0
,
60
7
,
"invalid query message"
)
// failed to validate the sql expression msg by vnode
TAOS_DEFINE_ERROR
(
TSDB_CODE_SORTED_RES_TOO_MANY
,
0
,
60
8
,
"sorted res too many"
)
// too many result for ordered super table projection query
TAOS_DEFINE_ERROR
(
TSDB_CODE_INVALID_QHANDLE
,
0
,
60
9
,
"invalid handle"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_QUERY_CANCELLED
,
0
,
61
0
,
"query cancelled"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_INVALID_IE
,
0
,
61
1
,
"invalid ie"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_INVALID_VALUE
,
0
,
61
2
,
"invalid value"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_INVALID_CLIENT_VERSION
,
0
,
45
1
,
"invalid client version"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_CLI_OUT_OF_MEMORY
,
0
,
45
2
,
"client out of memory"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_CLI_NO_DISKSPACE
,
0
,
45
3
,
"client no disk space"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_INVALID_TIME_STAMP
,
0
,
45
4
,
"invalid timestamp"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_INVALID_SQL
,
0
,
45
5
,
"invalid sql"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_QUERY_CACHE_ERASED
,
0
,
45
6
,
"query cache erased"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_INVALID_QUERY_MSG
,
0
,
45
7
,
"invalid query message"
)
// failed to validate the sql expression msg by vnode
TAOS_DEFINE_ERROR
(
TSDB_CODE_SORTED_RES_TOO_MANY
,
0
,
45
8
,
"sorted res too many"
)
// too many result for ordered super table projection query
TAOS_DEFINE_ERROR
(
TSDB_CODE_INVALID_QHANDLE
,
0
,
45
9
,
"invalid handle"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_QUERY_CANCELLED
,
0
,
46
0
,
"query cancelled"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_INVALID_IE
,
0
,
46
1
,
"invalid ie"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_INVALID_VALUE
,
0
,
46
2
,
"invalid value"
)
// others
TAOS_DEFINE_ERROR
(
TSDB_CODE_INVALID_FILE_FORMAT
,
0
,
7
00
,
"invalid file format"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_INVALID_FILE_FORMAT
,
0
,
5
00
,
"invalid file format"
)
#ifdef TAOS_ERROR_C
...
...
src/mnode/src/mgmtShell.c
浏览文件 @
58c603d1
...
...
@@ -364,7 +364,7 @@ static void mgmtProcessHeartBeatMsg(SQueuedMsg *pMsg) {
}
static
int
mgmtShellRetriveAuth
(
char
*
user
,
char
*
spi
,
char
*
encrypt
,
char
*
secret
,
char
*
ckey
)
{
*
spi
=
0
;
*
spi
=
1
;
*
encrypt
=
0
;
*
ckey
=
0
;
...
...
src/mnode/src/mgmtTable.c
浏览文件 @
58c603d1
...
...
@@ -1218,7 +1218,7 @@ static void mgmtProcessSuperTableVgroupMsg(SQueuedMsg *pMsg) {
}
static
void
mgmtProcessDropSuperTableRsp
(
SRpcMsg
*
rpcMsg
)
{
mTrace
(
"drop stable rsp received, handle:%p code:%
d"
,
rpcMsg
->
handle
,
rpcMsg
->
code
);
mTrace
(
"drop stable rsp received, handle:%p code:%
s"
,
rpcMsg
->
handle
,
tstrerror
(
rpcMsg
->
code
)
);
}
static
void
*
mgmtBuildCreateChildTableMsg
(
SCMCreateTableMsg
*
pMsg
,
SChildTableObj
*
pTable
)
{
...
...
@@ -1876,7 +1876,7 @@ static void mgmtProcessCreateChildTableRsp(SRpcMsg *rpcMsg) {
// not implemented yet
static
void
mgmtProcessAlterTableRsp
(
SRpcMsg
*
rpcMsg
)
{
mTrace
(
"alter table rsp received, handle:%p code:%
d"
,
rpcMsg
->
handle
,
rpcMsg
->
code
);
mTrace
(
"alter table rsp received, handle:%p code:%
s"
,
rpcMsg
->
handle
,
tstrerror
(
rpcMsg
->
code
)
);
}
static
void
mgmtProcessMultiTableMetaMsg
(
SQueuedMsg
*
pMsg
)
{
...
...
src/plugins/http/src/gcHandle.c
浏览文件 @
58c603d1
...
...
@@ -13,11 +13,13 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "gcHandle.h"
#define _DEFAULT_SOURCE
#include "os.h"
#include "cJSON.h"
#include "httpLog.h"
#include "gcHandle.h"
#include "gcJson.h"
#include "taosdef.h"
#include "httpLog.h"
static
HttpDecodeMethod
gcDecodeMethod
=
{
"grafana"
,
gcProcessRequest
};
static
HttpEncodeMethod
gcHeartBeatMethod
=
{
NULL
,
gcSendHeartBeatResp
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
};
...
...
src/plugins/http/src/gcJson.c
浏览文件 @
58c603d1
...
...
@@ -13,10 +13,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <stdint.h>
#include <string.h>
#include <unistd.h>
#define _DEFAULT_SOURCE
#include "os.h"
#include "gcHandle.h"
#include "gcJson.h"
#include "httpJson.h"
...
...
src/plugins/http/src/httpAuth.c
浏览文件 @
58c603d1
...
...
@@ -13,12 +13,14 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#define _DEFAULT_SOURCE
#include "os.h"
#include "tkey.h"
#include "tutil.h"
#include "http.h"
#include "httpLog.h"
#include "httpHandle.h"
#include "tkey.h"
#define KEY_DES_4 4971256377704625728L
bool
httpParseBasicAuthToken
(
HttpContext
*
pContext
,
char
*
token
,
int
len
)
{
...
...
src/plugins/http/src/httpCode.c
浏览文件 @
58c603d1
...
...
@@ -13,6 +13,9 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#define _DEFAULT_SOURCE
char
*
httpMsg
[]
=
{
"success"
,
// 0
"http server is not online"
,
// 1
...
...
src/plugins/http/src/httpHandle.c
浏览文件 @
58c603d1
...
...
@@ -13,21 +13,18 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <arpa/inet.h>
#include <stdint.h>
#include <string.h>
#include <unistd.h>
#include "http.h"
#include "httpCode.h"
#include "httpHandle.h"
#include "httpResp.h"
#include "shash.h"
#define _DEFAULT_SOURCE
#include "os.h"
#include "taos.h"
#include "tglobal.h"
#include "tsocket.h"
#include "ttimer.h"
#include "shash.h"
#include "http.h"
#include "httpLog.h"
#include "httpCode.h"
#include "httpHandle.h"
#include "httpResp.h"
void
httpToLowerUrl
(
char
*
url
)
{
/*ignore case */
...
...
src/plugins/http/src/httpJson.c
浏览文件 @
58c603d1
...
...
@@ -13,20 +13,15 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <netinet/in.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <errno.h>
#define _DEFAULT_SOURCE
#include "os.h"
#include "taosmsg.h"
#include "taoserror.h"
#include "http.h"
#include "httpLog.h"
#include "httpCode.h"
#include "httpJson.h"
#include "httpResp.h"
#include "taosmsg.h"
#include "httpLog.h"
#include "taoserror.h"
#define MAX_NUM_STR_SZ 25
...
...
src/plugins/http/src/httpResp.c
浏览文件 @
58c603d1
...
...
@@ -13,14 +13,14 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#define _DEFAULT_SOURCE
#include "os.h"
#include "taoserror.h"
#include "taosmsg.h"
#include "httpLog.h"
#include "httpResp.h"
#include <stdio.h>
#include <string.h>
#include "httpCode.h"
#include "httpJson.h"
#include "taosmsg.h"
#include "httpLog.h"
#include "taoserror.h"
const
char
*
httpKeepAliveStr
[]
=
{
""
,
"Connection: Keep-Alive
\r\n
"
,
"Connection: Close
\r\n
"
};
...
...
@@ -44,9 +44,8 @@ const char *httpRespTemplate[] = {
"%s 200 OK
\r\n
Access-Control-Allow-Origin:*
\r\n
%sAccess-Control-Allow-Methods:POST, GET, OPTIONS, DELETE, PUT
\r\n
Access-Control-Allow-Headers:Accept, Content-Type
\r\n
Content-Type: application/json;charset=utf-8
\r\n
Content-Length: %d
\r\n\r\n
"
};
void
httpSendErrorRespImp
(
HttpContext
*
pContext
,
int
httpCode
,
char
*
httpCodeStr
,
int
errNo
,
char
*
desc
)
{
httpError
(
"context:%p, fd:%d, ip:%s, code:%d, error:%d:%s"
,
pContext
,
pContext
->
fd
,
pContext
->
ipstr
,
httpCode
,
errNo
,
desc
);
static
void
httpSendErrorRespImp
(
HttpContext
*
pContext
,
int
httpCode
,
char
*
httpCodeStr
,
int
errNo
,
char
*
desc
)
{
httpError
(
"context:%p, fd:%d, ip:%s, code:%d, error:%s"
,
pContext
,
pContext
->
fd
,
pContext
->
ipstr
,
httpCode
,
desc
);
char
head
[
512
]
=
{
0
};
char
body
[
512
]
=
{
0
};
...
...
@@ -184,7 +183,7 @@ void httpSendErrorResp(HttpContext *pContext, int errNo) { httpSendErrorRespWith
void
httpSendTaosdErrorResp
(
HttpContext
*
pContext
,
int
errCode
)
{
int
httpCode
=
400
;
httpSendErrorRespImp
(
pContext
,
httpCode
,
"Bad Request"
,
errCode
,
(
char
*
)
tstrerror
(
errCode
));
httpSendErrorRespImp
(
pContext
,
httpCode
,
"Bad Request"
,
1000
,
(
char
*
)
tstrerror
(
errCode
));
}
void
httpSendTaosdInvalidSqlErrorResp
(
HttpContext
*
pContext
,
char
*
errMsg
)
{
...
...
src/plugins/http/src/httpServer.c
浏览文件 @
58c603d1
...
...
@@ -13,6 +13,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#define _DEFAULT_SOURCE
#include "os.h"
#include "taosmsg.h"
#include "tsocket.h"
...
...
src/plugins/http/src/httpSession.c
浏览文件 @
58c603d1
...
...
@@ -13,20 +13,18 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <string.h>
#include <time.h>
#include <unistd.h>
#include "http.h"
#include "httpCode.h"
#include "httpHandle.h"
#include "httpResp.h"
#define _DEFAULT_SOURCE
#include "os.h"
#include "shash.h"
#include "taos.h"
#include "ttime.h"
#include "ttimer.h"
#include "http.h"
#include "httpLog.h"
#include "httpCode.h"
#include "httpHandle.h"
#include "httpResp.h"
void
httpAccessSession
(
HttpContext
*
pContext
)
{
HttpServer
*
server
=
pContext
->
pThread
->
pServer
;
...
...
src/plugins/http/src/httpSql.c
浏览文件 @
58c603d1
...
...
@@ -13,15 +13,16 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#define _DEFAULT_SOURCE
#include "os.h"
#include "tnote.h"
#include "taos.h"
#include "tsclient.h"
#include "http.h"
#include "httpLog.h"
#include "httpCode.h"
#include "httpHandle.h"
#include "httpResp.h"
#include "taos.h"
#include "tsclient.h"
#include "tnote.h"
#include "httpLog.h"
void
*
taos_connect_a
(
char
*
ip
,
char
*
user
,
char
*
pass
,
char
*
db
,
uint16_t
port
,
void
(
*
fp
)(
void
*
,
TAOS_RES
*
,
int
),
void
*
param
,
void
**
taos
);
...
...
@@ -55,8 +56,8 @@ void httpProcessMultiSqlRetrieveCallBack(void *param, TAOS_RES *result, int numO
pContext
,
pContext
->
fd
,
pContext
->
ipstr
,
pContext
->
user
,
multiCmds
->
pos
,
numOfRows
,
sql
);
if
(
numOfRows
<
0
)
{
httpError
(
"context:%p, fd:%d, ip:%s, user:%s, process pos:%d, retrieve failed code:%
d
, sql:%s"
,
pContext
,
pContext
->
fd
,
pContext
->
ipstr
,
pContext
->
user
,
multiCmds
->
pos
,
-
numOfRows
,
sql
);
httpError
(
"context:%p, fd:%d, ip:%s, user:%s, process pos:%d, retrieve failed code:%
s
, sql:%s"
,
pContext
,
pContext
->
fd
,
pContext
->
ipstr
,
pContext
->
user
,
multiCmds
->
pos
,
tstrerror
(
numOfRows
)
,
sql
);
}
else
{
taos_free_result
(
result
);
}
...
...
@@ -79,21 +80,21 @@ void httpProcessMultiSqlCallBack(void *param, TAOS_RES *result, int code) {
HttpSqlCmd
*
singleCmd
=
multiCmds
->
cmds
+
multiCmds
->
pos
;
char
*
sql
=
httpGetCmdsString
(
pContext
,
singleCmd
->
sql
);
if
(
-
code
==
TSDB_CODE_ACTION_IN_PROGRESS
)
{
httpWarn
(
"context:%p, fd:%d, ip:%s, user:%s, process pos:%d, code:%
d
:inprogress, sql:%s"
,
pContext
,
pContext
->
fd
,
pContext
->
ipstr
,
pContext
->
user
,
multiCmds
->
pos
,
-
code
,
sql
);
if
(
code
==
TSDB_CODE_ACTION_IN_PROGRESS
)
{
httpWarn
(
"context:%p, fd:%d, ip:%s, user:%s, process pos:%d, code:%
s
:inprogress, sql:%s"
,
pContext
,
pContext
->
fd
,
pContext
->
ipstr
,
pContext
->
user
,
multiCmds
->
pos
,
tstrerror
(
code
)
,
sql
);
return
;
}
if
(
code
<
0
)
{
if
(
encode
->
checkFinishedFp
!=
NULL
&&
!
encode
->
checkFinishedFp
(
pContext
,
singleCmd
,
code
>=
0
?
0
:
-
code
))
{
singleCmd
->
code
=
-
code
;
httpTrace
(
"context:%p, fd:%d, ip:%s, user:%s, process pos jump to:%d, last code:%
d
, last sql:%s"
,
pContext
,
pContext
->
fd
,
pContext
->
ipstr
,
pContext
->
user
,
multiCmds
->
pos
+
1
,
-
code
,
sql
);
if
(
encode
->
checkFinishedFp
!=
NULL
&&
!
encode
->
checkFinishedFp
(
pContext
,
singleCmd
,
code
>=
0
?
0
:
code
))
{
singleCmd
->
code
=
code
;
httpTrace
(
"context:%p, fd:%d, ip:%s, user:%s, process pos jump to:%d, last code:%
s
, last sql:%s"
,
pContext
,
pContext
->
fd
,
pContext
->
ipstr
,
pContext
->
user
,
multiCmds
->
pos
+
1
,
tstrerror
(
code
)
,
sql
);
}
else
{
singleCmd
->
code
=
-
code
;
httpError
(
"context:%p, fd:%d, ip:%s, user:%s, process pos:%d, error code:%
d
, sql:%s"
,
pContext
,
pContext
->
fd
,
pContext
->
ipstr
,
pContext
->
user
,
multiCmds
->
pos
,
-
code
,
sql
);
singleCmd
->
code
=
code
;
httpError
(
"context:%p, fd:%d, ip:%s, user:%s, process pos:%d, error code:%
s
, sql:%s"
,
pContext
,
pContext
->
fd
,
pContext
->
ipstr
,
pContext
->
user
,
multiCmds
->
pos
,
tstrerror
(
code
)
,
sql
);
if
(
singleCmd
->
cmdReturnType
==
HTTP_CMD_RETURN_TYPE_WITH_RETURN
)
{
if
(
encode
->
startJsonFp
)
(
encode
->
startJsonFp
)(
pContext
,
singleCmd
,
result
);
...
...
@@ -209,8 +210,8 @@ void httpProcessSingleSqlRetrieveCallBack(void *param, TAOS_RES *result, int num
pContext
->
user
,
numOfRows
);
if
(
numOfRows
<
0
)
{
httpError
(
"context:%p, fd:%d, ip:%s, user:%s, retrieve failed, code:%
d
"
,
pContext
,
pContext
->
fd
,
pContext
->
ipstr
,
pContext
->
user
,
-
numOfRows
);
httpError
(
"context:%p, fd:%d, ip:%s, user:%s, retrieve failed, code:%
s
"
,
pContext
,
pContext
->
fd
,
pContext
->
ipstr
,
pContext
->
user
,
tstrerror
(
numOfRows
)
);
}
else
{
taos_free_result
(
result
);
}
...
...
@@ -229,22 +230,22 @@ void httpProcessSingleSqlCallBack(void *param, TAOS_RES *result, int code) {
HttpEncodeMethod
*
encode
=
pContext
->
encodeMethod
;
if
(
-
code
==
TSDB_CODE_ACTION_IN_PROGRESS
)
{
httpError
(
"context:%p, fd:%d, ip:%s, user:%s, query error, taos:%p, code:%
d
:inprogress, sqlObj:%p"
,
pContext
,
pContext
->
fd
,
pContext
->
ipstr
,
pContext
->
user
,
pContext
->
session
->
taos
,
-
code
,
(
SSqlObj
*
)
result
);
if
(
code
==
TSDB_CODE_ACTION_IN_PROGRESS
)
{
httpError
(
"context:%p, fd:%d, ip:%s, user:%s, query error, taos:%p, code:%
s
:inprogress, sqlObj:%p"
,
pContext
,
pContext
->
fd
,
pContext
->
ipstr
,
pContext
->
user
,
pContext
->
session
->
taos
,
tstrerror
(
code
)
,
(
SSqlObj
*
)
result
);
return
;
}
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:%
d
:invalidsql, sqlObj:%p, error:%s"
,
pContext
,
pContext
->
fd
,
pContext
->
ipstr
,
pContext
->
user
,
pContext
->
session
->
taos
,
-
code
,
pObj
,
pObj
->
cmd
.
payload
);
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"
,
pContext
,
pContext
->
fd
,
pContext
->
ipstr
,
pContext
->
user
,
pContext
->
session
->
taos
,
tstrerror
(
code
)
,
pObj
,
pObj
->
cmd
.
payload
);
httpSendTaosdInvalidSqlErrorResp
(
pContext
,
pObj
->
cmd
.
payload
);
}
else
{
httpError
(
"context:%p, fd:%d, ip:%s, user:%s, query error, taos:%p, code:%
d
, sqlObj:%p"
,
pContext
,
pContext
->
fd
,
pContext
->
ipstr
,
pContext
->
user
,
pContext
->
session
->
taos
,
-
code
,
pObj
);
httpSendTaosdErrorResp
(
pContext
,
-
code
);
httpError
(
"context:%p, fd:%d, ip:%s, user:%s, query error, taos:%p, code:%
s
, sqlObj:%p"
,
pContext
,
pContext
->
fd
,
pContext
->
ipstr
,
pContext
->
user
,
pContext
->
session
->
taos
,
tstrerror
(
code
)
,
pObj
);
httpSendTaosdErrorResp
(
pContext
,
code
);
}
return
;
}
...
...
@@ -349,9 +350,9 @@ void httpProcessRequestCb(void *param, TAOS_RES *result, int code) {
if
(
pContext
==
NULL
||
pContext
->
signature
!=
pContext
)
return
;
if
(
code
<
0
)
{
httpError
(
"context:%p, fd:%d, ip:%s, user:%s, login error, code:%
d
"
,
pContext
,
pContext
->
fd
,
pContext
->
ipstr
,
pContext
->
user
,
-
code
);
httpSendTaosdErrorResp
(
pContext
,
-
code
);
httpError
(
"context:%p, fd:%d, ip:%s, user:%s, login error, code:%
s
"
,
pContext
,
pContext
->
fd
,
pContext
->
ipstr
,
pContext
->
user
,
tstrerror
(
code
)
);
httpSendTaosdErrorResp
(
pContext
,
code
);
return
;
}
...
...
src/plugins/http/src/httpSystem.c
浏览文件 @
58c603d1
...
...
@@ -15,17 +15,17 @@
#define _DEFAULT_SOURCE
#include "os.h"
#include "shash.h"
#include "taos.h"
#include "tglobal.h"
#include "tsocket.h"
#include "ttimer.h"
#include "tadmin.h"
#include "http.h"
#include "httpCode.h"
#include "httpHandle.h"
#include "httpResp.h"
#include "httpLog.h"
#include "shash.h"
#include "taos.h"
#include "tglobal.h"
#include "tsocket.h"
#include "ttimer.h"
#include "gcHandle.h"
#include "httpHandle.h"
#include "restHandle.h"
...
...
src/plugins/http/src/httpUtil.c
浏览文件 @
58c603d1
...
...
@@ -13,15 +13,16 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#define _DEFAULT_SOURCE
#include "os.h"
#include "tmd5.h"
#include "shash.h"
#include "taos.h"
#include "http.h"
#include "httpLog.h"
#include "httpCode.h"
#include "httpHandle.h"
#include "httpResp.h"
#include "shash.h"
#include "taos.h"
#include "httpLog.h"
bool
httpCheckUsedbSql
(
char
*
sql
)
{
if
(
strstr
(
sql
,
"use "
)
!=
NULL
)
{
...
...
src/plugins/http/src/restHandle.c
浏览文件 @
58c603d1
...
...
@@ -13,9 +13,11 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#define _DEFAULT_SOURCE
#include "os.h"
#include "httpLog.h"
#include "restHandle.h"
#include "restJson.h"
#include "httpLog.h"
static
HttpDecodeMethod
restDecodeMethod
=
{
"rest"
,
restProcessRequest
};
static
HttpDecodeMethod
restDecodeMethod2
=
{
"restful"
,
restProcessRequest
};
...
...
src/plugins/http/src/restJson.c
浏览文件 @
58c603d1
...
...
@@ -13,6 +13,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#define _DEFAULT_SOURCE
#include "os.h"
#include "tglobal.h"
#include "httpLog.h"
...
...
src/plugins/http/src/tgHandle.c
浏览文件 @
58c603d1
...
...
@@ -13,14 +13,15 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#define _DEFAULT_SOURCE
#include "os.h"
#include "tg
Handle
.h"
#include "tg
lobal
.h"
#include "shash.h"
#include "taosdef.h"
#include "taosmsg.h"
#include "tgHandle.h"
#include "tgJson.h"
#include "taosdef.h"
#include "httpLog.h"
#include "tglobal.h"
/*
* taos.telegraf.cfg formats like
...
...
src/plugins/http/src/tgJson.c
浏览文件 @
58c603d1
...
...
@@ -13,13 +13,14 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#define _DEFAULT_SOURCE
#include "os.h"
#include "taosmsg.h"
#include "httpLog.h"
#include "httpJson.h"
#include "httpResp.h"
#include "taosmsg.h"
#include "tgHandle.h"
#include "tgJson.h"
#include "httpLog.h"
void
tgInitQueryJson
(
HttpContext
*
pContext
)
{
JsonBuf
*
jsonBuf
=
httpMallocJsonBuf
(
pContext
);
...
...
@@ -97,8 +98,8 @@ void tgBuildSqlAffectRowsJson(HttpContext *pContext, HttpSqlCmd *cmd, int affect
bool
tgCheckFinished
(
struct
HttpContext
*
pContext
,
HttpSqlCmd
*
cmd
,
int
code
)
{
HttpSqlCmds
*
multiCmds
=
pContext
->
multiCmds
;
httpTrace
(
"context:%p, fd:%d, ip:%s, check telegraf command, code:%
d
, state:%d, type:%d, rettype:%d, tags:%d"
,
pContext
,
pContext
->
fd
,
pContext
->
ipstr
,
code
,
cmd
->
cmdState
,
cmd
->
cmdType
,
cmd
->
cmdReturnType
,
cmd
->
tagNum
);
httpTrace
(
"context:%p, fd:%d, ip:%s, check telegraf command, code:%
s
, state:%d, type:%d, rettype:%d, tags:%d"
,
pContext
,
pContext
->
fd
,
pContext
->
ipstr
,
tstrerror
(
code
)
,
cmd
->
cmdState
,
cmd
->
cmdType
,
cmd
->
cmdReturnType
,
cmd
->
tagNum
);
if
(
cmd
->
cmdType
==
HTTP_CMD_TYPE_INSERT
)
{
if
(
cmd
->
cmdState
==
HTTP_CMD_STATE_NOT_RUN_YET
)
{
...
...
@@ -124,11 +125,11 @@ bool tgCheckFinished(struct HttpContext *pContext, HttpSqlCmd *cmd, int code) {
}
}
else
if
(
cmd
->
cmdType
==
HTTP_CMD_TYPE_CREATE_DB
)
{
cmd
->
cmdState
=
HTTP_CMD_STATE_RUN_FINISHED
;
httpTrace
(
"context:%p, fd:%d, ip:%s, code:%
d
, create database failed"
,
pContext
,
pContext
->
fd
,
pContext
->
ipstr
,
code
);
httpTrace
(
"context:%p, fd:%d, ip:%s, code:%
s
, create database failed"
,
pContext
,
pContext
->
fd
,
pContext
->
ipstr
,
tstrerror
(
code
)
);
}
else
if
(
cmd
->
cmdType
==
HTTP_CMD_TYPE_CREATE_STBALE
)
{
cmd
->
cmdState
=
HTTP_CMD_STATE_RUN_FINISHED
;
httpTrace
(
"context:%p, fd:%d, ip:%s, code:%
d, create stable failed"
,
pContext
,
pContext
->
fd
,
pContext
->
ipstr
,
code
);
httpTrace
(
"context:%p, fd:%d, ip:%s, code:%
s, create stable failed"
,
pContext
,
pContext
->
fd
,
pContext
->
ipstr
,
tstrerror
(
code
)
);
}
else
{
}
...
...
@@ -137,8 +138,8 @@ bool tgCheckFinished(struct HttpContext *pContext, HttpSqlCmd *cmd, int code) {
void
tgSetNextCmd
(
struct
HttpContext
*
pContext
,
HttpSqlCmd
*
cmd
,
int
code
)
{
HttpSqlCmds
*
multiCmds
=
pContext
->
multiCmds
;
httpTrace
(
"context:%p, fd:%d, ip:%s, get telegraf next command, pos:%d, code:%
d
, state:%d, type:%d, rettype:%d, tags:%d"
,
pContext
,
pContext
->
fd
,
pContext
->
ipstr
,
multiCmds
->
pos
,
code
,
cmd
->
cmdState
,
cmd
->
cmdType
,
httpTrace
(
"context:%p, fd:%d, ip:%s, get telegraf next command, pos:%d, code:%
s
, state:%d, type:%d, rettype:%d, tags:%d"
,
pContext
,
pContext
->
fd
,
pContext
->
ipstr
,
multiCmds
->
pos
,
tstrerror
(
code
)
,
cmd
->
cmdState
,
cmd
->
cmdType
,
cmd
->
cmdReturnType
,
cmd
->
tagNum
);
if
(
cmd
->
cmdType
==
HTTP_CMD_TYPE_INSERT
)
{
...
...
tests/script/general/http/restful.sim
浏览文件 @
58c603d1
...
...
@@ -77,8 +77,8 @@ if $system_content != @{"status":"succ","code":0,"desc":"jIlItaLFFIPa8qdtNZmtONr
return -1
endi
system_content curl 127.0.0.1:6020/rest/login/u2/abcd_1234
system_content curl 127.0.0.1:6020/rest/login/u2/a
a
bcd_1234
print curl 127.0.0.1:6020/rest/login/u2/abcd_1234 -----> $system_content
if $system_content != @{"status":"
succ","code":0,"desc":"AZH3lNvWZiLa8qdtNZmtONryp201ma04QExCHYkbFFQB/46k1gwnPNryp201ma04
"}@ then
if $system_content != @{"status":"
error","code":1000,"desc":"auth failure
"}@ then
return -1
endi
tests/script/general/http/restful_full.sim
浏览文件 @
58c603d1
system sh/stop_dnodes.sh
sleep 5000
#
sleep 5000
system sh/ip.sh -i 1 -s up
system sh/deploy.sh -n dnode1 -m 192.168.0.1 -i 192.168.0.1
system sh/cfg.sh -n dnode1 -c clog -v 0
system sh/exec.sh -n dnode1 -s start
sleep 3000
#
sleep 3000
sql connect
print ============================ dnode1 start
...
...
@@ -41,19 +41,19 @@ endi
system_content curl 192.168.0.1:6020/rest/login/root/123
print 5-> $system_content
if $system_content != @{"status":"error","code":10
,"desc":"authentication
failure"}@ then
if $system_content != @{"status":"error","code":10
00,"desc":"auth
failure"}@ then
return -1
endi
system_content curl 192.168.0.1:6020/rest/login/root/123/1/1/3
print 6-> $system_content
if $system_content != @{"status":"error","code":10
,"desc":"authentication
failure"}@ then
if $system_content != @{"status":"error","code":10
00,"desc":"auth
failure"}@ then
return -1
endi
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d 'show databases' 192.168.0.1:6020/rest/login/root/1
print 7-> $system_content
if $system_content != @{"status":"error","code":10
,"desc":"authentication
failure"}@ then
if $system_content != @{"status":"error","code":10
00,"desc":"auth
failure"}@ then
return -1
endi
...
...
tests/script/general/http/testSuite.sim
浏览文件 @
58c603d1
run general/http/grafana.sim
run general/http/restful.sim
run general/http/restful_full.sim
run general/http/telegraf.sim
run general/http/prepare.sim
run general/http/grafana_bug.sim
#run general/http/opentsdb
.sim
run general/http/grafana
.sim
tests/script/sh/deploy.sh
浏览文件 @
58c603d1
...
...
@@ -93,10 +93,10 @@ echo "privateIp $NODE_IP" >> $TAOS_CFG
echo
"dDebugFlag 199"
>>
$TAOS_CFG
echo
"mDebugFlag 199"
>>
$TAOS_CFG
echo
"sdbDebugFlag 199"
>>
$TAOS_CFG
echo
"rpcDebugFlag 13
5
"
>>
$TAOS_CFG
echo
"rpcDebugFlag 13
1
"
>>
$TAOS_CFG
echo
"tmrDebugFlag 131"
>>
$TAOS_CFG
echo
"cDebugFlag 135"
>>
$TAOS_CFG
echo
"httpDebugFlag 13
1
"
>>
$TAOS_CFG
echo
"httpDebugFlag 13
5
"
>>
$TAOS_CFG
echo
"monitorDebugFlag 131"
>>
$TAOS_CFG
echo
"udebugFlag 131"
>>
$TAOS_CFG
echo
"jnidebugFlag 131"
>>
$TAOS_CFG
...
...
tests/script/
general
/http/opentsdb.sim
→
tests/script/
unique
/http/opentsdb.sim
浏览文件 @
58c603d1
文件已移动
tests/script/unique/http/testSuite.sim
浏览文件 @
58c603d1
run unique/http/admin.sim
\ No newline at end of file
run unique/http/admin.sim
#run general/http/opentsdb.sim
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录