Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
3b772168
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看板
提交
3b772168
编写于
1月 23, 2022
作者:
S
Shengliang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
TD-12785
上级
802f0622
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
44 addition
and
44 deletion
+44
-44
include/common/tmsg.h
include/common/tmsg.h
+1
-1
include/common/tmsgdef.h
include/common/tmsgdef.h
+3
-3
source/dnode/mgmt/impl/src/dndTransport.c
source/dnode/mgmt/impl/src/dndTransport.c
+3
-3
source/dnode/mnode/impl/src/mndFunc.c
source/dnode/mnode/impl/src/mndFunc.c
+34
-34
source/dnode/mnode/impl/src/mndShow.c
source/dnode/mnode/impl/src/mndShow.c
+1
-1
source/libs/parser/inc/sql.y
source/libs/parser/inc/sql.y
+1
-1
source/libs/parser/src/sql.c
source/libs/parser/src/sql.c
+1
-1
未找到文件。
include/common/tmsg.h
浏览文件 @
3b772168
...
...
@@ -100,7 +100,7 @@ typedef enum _mgmt_table {
TSDB_MGMT_TABLE_CLUSTER
,
TSDB_MGMT_TABLE_STREAMTABLES
,
TSDB_MGMT_TABLE_TP
,
TSDB_MGMT_TABLE_FUNC
TION
,
TSDB_MGMT_TABLE_FUNC
,
TSDB_MGMT_TABLE_MAX
,
}
EShowType
;
...
...
include/common/tmsgdef.h
浏览文件 @
3b772168
...
...
@@ -119,9 +119,9 @@ enum {
TD_DEF_MSG_TYPE
(
TDMT_MND_ALTER_DB
,
"mnode-alter-db"
,
NULL
,
NULL
)
TD_DEF_MSG_TYPE
(
TDMT_MND_SYNC_DB
,
"mnode-sync-db"
,
NULL
,
NULL
)
TD_DEF_MSG_TYPE
(
TDMT_MND_COMPACT_DB
,
"mnode-compact-db"
,
NULL
,
NULL
)
TD_DEF_MSG_TYPE
(
TDMT_MND_CREATE_FUNC
TION
,
"mnode-create-function
"
,
NULL
,
NULL
)
TD_DEF_MSG_TYPE
(
TDMT_MND_RETRIEVE_FUNC
TION
,
"mnode-retrieve-function
"
,
NULL
,
NULL
)
TD_DEF_MSG_TYPE
(
TDMT_MND_DROP_FUNC
TION
,
"mnode-drop-function
"
,
NULL
,
NULL
)
TD_DEF_MSG_TYPE
(
TDMT_MND_CREATE_FUNC
,
"mnode-create-func
"
,
NULL
,
NULL
)
TD_DEF_MSG_TYPE
(
TDMT_MND_RETRIEVE_FUNC
,
"mnode-retrieve-func
"
,
NULL
,
NULL
)
TD_DEF_MSG_TYPE
(
TDMT_MND_DROP_FUNC
,
"mnode-drop-func
"
,
NULL
,
NULL
)
TD_DEF_MSG_TYPE
(
TDMT_MND_CREATE_STB
,
"mnode-create-stb"
,
NULL
,
NULL
)
TD_DEF_MSG_TYPE
(
TDMT_MND_ALTER_STB
,
"mnode-alter-stb"
,
NULL
,
NULL
)
TD_DEF_MSG_TYPE
(
TDMT_MND_DROP_STB
,
"mnode-drop-stb"
,
NULL
,
NULL
)
...
...
source/dnode/mgmt/impl/src/dndTransport.c
浏览文件 @
3b772168
...
...
@@ -90,9 +90,9 @@ static void dndInitMsgFp(STransMgmt *pMgmt) {
pMgmt
->
msgFp
[
TMSG_INDEX
(
TDMT_MND_ALTER_DB
)]
=
dndProcessMnodeWriteMsg
;
pMgmt
->
msgFp
[
TMSG_INDEX
(
TDMT_MND_SYNC_DB
)]
=
dndProcessMnodeWriteMsg
;
pMgmt
->
msgFp
[
TMSG_INDEX
(
TDMT_MND_COMPACT_DB
)]
=
dndProcessMnodeWriteMsg
;
pMgmt
->
msgFp
[
TMSG_INDEX
(
TDMT_MND_CREATE_FUNC
TION
)]
=
dndProcessMnodeWriteMsg
;
pMgmt
->
msgFp
[
TMSG_INDEX
(
TDMT_MND_RETRIEVE_FUNC
TION
)]
=
dndProcessMnodeWriteMsg
;
pMgmt
->
msgFp
[
TMSG_INDEX
(
TDMT_MND_DROP_FUNC
TION
)]
=
dndProcessMnodeWriteMsg
;
pMgmt
->
msgFp
[
TMSG_INDEX
(
TDMT_MND_CREATE_FUNC
)]
=
dndProcessMnodeWriteMsg
;
pMgmt
->
msgFp
[
TMSG_INDEX
(
TDMT_MND_RETRIEVE_FUNC
)]
=
dndProcessMnodeWriteMsg
;
pMgmt
->
msgFp
[
TMSG_INDEX
(
TDMT_MND_DROP_FUNC
)]
=
dndProcessMnodeWriteMsg
;
pMgmt
->
msgFp
[
TMSG_INDEX
(
TDMT_MND_CREATE_STB
)]
=
dndProcessMnodeWriteMsg
;
pMgmt
->
msgFp
[
TMSG_INDEX
(
TDMT_MND_ALTER_STB
)]
=
dndProcessMnodeWriteMsg
;
pMgmt
->
msgFp
[
TMSG_INDEX
(
TDMT_MND_DROP_STB
)]
=
dndProcessMnodeWriteMsg
;
...
...
source/dnode/mnode/impl/src/mndFunc.c
浏览文件 @
3b772168
...
...
@@ -26,13 +26,13 @@ static SSdbRow *mndFuncActionDecode(SSdbRaw *pRaw);
static
int32_t
mndFuncActionInsert
(
SSdb
*
pSdb
,
SFuncObj
*
pFunc
);
static
int32_t
mndFuncActionDelete
(
SSdb
*
pSdb
,
SFuncObj
*
pFunc
);
static
int32_t
mndFuncActionUpdate
(
SSdb
*
pSdb
,
SFuncObj
*
pOldFunc
,
SFuncObj
*
pNewFunc
);
static
int32_t
mndCreateFunc
(
SMnode
*
pMnode
,
SMnodeMsg
*
p
Msg
,
SCreateFuncReq
*
pCreate
);
static
int32_t
mndDropFunc
(
SMnode
*
pMnode
,
SMnodeMsg
*
p
Msg
,
SFuncObj
*
pFunc
);
static
int32_t
mndProcessCreateFunc
Msg
(
SMnodeMsg
*
pMsg
);
static
int32_t
mndProcessDropFunc
Msg
(
SMnodeMsg
*
pMsg
);
static
int32_t
mndProcessRetrieveFunc
Msg
(
SMnodeMsg
*
pMsg
);
static
int32_t
mndGetFuncMeta
(
SMnodeMsg
*
p
Msg
,
SShowObj
*
pShow
,
STableMetaRsp
*
pMeta
);
static
int32_t
mndRetrieveFuncs
(
SMnodeMsg
*
p
Msg
,
SShowObj
*
pShow
,
char
*
data
,
int32_t
rows
);
static
int32_t
mndCreateFunc
(
SMnode
*
pMnode
,
SMnodeMsg
*
p
Req
,
SCreateFuncReq
*
pCreate
);
static
int32_t
mndDropFunc
(
SMnode
*
pMnode
,
SMnodeMsg
*
p
Req
,
SFuncObj
*
pFunc
);
static
int32_t
mndProcessCreateFunc
Req
(
SMnodeMsg
*
pReq
);
static
int32_t
mndProcessDropFunc
Req
(
SMnodeMsg
*
pReq
);
static
int32_t
mndProcessRetrieveFunc
Req
(
SMnodeMsg
*
pReq
);
static
int32_t
mndGetFuncMeta
(
SMnodeMsg
*
p
Req
,
SShowObj
*
pShow
,
STableMetaRsp
*
pMeta
);
static
int32_t
mndRetrieveFuncs
(
SMnodeMsg
*
p
Req
,
SShowObj
*
pShow
,
char
*
data
,
int32_t
rows
);
static
void
mndCancelGetNextFunc
(
SMnode
*
pMnode
,
void
*
pIter
);
int32_t
mndInitFunc
(
SMnode
*
pMnode
)
{
...
...
@@ -44,13 +44,13 @@ int32_t mndInitFunc(SMnode *pMnode) {
.
updateFp
=
(
SdbUpdateFp
)
mndFuncActionUpdate
,
.
deleteFp
=
(
SdbDeleteFp
)
mndFuncActionDelete
};
mndSetMsgHandle
(
pMnode
,
TDMT_MND_CREATE_FUNC
TION
,
mndProcessCreateFuncMsg
);
mndSetMsgHandle
(
pMnode
,
TDMT_MND_DROP_FUNC
TION
,
mndProcessDropFuncMsg
);
mndSetMsgHandle
(
pMnode
,
TDMT_MND_RETRIEVE_FUNC
TION
,
mndProcessRetrieveFuncMsg
);
mndSetMsgHandle
(
pMnode
,
TDMT_MND_CREATE_FUNC
,
mndProcessCreateFuncReq
);
mndSetMsgHandle
(
pMnode
,
TDMT_MND_DROP_FUNC
,
mndProcessDropFuncReq
);
mndSetMsgHandle
(
pMnode
,
TDMT_MND_RETRIEVE_FUNC
,
mndProcessRetrieveFuncReq
);
mndAddShowMetaHandle
(
pMnode
,
TSDB_MGMT_TABLE_FUNC
TION
,
mndGetFuncMeta
);
mndAddShowRetrieveHandle
(
pMnode
,
TSDB_MGMT_TABLE_FUNC
TION
,
mndRetrieveFuncs
);
mndAddShowFreeIterHandle
(
pMnode
,
TSDB_MGMT_TABLE_FUNC
TION
,
mndCancelGetNextFunc
);
mndAddShowMetaHandle
(
pMnode
,
TSDB_MGMT_TABLE_FUNC
,
mndGetFuncMeta
);
mndAddShowRetrieveHandle
(
pMnode
,
TSDB_MGMT_TABLE_FUNC
,
mndRetrieveFuncs
);
mndAddShowFreeIterHandle
(
pMnode
,
TSDB_MGMT_TABLE_FUNC
,
mndCancelGetNextFunc
);
return
sdbSetTable
(
pMnode
->
pSdb
,
table
);
}
...
...
@@ -156,7 +156,7 @@ static int32_t mndFuncActionUpdate(SSdb *pSdb, SFuncObj *pOldFunc, SFuncObj *pNe
return
0
;
}
static
int32_t
mndCreateFunc
(
SMnode
*
pMnode
,
SMnodeMsg
*
p
Msg
,
SCreateFuncReq
*
pCreate
)
{
static
int32_t
mndCreateFunc
(
SMnode
*
pMnode
,
SMnodeMsg
*
p
Req
,
SCreateFuncReq
*
pCreate
)
{
SFuncObj
*
pFunc
=
calloc
(
1
,
sizeof
(
SFuncObj
)
+
pCreate
->
commentSize
+
pCreate
->
codeSize
);
pFunc
->
createdTime
=
taosGetTimestampMs
();
pFunc
->
funcType
=
pCreate
->
funcType
;
...
...
@@ -172,7 +172,7 @@ static int32_t mndCreateFunc(SMnode *pMnode, SMnodeMsg *pMsg, SCreateFuncReq *pC
pFunc
->
pCode
=
pFunc
->
pData
+
pCreate
->
commentSize
;
memcpy
(
pFunc
->
pCode
,
pCreate
->
pCont
+
pCreate
->
commentSize
,
pFunc
->
codeSize
);
STrans
*
pTrans
=
mndTransCreate
(
pMnode
,
TRN_POLICY_ROLLBACK
,
&
p
Msg
->
rpcMsg
);
STrans
*
pTrans
=
mndTransCreate
(
pMnode
,
TRN_POLICY_ROLLBACK
,
&
p
Req
->
rpcMsg
);
if
(
pTrans
==
NULL
)
{
free
(
pFunc
);
mError
(
"func:%s, failed to create since %s"
,
pCreate
->
name
,
terrstr
());
...
...
@@ -219,8 +219,8 @@ static int32_t mndCreateFunc(SMnode *pMnode, SMnodeMsg *pMsg, SCreateFuncReq *pC
return
0
;
}
static
int32_t
mndDropFunc
(
SMnode
*
pMnode
,
SMnodeMsg
*
p
Msg
,
SFuncObj
*
pFunc
)
{
STrans
*
pTrans
=
mndTransCreate
(
pMnode
,
TRN_POLICY_ROLLBACK
,
&
p
Msg
->
rpcMsg
);
static
int32_t
mndDropFunc
(
SMnode
*
pMnode
,
SMnodeMsg
*
p
Req
,
SFuncObj
*
pFunc
)
{
STrans
*
pTrans
=
mndTransCreate
(
pMnode
,
TRN_POLICY_ROLLBACK
,
&
p
Req
->
rpcMsg
);
if
(
pTrans
==
NULL
)
{
mError
(
"func:%s, failed to drop since %s"
,
pFunc
->
name
,
terrstr
());
return
-
1
;
...
...
@@ -261,10 +261,10 @@ static int32_t mndDropFunc(SMnode *pMnode, SMnodeMsg *pMsg, SFuncObj *pFunc) {
return
0
;
}
static
int32_t
mndProcessCreateFunc
Msg
(
SMnodeMsg
*
pMsg
)
{
SMnode
*
pMnode
=
p
Msg
->
pMnode
;
static
int32_t
mndProcessCreateFunc
Req
(
SMnodeMsg
*
pReq
)
{
SMnode
*
pMnode
=
p
Req
->
pMnode
;
SCreateFuncReq
*
pCreate
=
p
Msg
->
rpcMsg
.
pCont
;
SCreateFuncReq
*
pCreate
=
p
Req
->
rpcMsg
.
pCont
;
pCreate
->
outputLen
=
htonl
(
pCreate
->
outputLen
);
pCreate
->
bufSize
=
htonl
(
pCreate
->
bufSize
);
pCreate
->
sigature
=
htobe64
(
pCreate
->
sigature
);
...
...
@@ -311,7 +311,7 @@ static int32_t mndProcessCreateFuncMsg(SMnodeMsg *pMsg) {
return
-
1
;
}
int32_t
code
=
mndCreateFunc
(
pMnode
,
p
Msg
,
pCreate
);
int32_t
code
=
mndCreateFunc
(
pMnode
,
p
Req
,
pCreate
);
if
(
code
!=
0
)
{
mError
(
"func:%s, failed to create since %s"
,
pCreate
->
name
,
terrstr
());
...
...
@@ -321,9 +321,9 @@ static int32_t mndProcessCreateFuncMsg(SMnodeMsg *pMsg) {
return
TSDB_CODE_MND_ACTION_IN_PROGRESS
;
}
static
int32_t
mndProcessDropFunc
Msg
(
SMnodeMsg
*
pMsg
)
{
SMnode
*
pMnode
=
p
Msg
->
pMnode
;
SDropFuncReq
*
pDrop
=
p
Msg
->
rpcMsg
.
pCont
;
static
int32_t
mndProcessDropFunc
Req
(
SMnodeMsg
*
pReq
)
{
SMnode
*
pMnode
=
p
Req
->
pMnode
;
SDropFuncReq
*
pDrop
=
p
Req
->
rpcMsg
.
pCont
;
mDebug
(
"func:%s, start to drop"
,
pDrop
->
name
);
...
...
@@ -340,7 +340,7 @@ static int32_t mndProcessDropFuncMsg(SMnodeMsg *pMsg) {
return
-
1
;
}
int32_t
code
=
mndDropFunc
(
pMnode
,
p
Msg
,
pFunc
);
int32_t
code
=
mndDropFunc
(
pMnode
,
p
Req
,
pFunc
);
if
(
code
!=
0
)
{
mError
(
"func:%s, failed to drop since %s"
,
pDrop
->
name
,
terrstr
());
...
...
@@ -350,10 +350,10 @@ static int32_t mndProcessDropFuncMsg(SMnodeMsg *pMsg) {
return
TSDB_CODE_MND_ACTION_IN_PROGRESS
;
}
static
int32_t
mndProcessRetrieveFunc
Msg
(
SMnodeMsg
*
pMsg
)
{
SMnode
*
pMnode
=
p
Msg
->
pMnode
;
static
int32_t
mndProcessRetrieveFunc
Req
(
SMnodeMsg
*
pReq
)
{
SMnode
*
pMnode
=
p
Req
->
pMnode
;
SRetrieveFuncReq
*
pRetrieve
=
p
Msg
->
rpcMsg
.
pCont
;
SRetrieveFuncReq
*
pRetrieve
=
p
Req
->
rpcMsg
.
pCont
;
pRetrieve
->
numOfFuncs
=
htonl
(
pRetrieve
->
numOfFuncs
);
int32_t
size
=
sizeof
(
SRetrieveFuncRsp
)
+
(
sizeof
(
SFuncInfo
)
+
TSDB_FUNC_CODE_LEN
)
*
pRetrieve
->
numOfFuncs
+
16384
;
...
...
@@ -389,14 +389,14 @@ static int32_t mndProcessRetrieveFuncMsg(SMnodeMsg *pMsg) {
pOutput
+=
sizeof
(
SFuncInfo
)
+
pFunc
->
commentSize
+
pFunc
->
codeSize
;
}
p
Msg
->
pCont
=
pRetrieveRsp
;
p
Msg
->
contLen
=
(
int32_t
)(
pOutput
-
(
char
*
)
pRetrieveRsp
);
p
Req
->
pCont
=
pRetrieveRsp
;
p
Req
->
contLen
=
(
int32_t
)(
pOutput
-
(
char
*
)
pRetrieveRsp
);
return
0
;
}
static
int32_t
mndGetFuncMeta
(
SMnodeMsg
*
p
Msg
,
SShowObj
*
pShow
,
STableMetaRsp
*
pMeta
)
{
SMnode
*
pMnode
=
p
Msg
->
pMnode
;
static
int32_t
mndGetFuncMeta
(
SMnodeMsg
*
p
Req
,
SShowObj
*
pShow
,
STableMetaRsp
*
pMeta
)
{
SMnode
*
pMnode
=
p
Req
->
pMnode
;
SSdb
*
pSdb
=
pMnode
->
pSdb
;
int32_t
cols
=
0
;
...
...
@@ -477,8 +477,8 @@ static void *mnodeGenTypeStr(char *buf, int32_t buflen, uint8_t type, int16_t le
return
tDataTypes
[
type
].
name
;
}
static
int32_t
mndRetrieveFuncs
(
SMnodeMsg
*
p
Msg
,
SShowObj
*
pShow
,
char
*
data
,
int32_t
rows
)
{
SMnode
*
pMnode
=
p
Msg
->
pMnode
;
static
int32_t
mndRetrieveFuncs
(
SMnodeMsg
*
p
Req
,
SShowObj
*
pShow
,
char
*
data
,
int32_t
rows
)
{
SMnode
*
pMnode
=
p
Req
->
pMnode
;
SSdb
*
pSdb
=
pMnode
->
pSdb
;
int32_t
numOfRows
=
0
;
SFuncObj
*
pFunc
=
NULL
;
...
...
source/dnode/mnode/impl/src/mndShow.c
浏览文件 @
3b772168
...
...
@@ -296,7 +296,7 @@ char *mndShowStr(int32_t showType) {
return
"show streamtables"
;
case
TSDB_MGMT_TABLE_TP
:
return
"show topics"
;
case
TSDB_MGMT_TABLE_FUNC
TION
:
case
TSDB_MGMT_TABLE_FUNC
:
return
"show functions"
;
default:
return
"undefined"
;
...
...
source/libs/parser/inc/sql.y
浏览文件 @
3b772168
...
...
@@ -65,7 +65,7 @@ program ::= cmd. {}
//////////////////////////////////THE SHOW STATEMENT///////////////////////////////////////////
cmd ::= SHOW DATABASES. { setShowOptions(pInfo, TSDB_MGMT_TABLE_DB, 0, 0);}
cmd ::= SHOW TOPICS. { setShowOptions(pInfo, TSDB_MGMT_TABLE_TP, 0, 0);}
cmd ::= SHOW FUNCTIONS. { setShowOptions(pInfo, TSDB_MGMT_TABLE_FUNC
TION
, 0, 0);}
cmd ::= SHOW FUNCTIONS. { setShowOptions(pInfo, TSDB_MGMT_TABLE_FUNC, 0, 0);}
cmd ::= SHOW MNODES. { setShowOptions(pInfo, TSDB_MGMT_TABLE_MNODE, 0, 0);}
cmd ::= SHOW DNODES. { setShowOptions(pInfo, TSDB_MGMT_TABLE_DNODE, 0, 0);}
cmd ::= SHOW ACCOUNTS. { setShowOptions(pInfo, TSDB_MGMT_TABLE_ACCT, 0, 0);}
...
...
source/libs/parser/src/sql.c
浏览文件 @
3b772168
...
...
@@ -2232,7 +2232,7 @@ static void yy_reduce(
{
setShowOptions
(
pInfo
,
TSDB_MGMT_TABLE_TP
,
0
,
0
);}
break
;
case
3
:
/* cmd ::= SHOW FUNCTIONS */
{
setShowOptions
(
pInfo
,
TSDB_MGMT_TABLE_FUNC
TION
,
0
,
0
);}
{
setShowOptions
(
pInfo
,
TSDB_MGMT_TABLE_FUNC
,
0
,
0
);}
break
;
case
4
:
/* cmd ::= SHOW MNODES */
{
setShowOptions
(
pInfo
,
TSDB_MGMT_TABLE_MNODE
,
0
,
0
);}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录