Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
3f96f0ed
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
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看板
提交
3f96f0ed
编写于
12月 01, 2022
作者:
A
Alex Duan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat(mnode): modify keyword status to alive, conflict with log.dn fields
上级
0912aa64
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
38 addition
and
38 deletion
+38
-38
src/client/src/tscSQLParser.c
src/client/src/tscSQLParser.c
+1
-1
src/inc/taosmsg.h
src/inc/taosmsg.h
+2
-2
src/inc/ttokendef.h
src/inc/ttokendef.h
+1
-1
src/mnode/src/mnodeShow.c
src/mnode/src/mnodeShow.c
+2
-2
src/mnode/src/mnodeVgroup.c
src/mnode/src/mnodeVgroup.c
+15
-15
src/query/inc/sql.y
src/query/inc/sql.y
+6
-6
src/query/src/sql.c
src/query/src/sql.c
+10
-10
src/util/src/ttokenizer.c
src/util/src/ttokenizer.c
+1
-1
未找到文件。
src/client/src/tscSQLParser.c
浏览文件 @
3f96f0ed
...
...
@@ -4099,7 +4099,7 @@ int32_t setShowInfo(SSqlObj* pSql, struct SSqlInfo* pInfo) {
SShowInfo
*
pShowInfo
=
&
pInfo
->
pMiscInfo
->
showOpt
;
int16_t
showType
=
pShowInfo
->
showType
;
if
(
showType
==
TSDB_MGMT_TABLE_TABLE
||
showType
==
TSDB_MGMT_TABLE_METRIC
||
showType
==
TSDB_MGMT_TABLE_VGROUP
||
showType
==
TSDB_MGMT_
STATUS
_DB
)
{
showType
==
TSDB_MGMT_
ALIVE
_DB
)
{
// db prefix in tagCond, show table conds in payload
SStrToken
*
pDbPrefixToken
=
&
pShowInfo
->
prefix
;
if
(
pDbPrefixToken
->
type
!=
0
)
{
...
...
src/inc/taosmsg.h
浏览文件 @
3f96f0ed
...
...
@@ -163,8 +163,8 @@ enum _mgmt_table {
TSDB_MGMT_TABLE_CLUSTER
,
TSDB_MGMT_TABLE_TP
,
TSDB_MGMT_TABLE_FUNCTION
,
TSDB_MGMT_
STATUS
_DB
,
// show database status
TSDB_MGMT_
STATUS
_CLUSTER
,
// show cluster status
TSDB_MGMT_
ALIVE
_DB
,
// show database status
TSDB_MGMT_
ALIVE
_CLUSTER
,
// show cluster status
TSDB_MGMT_TABLE_MAX
,
};
...
...
src/inc/ttokendef.h
浏览文件 @
3f96f0ed
...
...
@@ -88,7 +88,7 @@
#define TK_TABLES 70
#define TK_STABLES 71
#define TK_VGROUPS 72
#define TK_
STATUS
73
#define TK_
ALIVE
73
#define TK_CLUSTER 74
#define TK_DROP 75
#define TK_TOPIC 76
...
...
src/mnode/src/mnodeShow.c
浏览文件 @
3f96f0ed
...
...
@@ -110,8 +110,8 @@ static char *mnodeGetShowType(int32_t showType) {
case
TSDB_MGMT_TABLE_CLUSTER
:
return
"show clusters"
;
case
TSDB_MGMT_TABLE_STREAMTABLES
:
return
"show streamtables"
;
case
TSDB_MGMT_TABLE_TP
:
return
"show topics"
;
case
TSDB_MGMT_
STATUS
_DB
:
return
"show database status"
;
case
TSDB_MGMT_
STATUS
_CLUSTER
:
return
"show cluster status"
;
case
TSDB_MGMT_
ALIVE
_DB
:
return
"show database status"
;
case
TSDB_MGMT_
ALIVE
_CLUSTER
:
return
"show cluster status"
;
default:
return
"undefined"
;
}
}
...
...
src/mnode/src/mnodeVgroup.c
浏览文件 @
3f96f0ed
...
...
@@ -59,9 +59,9 @@ static int32_t mnodeAllocVgroupIdPool(SVgObj *pInputVgroup);
static
int32_t
mnodeGetVgroupMeta
(
STableMetaMsg
*
pMeta
,
SShowObj
*
pShow
,
void
*
pConn
);
static
int32_t
mnodeRetrieveVgroups
(
SShowObj
*
pShow
,
char
*
data
,
int32_t
rows
,
void
*
pConn
);
// status
static
int32_t
mnodeGet
Status
Meta
(
STableMetaMsg
*
pMeta
,
SShowObj
*
pShow
,
void
*
pConn
);
static
int32_t
mnodeRetrieve
Status
Db
(
SShowObj
*
pShow
,
char
*
data
,
int32_t
rows
,
void
*
pConn
);
static
int32_t
mnodeRetrieve
Status
Cluster
(
SShowObj
*
pShow
,
char
*
data
,
int32_t
rows
,
void
*
pConn
);
static
int32_t
mnodeGet
Alive
Meta
(
STableMetaMsg
*
pMeta
,
SShowObj
*
pShow
,
void
*
pConn
);
static
int32_t
mnodeRetrieve
Alive
Db
(
SShowObj
*
pShow
,
char
*
data
,
int32_t
rows
,
void
*
pConn
);
static
int32_t
mnodeRetrieve
Alive
Cluster
(
SShowObj
*
pShow
,
char
*
data
,
int32_t
rows
,
void
*
pConn
);
static
void
mnodeProcessCreateVnodeRsp
(
SRpcMsg
*
rpcMsg
);
static
void
mnodeProcessAlterVnodeRsp
(
SRpcMsg
*
rpcMsg
);
...
...
@@ -241,13 +241,13 @@ int32_t mnodeInitVgroups() {
mnodeAddShowRetrieveHandle
(
TSDB_MGMT_TABLE_VGROUP
,
mnodeRetrieveVgroups
);
mnodeAddShowFreeIterHandle
(
TSDB_MGMT_TABLE_VGROUP
,
mnodeCancelGetNextVgroup
);
// cluster status
mnodeAddShowMetaHandle
(
TSDB_MGMT_
STATUS_CLUSTER
,
mnodeGetStatus
Meta
);
mnodeAddShowRetrieveHandle
(
TSDB_MGMT_
STATUS_CLUSTER
,
mnodeRetrieveStatus
Cluster
);
mnodeAddShowFreeIterHandle
(
TSDB_MGMT_
STATUS
_CLUSTER
,
mnodeCancelGetNextVgroup
);
mnodeAddShowMetaHandle
(
TSDB_MGMT_
ALIVE_CLUSTER
,
mnodeGetAlive
Meta
);
mnodeAddShowRetrieveHandle
(
TSDB_MGMT_
ALIVE_CLUSTER
,
mnodeRetrieveAlive
Cluster
);
mnodeAddShowFreeIterHandle
(
TSDB_MGMT_
ALIVE
_CLUSTER
,
mnodeCancelGetNextVgroup
);
// db status
mnodeAddShowMetaHandle
(
TSDB_MGMT_
STATUS_DB
,
mnodeGetStatus
Meta
);
mnodeAddShowRetrieveHandle
(
TSDB_MGMT_
STATUS_DB
,
mnodeRetrieveStatus
Db
);
mnodeAddShowFreeIterHandle
(
TSDB_MGMT_
STATUS
_DB
,
mnodeCancelGetNextVgroup
);
mnodeAddShowMetaHandle
(
TSDB_MGMT_
ALIVE_DB
,
mnodeGetAlive
Meta
);
mnodeAddShowRetrieveHandle
(
TSDB_MGMT_
ALIVE_DB
,
mnodeRetrieveAlive
Db
);
mnodeAddShowFreeIterHandle
(
TSDB_MGMT_
ALIVE
_DB
,
mnodeCancelGetNextVgroup
);
mnodeAddPeerRspHandle
(
TSDB_MSG_TYPE_MD_CREATE_VNODE_RSP
,
mnodeProcessCreateVnodeRsp
);
mnodeAddPeerRspHandle
(
TSDB_MSG_TYPE_MD_ALTER_VNODE_RSP
,
mnodeProcessAlterVnodeRsp
);
...
...
@@ -793,7 +793,7 @@ static int32_t mnodeGetVgroupMeta(STableMetaMsg *pMeta, SShowObj *pShow, void *p
return
0
;
}
static
int32_t
mnodeGet
Status
Meta
(
STableMetaMsg
*
pMeta
,
SShowObj
*
pShow
,
void
*
pConn
)
{
static
int32_t
mnodeGet
Alive
Meta
(
STableMetaMsg
*
pMeta
,
SShowObj
*
pShow
,
void
*
pConn
)
{
SSchema
*
pSchema
=
pMeta
->
schema
;
pShow
->
bytes
[
0
]
=
sizeof
(
int32_t
);
pSchema
[
0
].
type
=
TSDB_DATA_TYPE_INT
;
...
...
@@ -808,7 +808,7 @@ static int32_t mnodeGetStatusMeta(STableMetaMsg *pMeta, SShowObj *pShow, void *p
return
0
;
}
static
int32_t
mnodeRetrieve
Status
(
SShowObj
*
pShow
,
char
*
data
,
int32_t
rows
,
void
*
pConn
,
SDbObj
*
pDb
)
{
static
int32_t
mnodeRetrieve
Alive
(
SShowObj
*
pShow
,
char
*
data
,
int32_t
rows
,
void
*
pConn
,
SDbObj
*
pDb
)
{
SVgObj
*
pVgroup
=
NULL
;
int32_t
nAvailble
=
0
;
int32_t
nUnAvailble
=
0
;
...
...
@@ -865,11 +865,11 @@ static int32_t mnodeRetrieveStatus(SShowObj *pShow, char *data, int32_t rows, vo
return
1
;
}
static
int32_t
mnodeRetrieve
Status
Cluster
(
SShowObj
*
pShow
,
char
*
data
,
int32_t
rows
,
void
*
pConn
)
{
return
mnodeRetrieve
Status
(
pShow
,
data
,
rows
,
pConn
,
NULL
);
static
int32_t
mnodeRetrieve
Alive
Cluster
(
SShowObj
*
pShow
,
char
*
data
,
int32_t
rows
,
void
*
pConn
)
{
return
mnodeRetrieve
Alive
(
pShow
,
data
,
rows
,
pConn
,
NULL
);
}
static
int32_t
mnodeRetrieve
Status
Db
(
SShowObj
*
pShow
,
char
*
data
,
int32_t
rows
,
void
*
pConn
)
{
static
int32_t
mnodeRetrieve
Alive
Db
(
SShowObj
*
pShow
,
char
*
data
,
int32_t
rows
,
void
*
pConn
)
{
SDbObj
*
pDb
=
mnodeGetDb
(
pShow
->
db
);
if
(
pDb
==
NULL
)
return
0
;
...
...
@@ -880,7 +880,7 @@ static int32_t mnodeRetrieveStatusDb(SShowObj *pShow, char *data, int32_t rows,
return
0
;
}
int32_t
numOfRows
=
mnodeRetrieve
Status
(
pShow
,
data
,
rows
,
pConn
,
pDb
);
int32_t
numOfRows
=
mnodeRetrieve
Alive
(
pShow
,
data
,
rows
,
pConn
,
pDb
);
mnodeDecDbRef
(
pDb
);
return
numOfRows
;
...
...
src/query/inc/sql.y
浏览文件 @
3f96f0ed
...
...
@@ -127,17 +127,17 @@ cmd ::= SHOW dbPrefix(X) VGROUPS. {
setShowOptions(pInfo, TSDB_MGMT_TABLE_VGROUP, &token, 0);
}
// show db.
status
cmd ::= SHOW dbPrefix(X)
STATUS
. {
// show db.
alive
cmd ::= SHOW dbPrefix(X)
ALIVE
. {
SStrToken token;
tSetDbName(&token, &X);
setShowOptions(pInfo, TSDB_MGMT_
STATUS
_DB, &token, 0);
setShowOptions(pInfo, TSDB_MGMT_
ALIVE
_DB, &token, 0);
}
// show cluster
status
cmd ::= SHOW CLUSTER
STATUS
. {
// show cluster
alive
cmd ::= SHOW CLUSTER
ALIVE
. {
SStrToken token;
setShowOptions(pInfo, TSDB_MGMT_
STATUS
_CLUSTER, &token, 0);
setShowOptions(pInfo, TSDB_MGMT_
ALIVE
_CLUSTER, &token, 0);
}
//drop configure for tables
...
...
src/query/src/sql.c
浏览文件 @
3f96f0ed
...
...
@@ -632,7 +632,7 @@ static const YYCODETYPE yyFallback[] = {
0
,
/* TABLES => nothing */
0
,
/* STABLES => nothing */
0
,
/* VGROUPS => nothing */
0
,
/*
STATUS
=> nothing */
0
,
/*
ALIVE
=> nothing */
1
,
/* CLUSTER => ID */
0
,
/* DROP => nothing */
0
,
/* TOPIC => nothing */
...
...
@@ -925,7 +925,7 @@ static const char *const yyTokenName[] = {
/* 70 */
"TABLES"
,
/* 71 */
"STABLES"
,
/* 72 */
"VGROUPS"
,
/* 73 */
"
STATUS
"
,
/* 73 */
"
ALIVE
"
,
/* 74 */
"CLUSTER"
,
/* 75 */
"DROP"
,
/* 76 */
"TOPIC"
,
...
...
@@ -1182,8 +1182,8 @@ static const char *const yyRuleName[] = {
/* 26 */
"cmd ::= SHOW dbPrefix STABLES"
,
/* 27 */
"cmd ::= SHOW dbPrefix STABLES LIKE STRING"
,
/* 28 */
"cmd ::= SHOW dbPrefix VGROUPS"
,
/* 29 */
"cmd ::= SHOW dbPrefix
STATUS
"
,
/* 30 */
"cmd ::= SHOW CLUSTER
STATUS
"
,
/* 29 */
"cmd ::= SHOW dbPrefix
ALIVE
"
,
/* 30 */
"cmd ::= SHOW CLUSTER
ALIVE
"
,
/* 31 */
"cmd ::= DROP TABLE ifexists ids cpxName"
,
/* 32 */
"cmd ::= DROP STABLE ifexists ids cpxName"
,
/* 33 */
"cmd ::= DROP DATABASE ifexists ids"
,
...
...
@@ -1978,8 +1978,8 @@ static const struct {
{
209
,
-
3
},
/* (26) cmd ::= SHOW dbPrefix STABLES */
{
209
,
-
5
},
/* (27) cmd ::= SHOW dbPrefix STABLES LIKE STRING */
{
209
,
-
3
},
/* (28) cmd ::= SHOW dbPrefix VGROUPS */
{
209
,
-
3
},
/* (29) cmd ::= SHOW dbPrefix
STATUS
*/
{
209
,
-
3
},
/* (30) cmd ::= SHOW CLUSTER
STATUS
*/
{
209
,
-
3
},
/* (29) cmd ::= SHOW dbPrefix
ALIVE
*/
{
209
,
-
3
},
/* (30) cmd ::= SHOW CLUSTER
ALIVE
*/
{
209
,
-
5
},
/* (31) cmd ::= DROP TABLE ifexists ids cpxName */
{
209
,
-
5
},
/* (32) cmd ::= DROP STABLE ifexists ids cpxName */
{
209
,
-
4
},
/* (33) cmd ::= DROP DATABASE ifexists ids */
...
...
@@ -2473,17 +2473,17 @@ static void yy_reduce(
setShowOptions
(
pInfo
,
TSDB_MGMT_TABLE_VGROUP
,
&
token
,
0
);
}
break
;
case
29
:
/* cmd ::= SHOW dbPrefix
STATUS
*/
case
29
:
/* cmd ::= SHOW dbPrefix
ALIVE
*/
{
SStrToken
token
;
tSetDbName
(
&
token
,
&
yymsp
[
-
1
].
minor
.
yy0
);
setShowOptions
(
pInfo
,
TSDB_MGMT_
STATUS
_DB
,
&
token
,
0
);
setShowOptions
(
pInfo
,
TSDB_MGMT_
ALIVE
_DB
,
&
token
,
0
);
}
break
;
case
30
:
/* cmd ::= SHOW CLUSTER
STATUS
*/
case
30
:
/* cmd ::= SHOW CLUSTER
ALIVE
*/
{
SStrToken
token
;
setShowOptions
(
pInfo
,
TSDB_MGMT_
STATUS
_CLUSTER
,
&
token
,
0
);
setShowOptions
(
pInfo
,
TSDB_MGMT_
ALIVE
_CLUSTER
,
&
token
,
0
);
}
break
;
case
31
:
/* cmd ::= DROP TABLE ifexists ids cpxName */
...
...
src/util/src/ttokenizer.c
浏览文件 @
3f96f0ed
...
...
@@ -230,7 +230,7 @@ static SKeyword keywordTable[] = {
{
"CONTAINS"
,
TK_CONTAINS
},
{
"TO"
,
TK_TO
},
{
"SPLIT"
,
TK_SPLIT
},
{
"
STATUS"
,
TK_STATUS
},
{
"
ALIVE"
,
TK_ALIVE
},
{
"CLUSTER"
,
TK_CLUSTER
},
{
"DELETE"
,
TK_DELETE
}
};
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录