Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
ff20d564
T
TDengine
项目概览
taosdata
/
TDengine
大约 1 年 前同步成功
通知
1185
Star
22015
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
ff20d564
编写于
8月 15, 2020
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[td-1109]
上级
3e2ea659
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
25 addition
and
36 deletion
+25
-36
src/inc/taosmsg.h
src/inc/taosmsg.h
+1
-1
src/inc/ttokendef.h
src/inc/ttokendef.h
+1
-1
src/mnode/src/mnodeDnode.c
src/mnode/src/mnodeDnode.c
+13
-21
src/mnode/src/mnodeShow.c
src/mnode/src/mnodeShow.c
+1
-1
src/query/inc/sql.y
src/query/inc/sql.y
+1
-1
src/query/src/qTokenizer.c
src/query/src/qTokenizer.c
+1
-1
src/query/src/sql.c
src/query/src/sql.c
+7
-10
未找到文件。
src/inc/taosmsg.h
浏览文件 @
ff20d564
...
...
@@ -133,7 +133,7 @@ enum _mgmt_table {
TSDB_MGMT_TABLE_MODULE
,
TSDB_MGMT_TABLE_QUERIES
,
TSDB_MGMT_TABLE_STREAMS
,
TSDB_MGMT_TABLE_
CONFIG
S
,
TSDB_MGMT_TABLE_
VARIABLE
S
,
TSDB_MGMT_TABLE_CONNS
,
TSDB_MGMT_TABLE_SCORES
,
TSDB_MGMT_TABLE_GRANTS
,
...
...
src/inc/ttokendef.h
浏览文件 @
ff20d564
...
...
@@ -69,7 +69,7 @@
#define TK_QUERIES 51
#define TK_CONNECTIONS 52
#define TK_STREAMS 53
#define TK_
CONFIGS
54
#define TK_
VARIABLES
54
#define TK_SCORES 55
#define TK_GRANTS 56
#define TK_VNODES 57
...
...
src/mnode/src/mnodeDnode.c
浏览文件 @
ff20d564
...
...
@@ -49,7 +49,7 @@ static int32_t mnodeProcessCreateDnodeMsg(SMnodeMsg *pMsg);
static
int32_t
mnodeProcessDropDnodeMsg
(
SMnodeMsg
*
pMsg
);
static
int32_t
mnodeProcessCfgDnodeMsg
(
SMnodeMsg
*
pMsg
);
static
void
mnodeProcessCfgDnodeMsgRsp
(
SRpcMsg
*
rpcMsg
)
;
static
int32_t
mnodeProcessDnodeStatusMsg
(
SMnodeMsg
*
rpc
Msg
);
static
int32_t
mnodeProcessDnodeStatusMsg
(
SMnodeMsg
*
p
Msg
);
static
int32_t
mnodeGetModuleMeta
(
STableMetaMsg
*
pMeta
,
SShowObj
*
pShow
,
void
*
pConn
);
static
int32_t
mnodeRetrieveModules
(
SShowObj
*
pShow
,
char
*
data
,
int32_t
rows
,
void
*
pConn
);
static
int32_t
mnodeGetConfigMeta
(
STableMetaMsg
*
pMeta
,
SShowObj
*
pShow
,
void
*
pConn
);
...
...
@@ -161,8 +161,8 @@ int32_t mnodeInitDnodes() {
mnodeAddPeerMsgHandle
(
TSDB_MSG_TYPE_DM_STATUS
,
mnodeProcessDnodeStatusMsg
);
mnodeAddShowMetaHandle
(
TSDB_MGMT_TABLE_MODULE
,
mnodeGetModuleMeta
);
mnodeAddShowRetrieveHandle
(
TSDB_MGMT_TABLE_MODULE
,
mnodeRetrieveModules
);
mnodeAddShowMetaHandle
(
TSDB_MGMT_TABLE_
CONFIG
S
,
mnodeGetConfigMeta
);
mnodeAddShowRetrieveHandle
(
TSDB_MGMT_TABLE_
CONFIG
S
,
mnodeRetrieveConfigs
);
mnodeAddShowMetaHandle
(
TSDB_MGMT_TABLE_
VARIABLE
S
,
mnodeGetConfigMeta
);
mnodeAddShowRetrieveHandle
(
TSDB_MGMT_TABLE_
VARIABLE
S
,
mnodeRetrieveConfigs
);
mnodeAddShowMetaHandle
(
TSDB_MGMT_TABLE_VNODES
,
mnodeGetVnodeMeta
);
mnodeAddShowRetrieveHandle
(
TSDB_MGMT_TABLE_VNODES
,
mnodeRetrieveVnodes
);
mnodeAddShowMetaHandle
(
TSDB_MGMT_TABLE_DNODE
,
mnodeGetDnodeMeta
);
...
...
@@ -728,7 +728,7 @@ static int32_t mnodeRetrieveDnodes(SShowObj *pShow, char *data, int32_t rows, vo
}
static
bool
mnodeCheckModuleInDnode
(
SDnodeObj
*
pDnode
,
int32_t
moduleType
)
{
uint32_t
status
=
pDnode
->
moduleStatus
&
(
1
<<
moduleType
);
uint32_t
status
=
pDnode
->
moduleStatus
&
(
1
u
<<
moduleType
);
return
status
>
0
;
}
...
...
@@ -753,7 +753,7 @@ static int32_t mnodeGetModuleMeta(STableMetaMsg *pMeta, SShowObj *pShow, void *p
pShow
->
bytes
[
cols
]
=
40
+
VARSTR_HEADER_SIZE
;
pSchema
[
cols
].
type
=
TSDB_DATA_TYPE_BINARY
;
strcpy
(
pSchema
[
cols
].
name
,
"end
point"
);
strcpy
(
pSchema
[
cols
].
name
,
"end
_
point"
);
pSchema
[
cols
].
bytes
=
htons
(
pShow
->
bytes
[
cols
]);
cols
++
;
...
...
@@ -787,7 +787,9 @@ static int32_t mnodeGetModuleMeta(STableMetaMsg *pMeta, SShowObj *pShow, void *p
int32_t
mnodeRetrieveModules
(
SShowObj
*
pShow
,
char
*
data
,
int32_t
rows
,
void
*
pConn
)
{
int32_t
numOfRows
=
0
;
char
*
pWrite
;
char
*
pWrite
;
char
*
moduleName
[
5
]
=
{
"MNODE"
,
"HTTP"
,
"MONITOR"
,
"MQTT"
,
"UNKNOWN"
};
while
(
numOfRows
<
rows
)
{
SDnodeObj
*
pDnode
=
NULL
;
...
...
@@ -802,28 +804,18 @@ int32_t mnodeRetrieveModules(SShowObj *pShow, char *data, int32_t rows, void *pC
cols
++
;
pWrite
=
data
+
pShow
->
offset
[
cols
]
*
rows
+
pShow
->
bytes
[
cols
]
*
numOfRows
;
strncpy
(
pWrite
,
pDnode
->
dnodeEp
,
pShow
->
bytes
[
cols
]
-
1
);
STR_WITH_MAXSIZE_TO_VARSTR
(
pWrite
,
pDnode
->
dnodeEp
,
pShow
->
bytes
[
cols
]
-
1
);
cols
++
;
pWrite
=
data
+
pShow
->
offset
[
cols
]
*
rows
+
pShow
->
bytes
[
cols
]
*
numOfRows
;
switch
(
moduleType
)
{
case
TSDB_MOD_MNODE
:
strcpy
(
pWrite
,
"mnode"
);
break
;
case
TSDB_MOD_HTTP
:
strcpy
(
pWrite
,
"http"
);
break
;
case
TSDB_MOD_MONITOR
:
strcpy
(
pWrite
,
"monitor"
);
break
;
default:
strcpy
(
pWrite
,
"unknown"
);
}
STR_WITH_MAXSIZE_TO_VARSTR
(
pWrite
,
moduleName
[
moduleType
],
pShow
->
bytes
[
cols
]);
cols
++
;
pWrite
=
data
+
pShow
->
offset
[
cols
]
*
rows
+
pShow
->
bytes
[
cols
]
*
numOfRows
;
bool
enable
=
mnodeCheckModuleInDnode
(
pDnode
,
moduleType
);
strcpy
(
pWrite
,
enable
?
"enable"
:
"disable"
);
char
*
v
=
enable
?
"enable"
:
"disable"
;
STR_TO_VARSTR
(
pWrite
,
v
);
cols
++
;
numOfRows
++
;
...
...
src/mnode/src/mnodeShow.c
浏览文件 @
ff20d564
...
...
@@ -98,7 +98,7 @@ static char *mnodeGetShowType(int32_t showType) {
case
TSDB_MGMT_TABLE_MODULE
:
return
"show modules"
;
case
TSDB_MGMT_TABLE_QUERIES
:
return
"show queries"
;
case
TSDB_MGMT_TABLE_STREAMS
:
return
"show streams"
;
case
TSDB_MGMT_TABLE_
CONFIG
S
:
return
"show configs"
;
case
TSDB_MGMT_TABLE_
VARIABLE
S
:
return
"show configs"
;
case
TSDB_MGMT_TABLE_CONNS
:
return
"show connections"
;
case
TSDB_MGMT_TABLE_SCORES
:
return
"show scores"
;
case
TSDB_MGMT_TABLE_GRANTS
:
return
"show grants"
;
...
...
src/query/inc/sql.y
浏览文件 @
ff20d564
...
...
@@ -73,7 +73,7 @@ cmd ::= SHOW MODULES. { setShowOptions(pInfo, TSDB_MGMT_TABLE_MODULE, 0, 0);
cmd ::= SHOW QUERIES. { setShowOptions(pInfo, TSDB_MGMT_TABLE_QUERIES, 0, 0); }
cmd ::= SHOW CONNECTIONS.{ setShowOptions(pInfo, TSDB_MGMT_TABLE_CONNS, 0, 0);}
cmd ::= SHOW STREAMS. { setShowOptions(pInfo, TSDB_MGMT_TABLE_STREAMS, 0, 0); }
cmd ::= SHOW
CONFIGS. { setShowOptions(pInfo, TSDB_MGMT_TABLE_CONFIG
S, 0, 0); }
cmd ::= SHOW
VARIABLES. { setShowOptions(pInfo, TSDB_MGMT_TABLE_VARIABLE
S, 0, 0); }
cmd ::= SHOW SCORES. { setShowOptions(pInfo, TSDB_MGMT_TABLE_SCORES, 0, 0); }
cmd ::= SHOW GRANTS. { setShowOptions(pInfo, TSDB_MGMT_TABLE_GRANTS, 0, 0); }
...
...
src/query/src/qTokenizer.c
浏览文件 @
ff20d564
...
...
@@ -85,7 +85,7 @@ static SKeyword keywordTable[] = {
{
"QUERIES"
,
TK_QUERIES
},
{
"CONNECTIONS"
,
TK_CONNECTIONS
},
{
"STREAMS"
,
TK_STREAMS
},
{
"
CONFIGS"
,
TK_CONFIG
S
},
{
"
VARIABLES"
,
TK_VARIABLE
S
},
{
"SCORES"
,
TK_SCORES
},
{
"GRANTS"
,
TK_GRANTS
},
{
"DOT"
,
TK_DOT
},
...
...
src/query/src/sql.c
浏览文件 @
ff20d564
...
...
@@ -488,7 +488,7 @@ static const YYCODETYPE yyFallback[] = {
0
,
/* QUERIES => nothing */
0
,
/* CONNECTIONS => nothing */
0
,
/* STREAMS => nothing */
0
,
/*
CONFIG
S => nothing */
0
,
/*
VARIABLE
S => nothing */
0
,
/* SCORES => nothing */
0
,
/* GRANTS => nothing */
0
,
/* VNODES => nothing */
...
...
@@ -781,7 +781,7 @@ static const char *const yyTokenName[] = {
/* 51 */
"QUERIES"
,
/* 52 */
"CONNECTIONS"
,
/* 53 */
"STREAMS"
,
/* 54 */
"
CONFIG
S"
,
/* 54 */
"
VARIABLE
S"
,
/* 55 */
"SCORES"
,
/* 56 */
"GRANTS"
,
/* 57 */
"VNODES"
,
...
...
@@ -1017,7 +1017,7 @@ static const char *const yyRuleName[] = {
/* 7 */
"cmd ::= SHOW QUERIES"
,
/* 8 */
"cmd ::= SHOW CONNECTIONS"
,
/* 9 */
"cmd ::= SHOW STREAMS"
,
/* 10 */
"cmd ::= SHOW
CONFIG
S"
,
/* 10 */
"cmd ::= SHOW
VARIABLE
S"
,
/* 11 */
"cmd ::= SHOW SCORES"
,
/* 12 */
"cmd ::= SHOW GRANTS"
,
/* 13 */
"cmd ::= SHOW VNODES"
,
...
...
@@ -1702,7 +1702,7 @@ static const struct {
{
209
,
-
2
},
/* (7) cmd ::= SHOW QUERIES */
{
209
,
-
2
},
/* (8) cmd ::= SHOW CONNECTIONS */
{
209
,
-
2
},
/* (9) cmd ::= SHOW STREAMS */
{
209
,
-
2
},
/* (10) cmd ::= SHOW
CONFIG
S */
{
209
,
-
2
},
/* (10) cmd ::= SHOW
VARIABLE
S */
{
209
,
-
2
},
/* (11) cmd ::= SHOW SCORES */
{
209
,
-
2
},
/* (12) cmd ::= SHOW GRANTS */
{
209
,
-
2
},
/* (13) cmd ::= SHOW VNODES */
...
...
@@ -2029,8 +2029,8 @@ static void yy_reduce(
case
9
:
/* cmd ::= SHOW STREAMS */
{
setShowOptions
(
pInfo
,
TSDB_MGMT_TABLE_STREAMS
,
0
,
0
);
}
break
;
case
10
:
/* cmd ::= SHOW
CONFIG
S */
{
setShowOptions
(
pInfo
,
TSDB_MGMT_TABLE_
CONFIG
S
,
0
,
0
);
}
case
10
:
/* cmd ::= SHOW
VARIABLE
S */
{
setShowOptions
(
pInfo
,
TSDB_MGMT_TABLE_
VARIABLE
S
,
0
,
0
);
}
break
;
case
11
:
/* cmd ::= SHOW SCORES */
{
setShowOptions
(
pInfo
,
TSDB_MGMT_TABLE_SCORES
,
0
,
0
);
}
...
...
@@ -2277,6 +2277,7 @@ static void yy_reduce(
yymsp
[
-
1
].
minor
.
yy268
=
yylhsminor
.
yy268
;
break
;
case
95
:
/* db_optr ::= db_optr fsync */
case
107
:
/* alter_db_optr ::= alter_db_optr fsync */
yytestcase
(
yyruleno
==
107
);
{
yylhsminor
.
yy268
=
yymsp
[
-
1
].
minor
.
yy268
;
yylhsminor
.
yy268
.
fsyncPeriod
=
strtol
(
yymsp
[
0
].
minor
.
yy0
.
z
,
NULL
,
10
);
}
yymsp
[
-
1
].
minor
.
yy268
=
yylhsminor
.
yy268
;
break
;
...
...
@@ -2297,10 +2298,6 @@ static void yy_reduce(
case
99
:
/* alter_db_optr ::= */
{
setDefaultCreateDbOption
(
&
yymsp
[
1
].
minor
.
yy268
);}
break
;
case
107
:
/* alter_db_optr ::= alter_db_optr fsync */
{
yylhsminor
.
yy268
=
yymsp
[
-
1
].
minor
.
yy268
;
yylhsminor
.
yy268
.
fsyncPeriod
=
strtol
(
yymsp
[
0
].
minor
.
yy0
.
z
,
NULL
,
10
);
}
yymsp
[
-
1
].
minor
.
yy268
=
yylhsminor
.
yy268
;
break
;
case
108
:
/* typename ::= ids */
{
yymsp
[
0
].
minor
.
yy0
.
type
=
0
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录