Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
b0a4cc81
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1187
Star
22018
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看板
提交
b0a4cc81
编写于
3月 04, 2022
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[td-13039] refactor and fix bugs.
上级
024dd996
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
37 addition
and
7 deletion
+37
-7
source/libs/executor/test/executorTests.cpp
source/libs/executor/test/executorTests.cpp
+13
-7
source/libs/parser/test/mockCatalog.cpp
source/libs/parser/test/mockCatalog.cpp
+6
-0
source/libs/parser/test/mockCatalogService.cpp
source/libs/parser/test/mockCatalogService.cpp
+17
-0
source/libs/parser/test/mockCatalogService.h
source/libs/parser/test/mockCatalogService.h
+1
-0
未找到文件。
source/libs/executor/test/executorTests.cpp
浏览文件 @
b0a4cc81
...
...
@@ -224,7 +224,7 @@ int main(int argc, char** argv) {
TEST
(
testCase
,
build_executor_tree_Test
)
{
const
char
*
msg
=
"{
\n
"
"
\"
NodeType
\"
:
\"
4
7
\"
,
\n
"
"
\"
NodeType
\"
:
\"
4
8
\"
,
\n
"
"
\"
Name
\"
:
\"
PhysiSubplan
\"
,
\n
"
"
\"
PhysiSubplan
\"
: {
\n
"
"
\"
Id
\"
: {
\n
"
...
...
@@ -233,15 +233,21 @@ TEST(testCase, build_executor_tree_Test) {
"
\"
SubplanId
\"
:
\"
0
\"\n
"
" },
\n
"
"
\"
SubplanType
\"
:
\"
0
\"
,
\n
"
"
\"
MsgType
\"
:
\"
0
\"
,
\n
"
"
\"
MsgType
\"
:
\"
515
\"
,
\n
"
"
\"
Level
\"
:
\"
0
\"
,
\n
"
"
\"
NodeAddr
\"
: {
\n
"
"
\"
Id
\"
:
\"
0
\"
,
\n
"
"
\"
Id
\"
:
\"
1
\"
,
\n
"
"
\"
InUse
\"
:
\"
0
\"
,
\n
"
"
\"
NumOfEps
\"
:
\"
0
\"\n
"
"
\"
NumOfEps
\"
:
\"
1
\"
,
\n
"
"
\"
Eps
\"
: [
\n
"
" {
\n
"
"
\"
Fqdn
\"
:
\"
node1
\"
,
\n
"
"
\"
Port
\"
:
\"
6030
\"\n
"
" }
\n
"
" ]
\n
"
" },
\n
"
"
\"
RootNode
\"
: {
\n
"
"
\"
NodeType
\"
:
\"
4
0
\"
,
\n
"
"
\"
NodeType
\"
:
\"
4
1
\"
,
\n
"
"
\"
Name
\"
:
\"
PhysiProject
\"
,
\n
"
"
\"
PhysiProject
\"
: {
\n
"
"
\"
OutputDataBlockDesc
\"
: {
\n
"
...
...
@@ -345,7 +351,7 @@ TEST(testCase, build_executor_tree_Test) {
" },
\n
"
"
\"
Children
\"
: [
\n
"
" {
\n
"
"
\"
NodeType
\"
:
\"
3
7
\"
,
\n
"
"
\"
NodeType
\"
:
\"
3
8
\"
,
\n
"
"
\"
Name
\"
:
\"
PhysiTableScan
\"
,
\n
"
"
\"
PhysiTableScan
\"
: {
\n
"
"
\"
OutputDataBlockDesc
\"
: {
\n
"
...
...
@@ -825,7 +831,7 @@ TEST(testCase, build_executor_tree_Test) {
" }
\n
"
" },
\n
"
"
\"
DataSink
\"
: {
\n
"
"
\"
NodeType
\"
:
\"
4
5
\"
,
\n
"
"
\"
NodeType
\"
:
\"
4
6
\"
,
\n
"
"
\"
Name
\"
:
\"
PhysiDispatch
\"
,
\n
"
"
\"
PhysiDispatch
\"
: {
\n
"
"
\"
InputDataBlockDesc
\"
: {
\n
"
...
...
source/libs/parser/test/mockCatalog.cpp
浏览文件 @
b0a4cc81
...
...
@@ -58,6 +58,10 @@ int32_t __catalogGetTableHashVgroup(struct SCatalog* pCatalog, void *pRpc, const
return
mockCatalogService
->
catalogGetTableHashVgroup
(
pTableName
,
vgInfo
);
}
int32_t
__catalogGetTableDistVgInfo
(
SCatalog
*
pCtg
,
void
*
pRpc
,
const
SEpSet
*
pMgmtEps
,
const
SName
*
pTableName
,
SArray
**
pVgList
)
{
return
mockCatalogService
->
catalogGetTableDistVgInfo
(
pTableName
,
pVgList
);
}
void
initMetaDataEnv
()
{
mockCatalogService
.
reset
(
new
MockCatalogService
());
...
...
@@ -65,6 +69,8 @@ void initMetaDataEnv() {
stub
.
set
(
catalogGetHandle
,
__catalogGetHandle
);
stub
.
set
(
catalogGetTableMeta
,
__catalogGetTableMeta
);
stub
.
set
(
catalogGetTableHashVgroup
,
__catalogGetTableHashVgroup
);
stub
.
set
(
catalogGetTableDistVgInfo
,
__catalogGetTableDistVgInfo
);
{
AddrAny
any
(
"libcatalog.so"
);
std
::
map
<
std
::
string
,
void
*>
result
;
...
...
source/libs/parser/test/mockCatalogService.cpp
浏览文件 @
b0a4cc81
...
...
@@ -126,6 +126,19 @@ public:
return
0
;
}
int32_t
catalogGetTableDistVgInfo
(
const
SName
*
pTableName
,
SArray
**
pVgList
)
const
{
SVgroupInfo
info
=
{
0
};
info
.
vgId
=
1
;
addEpIntoEpSet
(
&
info
.
epset
,
"node1"
,
6030
);
info
.
hashBegin
=
0
;
info
.
hashEnd
=
1
;
*
pVgList
=
taosArrayInit
(
4
,
sizeof
(
SVgroupInfo
));
taosArrayPush
(
*
pVgList
,
&
info
);
return
0
;
}
TableBuilder
&
createTableBuilder
(
const
std
::
string
&
db
,
const
std
::
string
&
tbname
,
int8_t
tableType
,
int32_t
numOfColumns
,
int32_t
numOfTags
)
{
builder_
=
TableBuilder
::
createTableBuilder
(
tableType
,
numOfColumns
,
numOfTags
);
meta_
[
db
][
tbname
]
=
builder_
->
table
();
...
...
@@ -313,4 +326,8 @@ int32_t MockCatalogService::catalogGetTableMeta(const SName* pTableName, STableM
int32_t
MockCatalogService
::
catalogGetTableHashVgroup
(
const
SName
*
pTableName
,
SVgroupInfo
*
vgInfo
)
const
{
return
impl_
->
catalogGetTableHashVgroup
(
pTableName
,
vgInfo
);
}
int32_t
MockCatalogService
::
catalogGetTableDistVgInfo
(
const
SName
*
pTableName
,
SArray
**
pVgList
)
const
{
return
impl_
->
catalogGetTableDistVgInfo
(
pTableName
,
pVgList
);
}
\ No newline at end of file
source/libs/parser/test/mockCatalogService.h
浏览文件 @
b0a4cc81
...
...
@@ -59,6 +59,7 @@ public:
int32_t
catalogGetTableMeta
(
const
SName
*
pTableName
,
STableMeta
**
pTableMeta
)
const
;
int32_t
catalogGetTableHashVgroup
(
const
SName
*
pTableName
,
SVgroupInfo
*
vgInfo
)
const
;
int32_t
catalogGetTableDistVgInfo
(
const
SName
*
pTableName
,
SArray
**
pVgList
)
const
;
private:
std
::
unique_ptr
<
MockCatalogServiceImpl
>
impl_
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录