Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
46a3a58f
T
TDengine
项目概览
taosdata
/
TDengine
12 个月 前同步成功
通知
1180
Star
22014
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,发现更多精彩内容 >>
提交
46a3a58f
编写于
4月 20, 2022
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refactor:do some internal refactor.
上级
3c3c9c42
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
77 addition
and
84 deletion
+77
-84
include/common/tmsg.h
include/common/tmsg.h
+0
-1
source/common/src/tmsg.c
source/common/src/tmsg.c
+0
-2
source/dnode/mgmt/test/sut/src/sut.cpp
source/dnode/mgmt/test/sut/src/sut.cpp
+0
-1
source/dnode/mnode/impl/inc/mndDef.h
source/dnode/mnode/impl/inc/mndDef.h
+0
-1
source/dnode/mnode/impl/src/mndShow.c
source/dnode/mnode/impl/src/mndShow.c
+69
-11
source/libs/executor/inc/executorimpl.h
source/libs/executor/inc/executorimpl.h
+1
-2
source/libs/executor/src/scanoperator.c
source/libs/executor/src/scanoperator.c
+6
-65
source/libs/function/src/builtins.c
source/libs/function/src/builtins.c
+1
-1
未找到文件。
include/common/tmsg.h
浏览文件 @
46a3a58f
...
...
@@ -977,7 +977,6 @@ int32_t tDeserializeSShowRsp(void* buf, int32_t bufLen, SShowRsp* pRsp);
void
tFreeSShowRsp
(
SShowRsp
*
pRsp
);
typedef
struct
{
int32_t
type
;
char
db
[
TSDB_DB_FNAME_LEN
];
char
tb
[
TSDB_TABLE_NAME_LEN
];
int64_t
showId
;
...
...
source/common/src/tmsg.c
浏览文件 @
46a3a58f
...
...
@@ -2401,7 +2401,6 @@ int32_t tSerializeSRetrieveTableReq(void *buf, int32_t bufLen, SRetrieveTableReq
if
(
tStartEncode
(
&
encoder
)
<
0
)
return
-
1
;
if
(
tEncodeI64
(
&
encoder
,
pReq
->
showId
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
&
encoder
,
pReq
->
type
)
<
0
)
return
-
1
;
if
(
tEncodeCStr
(
&
encoder
,
pReq
->
db
)
<
0
)
return
-
1
;
if
(
tEncodeCStr
(
&
encoder
,
pReq
->
tb
)
<
0
)
return
-
1
;
tEndEncode
(
&
encoder
);
...
...
@@ -2417,7 +2416,6 @@ int32_t tDeserializeSRetrieveTableReq(void *buf, int32_t bufLen, SRetrieveTableR
if
(
tStartDecode
(
&
decoder
)
<
0
)
return
-
1
;
if
(
tDecodeI64
(
&
decoder
,
&
pReq
->
showId
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
&
decoder
,
&
pReq
->
type
)
<
0
)
return
-
1
;
if
(
tDecodeCStrTo
(
&
decoder
,
pReq
->
db
)
<
0
)
return
-
1
;
if
(
tDecodeCStrTo
(
&
decoder
,
pReq
->
tb
)
<
0
)
return
-
1
;
tEndDecode
(
&
decoder
);
...
...
source/dnode/mgmt/test/sut/src/sut.cpp
浏览文件 @
46a3a58f
...
...
@@ -89,7 +89,6 @@ int32_t Testbase::SendShowReq(int8_t showType, const char *tb, const char* db) {
}
SRetrieveTableReq
retrieveReq
=
{
0
};
retrieveReq
.
type
=
showType
;
strcpy
(
retrieveReq
.
db
,
db
);
strcpy
(
retrieveReq
.
tb
,
tb
);
...
...
source/dnode/mnode/impl/inc/mndDef.h
浏览文件 @
46a3a58f
...
...
@@ -390,7 +390,6 @@ typedef struct {
int16_t
numOfColumns
;
int32_t
rowSize
;
int32_t
numOfRows
;
int32_t
payloadLen
;
void
*
pIter
;
SMnode
*
pMnode
;
STableMetaRsp
*
pMeta
;
...
...
source/dnode/mnode/impl/src/mndShow.c
浏览文件 @
46a3a58f
...
...
@@ -18,7 +18,7 @@
#define SHOW_STEP_SIZE 100
static
SShowObj
*
mndCreateShowObj
(
SMnode
*
pMnode
,
S
Show
Req
*
pReq
);
static
SShowObj
*
mndCreateShowObj
(
SMnode
*
pMnode
,
S
RetrieveTable
Req
*
pReq
);
static
void
mndFreeShowObj
(
SShowObj
*
pShow
);
static
SShowObj
*
mndAcquireShowObj
(
SMnode
*
pMnode
,
int64_t
showId
);
static
void
mndReleaseShowObj
(
SShowObj
*
pShow
,
bool
forceRemove
);
...
...
@@ -47,18 +47,80 @@ void mndCleanupShow(SMnode *pMnode) {
}
}
static
SShowObj
*
mndCreateShowObj
(
SMnode
*
pMnode
,
SShowReq
*
pReq
)
{
static
int32_t
convertToRetrieveType
(
char
*
name
,
int32_t
len
)
{
int32_t
type
=
-
1
;
if
(
strncasecmp
(
name
,
TSDB_INS_TABLE_DNODES
,
len
)
==
0
)
{
type
=
TSDB_MGMT_TABLE_DNODE
;
}
else
if
(
strncasecmp
(
name
,
TSDB_INS_TABLE_MNODES
,
len
)
==
0
)
{
type
=
TSDB_MGMT_TABLE_MNODE
;
}
else
if
(
strncasecmp
(
name
,
TSDB_INS_TABLE_MODULES
,
len
)
==
0
)
{
type
=
TSDB_MGMT_TABLE_MODULE
;
}
else
if
(
strncasecmp
(
name
,
TSDB_INS_TABLE_QNODES
,
len
)
==
0
)
{
type
=
TSDB_MGMT_TABLE_QNODE
;
}
else
if
(
strncasecmp
(
name
,
TSDB_INS_TABLE_BNODES
,
len
)
==
0
)
{
type
=
TSDB_MGMT_TABLE_BNODE
;
}
else
if
(
strncasecmp
(
name
,
TSDB_INS_TABLE_SNODES
,
len
)
==
0
)
{
type
=
TSDB_MGMT_TABLE_SNODE
;
}
else
if
(
strncasecmp
(
name
,
TSDB_INS_TABLE_CLUSTER
,
len
)
==
0
)
{
type
=
TSDB_MGMT_TABLE_CLUSTER
;
}
else
if
(
strncasecmp
(
name
,
TSDB_INS_TABLE_USER_DATABASES
,
len
)
==
0
)
{
type
=
TSDB_MGMT_TABLE_DB
;
}
else
if
(
strncasecmp
(
name
,
TSDB_INS_TABLE_USER_FUNCTIONS
,
len
)
==
0
)
{
type
=
TSDB_MGMT_TABLE_FUNC
;
}
else
if
(
strncasecmp
(
name
,
TSDB_INS_TABLE_USER_INDEXES
,
len
)
==
0
)
{
// type = TSDB_MGMT_TABLE_INDEX;
}
else
if
(
strncasecmp
(
name
,
TSDB_INS_TABLE_USER_STABLES
,
len
)
==
0
)
{
type
=
TSDB_MGMT_TABLE_STB
;
}
else
if
(
strncasecmp
(
name
,
TSDB_INS_TABLE_USER_STREAMS
,
len
)
==
0
)
{
type
=
TSDB_MGMT_TABLE_STREAMS
;
}
else
if
(
strncasecmp
(
name
,
TSDB_INS_TABLE_USER_TABLES
,
len
)
==
0
)
{
type
=
TSDB_MGMT_TABLE_TABLE
;
}
else
if
(
strncasecmp
(
name
,
TSDB_INS_TABLE_USER_TABLE_DISTRIBUTED
,
len
)
==
0
)
{
// type = TSDB_MGMT_TABLE_DIST;
}
else
if
(
strncasecmp
(
name
,
TSDB_INS_TABLE_USER_USERS
,
len
)
==
0
)
{
type
=
TSDB_MGMT_TABLE_USER
;
}
else
if
(
strncasecmp
(
name
,
TSDB_INS_TABLE_LICENCES
,
len
)
==
0
)
{
type
=
TSDB_MGMT_TABLE_GRANTS
;
}
else
if
(
strncasecmp
(
name
,
TSDB_INS_TABLE_VGROUPS
,
len
)
==
0
)
{
type
=
TSDB_MGMT_TABLE_VGROUP
;
}
else
if
(
strncasecmp
(
name
,
TSDB_INS_TABLE_TOPICS
,
len
)
==
0
)
{
type
=
TSDB_MGMT_TABLE_TOPICS
;
}
else
if
(
strncasecmp
(
name
,
TSDB_INS_TABLE_CONSUMERS
,
len
)
==
0
)
{
type
=
TSDB_MGMT_TABLE_CONSUMERS
;
}
else
if
(
strncasecmp
(
name
,
TSDB_INS_TABLE_SUBSCRIBES
,
len
)
==
0
)
{
type
=
TSDB_MGMT_TABLE_SUBSCRIBES
;
}
else
if
(
strncasecmp
(
name
,
TSDB_INS_TABLE_TRANS
,
len
)
==
0
)
{
type
=
TSDB_MGMT_TABLE_TRANS
;
}
else
if
(
strncasecmp
(
name
,
TSDB_INS_TABLE_SMAS
,
len
)
==
0
)
{
type
=
TSDB_MGMT_TABLE_SMAS
;
}
else
if
(
strncasecmp
(
name
,
TSDB_INS_TABLE_CONFIGS
,
len
)
==
0
)
{
type
=
TSDB_MGMT_TABLE_CONFIGS
;
}
else
if
(
strncasecmp
(
name
,
TSDB_INS_TABLE_CONNS
,
len
)
==
0
)
{
type
=
TSDB_MGMT_TABLE_CONNS
;
}
else
if
(
strncasecmp
(
name
,
TSDB_INS_TABLE_QUERIES
,
len
)
==
0
)
{
type
=
TSDB_MGMT_TABLE_QUERIES
;
}
else
if
(
strncasecmp
(
name
,
TSDB_INS_TABLE_VNODES
,
len
)
==
0
)
{
type
=
TSDB_MGMT_TABLE_VNODES
;
}
else
{
// ASSERT(0);
}
return
type
;
}
static
SShowObj
*
mndCreateShowObj
(
SMnode
*
pMnode
,
SRetrieveTableReq
*
pReq
)
{
SShowMgmt
*
pMgmt
=
&
pMnode
->
showMgmt
;
int64_t
showId
=
atomic_add_fetch_64
(
&
pMgmt
->
showId
,
1
);
if
(
showId
==
0
)
atomic_add_fetch_64
(
&
pMgmt
->
showId
,
1
);
int32_t
size
=
sizeof
(
SShowObj
)
+
pReq
->
payloadLen
;
int32_t
size
=
sizeof
(
SShowObj
);
SShowObj
showObj
=
{
0
};
showObj
.
id
=
showId
;
showObj
.
id
=
showId
;
showObj
.
pMnode
=
pMnode
;
showObj
.
type
=
pReq
->
type
;
showObj
.
payloadLen
=
pReq
->
payloadLen
;
showObj
.
type
=
convertToRetrieveType
(
pReq
->
tb
,
tListLen
(
pReq
->
tb
));
memcpy
(
showObj
.
db
,
pReq
->
db
,
TSDB_DB_FNAME_LEN
);
int32_t
keepTime
=
tsShellActivityTimer
*
6
*
1000
;
...
...
@@ -127,10 +189,6 @@ static int32_t mndProcessRetrieveSysTableReq(SNodeMsg *pReq) {
}
if
(
retrieveReq
.
showId
==
0
)
{
SShowReq
req
=
{
0
};
req
.
type
=
retrieveReq
.
type
;
strncpy
(
req
.
db
,
retrieveReq
.
db
,
tListLen
(
req
.
db
));
STableMetaRsp
*
pMeta
=
(
STableMetaRsp
*
)
taosHashGet
(
pMnode
->
infosMeta
,
retrieveReq
.
tb
,
strlen
(
retrieveReq
.
tb
)
+
1
);
if
(
pMeta
==
NULL
)
{
terrno
=
TSDB_CODE_MND_INVALID_INFOS_TBL
;
...
...
@@ -138,7 +196,7 @@ static int32_t mndProcessRetrieveSysTableReq(SNodeMsg *pReq) {
return
-
1
;
}
pShow
=
mndCreateShowObj
(
pMnode
,
&
req
);
pShow
=
mndCreateShowObj
(
pMnode
,
&
re
trieveRe
q
);
if
(
pShow
==
NULL
)
{
terrno
=
TSDB_CODE_OUT_OF_MEMORY
;
mError
(
"failed to process show-meta req since %s"
,
terrstr
());
...
...
source/libs/executor/inc/executorimpl.h
浏览文件 @
46a3a58f
...
...
@@ -382,7 +382,7 @@ typedef struct SSysTableScanInfo {
void
*
pCur
;
// cursor for iterate the local table meta store.
SArray
*
scanCols
;
// SArray<int16_t> scan column id list
int32_t
type
;
// show type, TODO remove it
//
int32_t type; // show type, TODO remove it
SName
name
;
SSDataBlock
*
pRes
;
int32_t
capacity
;
...
...
@@ -600,7 +600,6 @@ typedef struct SJoinOperatorInfo {
int32_t
rightPos
;
SColumnInfo
rightCol
;
SNode
*
pOnCondition
;
// SRspResultInfo resultInfo;
}
SJoinOperatorInfo
;
int32_t
operatorDummyOpenFn
(
SOperatorInfo
*
pOperator
);
...
...
source/libs/executor/src/scanoperator.c
浏览文件 @
46a3a58f
...
...
@@ -663,7 +663,8 @@ static void destroySysScanOperator(void* param, int32_t numOfOutput) {
tsem_destroy
(
&
pInfo
->
ready
);
blockDataDestroy
(
pInfo
->
pRes
);
if
(
pInfo
->
type
==
TSDB_MGMT_TABLE_TABLE
)
{
const
char
*
name
=
tNameGetTableName
(
&
pInfo
->
name
);
if
(
strncasecmp
(
name
,
TSDB_INS_TABLE_USER_TABLES
,
TSDB_TABLE_FNAME_LEN
)
==
0
)
{
metaCloseTbCursor
(
pInfo
->
pCur
);
}
}
...
...
@@ -798,7 +799,8 @@ static SSDataBlock* doSysTableScan(SOperatorInfo* pOperator, bool* newgroup) {
SSysTableScanInfo
*
pInfo
=
pOperator
->
info
;
// retrieve local table list info from vnode
if
(
pInfo
->
type
==
TSDB_MGMT_TABLE_TABLE
)
{
const
char
*
name
=
tNameGetTableName
(
&
pInfo
->
name
);
if
(
strncasecmp
(
name
,
TSDB_INS_TABLE_USER_TABLES
,
TSDB_TABLE_FNAME_LEN
)
==
0
)
{
if
(
pInfo
->
pCur
==
NULL
)
{
pInfo
->
pCur
=
metaOpenTbCursor
(
pInfo
->
readHandle
);
}
...
...
@@ -850,8 +852,6 @@ static SSDataBlock* doSysTableScan(SOperatorInfo* pOperator, bool* newgroup) {
while
(
1
)
{
int64_t
startTs
=
taosGetTimestampUs
();
pInfo
->
req
.
type
=
pInfo
->
type
;
strncpy
(
pInfo
->
req
.
tb
,
tNameGetTableName
(
&
pInfo
->
name
),
tListLen
(
pInfo
->
req
.
tb
));
if
(
pInfo
->
showRewrite
)
{
...
...
@@ -933,68 +933,9 @@ SOperatorInfo* createSysTableScanOperatorInfo(void* pSysTableReadHandle, SSDataB
pInfo
->
pCondition
=
pCondition
;
pInfo
->
scanCols
=
colList
;
// TODO remove it
int32_t
tableType
=
0
;
const
char
*
name
=
tNameGetTableName
(
pName
);
if
(
strncasecmp
(
name
,
TSDB_INS_TABLE_DNODES
,
tListLen
(
pName
->
tname
))
==
0
)
{
tableType
=
TSDB_MGMT_TABLE_DNODE
;
}
else
if
(
strncasecmp
(
name
,
TSDB_INS_TABLE_MNODES
,
tListLen
(
pName
->
tname
))
==
0
)
{
tableType
=
TSDB_MGMT_TABLE_MNODE
;
}
else
if
(
strncasecmp
(
name
,
TSDB_INS_TABLE_MODULES
,
tListLen
(
pName
->
tname
))
==
0
)
{
tableType
=
TSDB_MGMT_TABLE_MODULE
;
}
else
if
(
strncasecmp
(
name
,
TSDB_INS_TABLE_QNODES
,
tListLen
(
pName
->
tname
))
==
0
)
{
tableType
=
TSDB_MGMT_TABLE_QNODE
;
}
else
if
(
strncasecmp
(
name
,
TSDB_INS_TABLE_BNODES
,
tListLen
(
pName
->
tname
))
==
0
)
{
tableType
=
TSDB_MGMT_TABLE_BNODE
;
}
else
if
(
strncasecmp
(
name
,
TSDB_INS_TABLE_SNODES
,
tListLen
(
pName
->
tname
))
==
0
)
{
tableType
=
TSDB_MGMT_TABLE_SNODE
;
}
else
if
(
strncasecmp
(
name
,
TSDB_INS_TABLE_CLUSTER
,
tListLen
(
pName
->
tname
))
==
0
)
{
tableType
=
TSDB_MGMT_TABLE_CLUSTER
;
}
else
if
(
strncasecmp
(
name
,
TSDB_INS_TABLE_USER_DATABASES
,
tListLen
(
pName
->
tname
))
==
0
)
{
tableType
=
TSDB_MGMT_TABLE_DB
;
}
else
if
(
strncasecmp
(
name
,
TSDB_INS_TABLE_USER_FUNCTIONS
,
tListLen
(
pName
->
tname
))
==
0
)
{
tableType
=
TSDB_MGMT_TABLE_FUNC
;
}
else
if
(
strncasecmp
(
name
,
TSDB_INS_TABLE_USER_INDEXES
,
tListLen
(
pName
->
tname
))
==
0
)
{
// tableType = TSDB_MGMT_TABLE_INDEX;
}
else
if
(
strncasecmp
(
name
,
TSDB_INS_TABLE_USER_STABLES
,
tListLen
(
pName
->
tname
))
==
0
)
{
tableType
=
TSDB_MGMT_TABLE_STB
;
}
else
if
(
strncasecmp
(
name
,
TSDB_INS_TABLE_USER_STREAMS
,
tListLen
(
pName
->
tname
))
==
0
)
{
tableType
=
TSDB_MGMT_TABLE_STREAMS
;
}
else
if
(
strncasecmp
(
name
,
TSDB_INS_TABLE_USER_TABLES
,
tListLen
(
pName
->
tname
))
==
0
)
{
tableType
=
TSDB_MGMT_TABLE_TABLE
;
}
else
if
(
strncasecmp
(
name
,
TSDB_INS_TABLE_USER_TABLE_DISTRIBUTED
,
tListLen
(
pName
->
tname
))
==
0
)
{
// tableType = TSDB_MGMT_TABLE_DIST;
}
else
if
(
strncasecmp
(
name
,
TSDB_INS_TABLE_USER_USERS
,
tListLen
(
pName
->
tname
))
==
0
)
{
tableType
=
TSDB_MGMT_TABLE_USER
;
}
else
if
(
strncasecmp
(
name
,
TSDB_INS_TABLE_LICENCES
,
tListLen
(
pName
->
tname
))
==
0
)
{
tableType
=
TSDB_MGMT_TABLE_GRANTS
;
}
else
if
(
strncasecmp
(
name
,
TSDB_INS_TABLE_VGROUPS
,
tListLen
(
pName
->
tname
))
==
0
)
{
tableType
=
TSDB_MGMT_TABLE_VGROUP
;
}
else
if
(
strncasecmp
(
name
,
TSDB_INS_TABLE_TOPICS
,
tListLen
(
pName
->
tname
))
==
0
)
{
tableType
=
TSDB_MGMT_TABLE_TOPICS
;
}
else
if
(
strncasecmp
(
name
,
TSDB_INS_TABLE_CONSUMERS
,
tListLen
(
pName
->
tname
))
==
0
)
{
tableType
=
TSDB_MGMT_TABLE_CONSUMERS
;
}
else
if
(
strncasecmp
(
name
,
TSDB_INS_TABLE_SUBSCRIBES
,
tListLen
(
pName
->
tname
))
==
0
)
{
tableType
=
TSDB_MGMT_TABLE_SUBSCRIBES
;
}
else
if
(
strncasecmp
(
name
,
TSDB_INS_TABLE_TRANS
,
tListLen
(
pName
->
tname
))
==
0
)
{
tableType
=
TSDB_MGMT_TABLE_TRANS
;
}
else
if
(
strncasecmp
(
name
,
TSDB_INS_TABLE_SMAS
,
tListLen
(
pName
->
tname
))
==
0
)
{
tableType
=
TSDB_MGMT_TABLE_SMAS
;
}
else
if
(
strncasecmp
(
name
,
TSDB_INS_TABLE_CONFIGS
,
tListLen
(
pName
->
tname
))
==
0
)
{
tableType
=
TSDB_MGMT_TABLE_CONFIGS
;
}
else
if
(
strncasecmp
(
name
,
TSDB_INS_TABLE_CONNS
,
tListLen
(
pName
->
tname
))
==
0
)
{
tableType
=
TSDB_MGMT_TABLE_CONNS
;
}
else
if
(
strncasecmp
(
name
,
TSDB_INS_TABLE_QUERIES
,
tListLen
(
pName
->
tname
))
==
0
)
{
tableType
=
TSDB_MGMT_TABLE_QUERIES
;
}
else
if
(
strncasecmp
(
name
,
TSDB_INS_TABLE_VNODES
,
tListLen
(
pName
->
tname
))
==
0
)
{
tableType
=
TSDB_MGMT_TABLE_VNODES
;
}
else
{
ASSERT
(
0
);
}
tNameAssign
(
&
pInfo
->
name
,
pName
);
pInfo
->
type
=
tableType
;
if
(
pInfo
->
type
==
TSDB_MGMT_TABLE_TABLE
)
{
const
char
*
name
=
tNameGetTableName
(
&
pInfo
->
name
)
;
if
(
strncasecmp
(
name
,
TSDB_INS_TABLE_USER_TABLES
,
TSDB_TABLE_FNAME_LEN
)
==
0
)
{
pInfo
->
readHandle
=
pSysTableReadHandle
;
blockDataEnsureCapacity
(
pInfo
->
pRes
,
pInfo
->
capacity
);
}
else
{
...
...
source/libs/function/src/builtins.c
浏览文件 @
46a3a58f
...
...
@@ -910,7 +910,7 @@ const SBuiltinFuncDefinition funcMgtBuiltins[] = {
},
{
.
name
=
"_wendts"
,
.
type
=
FUNCTION_TYPE_
Q
ENDTS
,
.
type
=
FUNCTION_TYPE_
W
ENDTS
,
.
classification
=
FUNC_MGT_PSEUDO_COLUMN_FUNC
|
FUNC_MGT_WINDOW_PC_FUNC
,
.
translateFunc
=
translateTimePseudoColumn
,
.
getEnvFunc
=
getTimePseudoFuncEnv
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录