Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
f431cbe0
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22017
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
f431cbe0
编写于
4月 15, 2022
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
test: reopen funcTest
上级
a1f69af4
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
16 addition
and
47 deletion
+16
-47
source/dnode/mnode/impl/src/mndInfoSchema.c
source/dnode/mnode/impl/src/mndInfoSchema.c
+6
-4
source/dnode/mnode/impl/test/func/CMakeLists.txt
source/dnode/mnode/impl/test/func/CMakeLists.txt
+5
-5
source/dnode/mnode/impl/test/func/func.cpp
source/dnode/mnode/impl/test/func/func.cpp
+5
-38
未找到文件。
source/dnode/mnode/impl/src/mndInfoSchema.c
浏览文件 @
f431cbe0
...
...
@@ -94,11 +94,13 @@ static const SInfosTableSchema userDBSchema[] = {
};
static
const
SInfosTableSchema
userFuncSchema
[]
=
{
{.
name
=
"name"
,
.
bytes
=
32
,
.
type
=
TSDB_DATA_TYPE_VARCHAR
},
{.
name
=
"name"
,
.
bytes
=
TSDB_FUNC_NAME_LEN
-
1
+
VARSTR_HEADER_SIZE
,
.
type
=
TSDB_DATA_TYPE_VARCHAR
},
{.
name
=
"comment"
,
.
bytes
=
PATH_MAX
-
1
+
VARSTR_HEADER_SIZE
,
.
type
=
TSDB_DATA_TYPE_VARCHAR
},
{.
name
=
"aggregate"
,
.
bytes
=
4
,
.
type
=
TSDB_DATA_TYPE_INT
},
{.
name
=
"comment"
,
.
bytes
=
TSDB_TYPE_STR_MAX_LEN
-
1
+
VARSTR_HEADER_SIZE
,
.
type
=
TSDB_DATA_TYPE_VARCHAR
},
{.
name
=
"create_time"
,
.
bytes
=
8
,
.
type
=
TSDB_DATA_TYPE_TIMESTAMP
},
{.
name
=
"ntables"
,
.
bytes
=
4
,
.
type
=
TSDB_DATA_TYPE_INT
},
{.
name
=
"precision"
,
.
bytes
=
2
,
.
type
=
TSDB_DATA_TYPE_VARCHAR
},
{.
name
=
"status"
,
.
bytes
=
10
,
.
type
=
TSDB_DATA_TYPE_VARCHAR
},
{.
name
=
"code_len"
,
.
bytes
=
4
,
.
type
=
TSDB_DATA_TYPE_INT
},
{.
name
=
"bufsize"
,
.
bytes
=
4
,
.
type
=
TSDB_DATA_TYPE_INT
},
};
static
const
SInfosTableSchema
userIdxSchema
[]
=
{
...
...
source/dnode/mnode/impl/test/func/CMakeLists.txt
浏览文件 @
f431cbe0
aux_source_directory
(
.
FUNC
_SRC
)
add_executable
(
mnode_test_func
${
FUNC
_SRC
}
)
aux_source_directory
(
.
MNODE_FUNC_TEST
_SRC
)
add_executable
(
funcTest
${
MNODE_FUNC_TEST
_SRC
}
)
target_link_libraries
(
mnode_test_func
funcTest
PUBLIC sut
)
add_test
(
NAME
mnode_test_func
COMMAND
mnode_test_func
NAME
funcTest
COMMAND
funcTest
)
source/dnode/mnode/impl/test/func/func.cpp
浏览文件 @
f431cbe0
...
...
@@ -26,18 +26,7 @@ class MndTestFunc : public ::testing::Test {
Testbase
MndTestFunc
::
test
;
TEST_F
(
MndTestFunc
,
01
_Show_Func
)
{
test
.
SendShowMetaReq
(
TSDB_MGMT_TABLE_FUNC
,
""
);
CHECK_META
(
"show functions"
,
7
);
CHECK_SCHEMA
(
0
,
TSDB_DATA_TYPE_BINARY
,
TSDB_FUNC_NAME_LEN
+
VARSTR_HEADER_SIZE
,
"name"
);
CHECK_SCHEMA
(
1
,
TSDB_DATA_TYPE_BINARY
,
PATH_MAX
+
VARSTR_HEADER_SIZE
,
"comment"
);
CHECK_SCHEMA
(
2
,
TSDB_DATA_TYPE_INT
,
4
,
"aggregate"
);
CHECK_SCHEMA
(
3
,
TSDB_DATA_TYPE_BINARY
,
TSDB_TYPE_STR_MAX_LEN
+
VARSTR_HEADER_SIZE
,
"outputtype"
);
CHECK_SCHEMA
(
4
,
TSDB_DATA_TYPE_TIMESTAMP
,
8
,
"create_time"
);
CHECK_SCHEMA
(
5
,
TSDB_DATA_TYPE_INT
,
4
,
"code_len"
);
CHECK_SCHEMA
(
6
,
TSDB_DATA_TYPE_INT
,
4
,
"bufsize"
);
test
.
SendShowRetrieveReq
();
test
.
SendShowReq
(
TSDB_MGMT_TABLE_FUNC
,
"user_functions"
,
""
);
EXPECT_EQ
(
test
.
GetShowRows
(),
0
);
}
...
...
@@ -194,19 +183,8 @@ TEST_F(MndTestFunc, 02_Create_Func) {
}
}
test
.
SendShowMetaReq
(
TSDB_MGMT_TABLE_FUNC
,
""
);
CHECK_META
(
"show functions"
,
7
);
test
.
SendShowRetrieveReq
();
test
.
SendShowReq
(
TSDB_MGMT_TABLE_FUNC
,
"user_functions"
,
""
);
EXPECT_EQ
(
test
.
GetShowRows
(),
1
);
CheckBinary
(
"f1"
,
TSDB_FUNC_NAME_LEN
);
CheckBinaryByte
(
'm'
,
TSDB_FUNC_COMMENT_LEN
);
CheckInt32
(
0
);
CheckBinary
(
"SMALLINT"
,
TSDB_TYPE_STR_MAX_LEN
);
CheckTimestamp
();
CheckInt32
(
TSDB_FUNC_CODE_LEN
);
CheckInt32
(
4
);
}
TEST_F
(
MndTestFunc
,
03
_Retrieve_Func
)
{
...
...
@@ -331,10 +309,7 @@ TEST_F(MndTestFunc, 03_Retrieve_Func) {
ASSERT_NE
(
pRsp
,
nullptr
);
ASSERT_EQ
(
pRsp
->
code
,
0
);
test
.
SendShowMetaReq
(
TSDB_MGMT_TABLE_FUNC
,
""
);
CHECK_META
(
"show functions"
,
7
);
test
.
SendShowRetrieveReq
();
test
.
SendShowReq
(
TSDB_MGMT_TABLE_FUNC
,
"user_functions"
,
""
);
EXPECT_EQ
(
test
.
GetShowRows
(),
2
);
}
...
...
@@ -529,20 +504,12 @@ TEST_F(MndTestFunc, 04_Drop_Func) {
ASSERT_EQ
(
pRsp
->
code
,
0
);
}
test
.
SendShowMetaReq
(
TSDB_MGMT_TABLE_FUNC
,
""
);
CHECK_META
(
"show functions"
,
7
);
test
.
SendShowRetrieveReq
();
test
.
SendShowReq
(
TSDB_MGMT_TABLE_FUNC
,
"user_functions"
,
""
);
EXPECT_EQ
(
test
.
GetShowRows
(),
1
);
// restart
test
.
Restart
();
test
.
SendShowMetaReq
(
TSDB_MGMT_TABLE_FUNC
,
""
);
CHECK_META
(
"show functions"
,
7
);
test
.
SendShowRetrieveReq
();
test
.
SendShowReq
(
TSDB_MGMT_TABLE_FUNC
,
"user_functions"
,
""
);
EXPECT_EQ
(
test
.
GetShowRows
(),
1
);
CheckBinary
(
"f2"
,
TSDB_FUNC_NAME_LEN
);
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录