Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
7b6c9044
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看板
未验证
提交
7b6c9044
编写于
12月 28, 2021
作者:
S
Shengliang Guan
提交者:
GitHub
12月 28, 2021
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #9458 from taosdata/feature/dnode3
add colId for stb
上级
d635295b
96289c47
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
37 addition
and
11 deletion
+37
-11
source/dnode/mgmt/impl/test/stb/stb.cpp
source/dnode/mgmt/impl/test/stb/stb.cpp
+33
-6
source/dnode/mnode/impl/src/mndStb.c
source/dnode/mnode/impl/src/mndStb.c
+4
-5
未找到文件。
source/dnode/mgmt/impl/test/stb/stb.cpp
浏览文件 @
7b6c9044
...
...
@@ -68,7 +68,6 @@ TEST_F(DndTestStb, 01_Create_Show_Meta_Drop_Restart_Stb) {
{
SSchema
*
pSchema
=
&
pReq
->
pSchema
[
0
];
pSchema
->
colId
=
htonl
(
0
);
pSchema
->
bytes
=
htonl
(
8
);
pSchema
->
type
=
TSDB_DATA_TYPE_TIMESTAMP
;
strcpy
(
pSchema
->
name
,
"ts"
);
...
...
@@ -76,7 +75,6 @@ TEST_F(DndTestStb, 01_Create_Show_Meta_Drop_Restart_Stb) {
{
SSchema
*
pSchema
=
&
pReq
->
pSchema
[
1
];
pSchema
->
colId
=
htonl
(
1
);
pSchema
->
bytes
=
htonl
(
4
);
pSchema
->
type
=
TSDB_DATA_TYPE_INT
;
strcpy
(
pSchema
->
name
,
"col1"
);
...
...
@@ -84,7 +82,6 @@ TEST_F(DndTestStb, 01_Create_Show_Meta_Drop_Restart_Stb) {
{
SSchema
*
pSchema
=
&
pReq
->
pSchema
[
2
];
pSchema
->
colId
=
htonl
(
2
);
pSchema
->
bytes
=
htonl
(
2
);
pSchema
->
type
=
TSDB_DATA_TYPE_TINYINT
;
strcpy
(
pSchema
->
name
,
"tag1"
);
...
...
@@ -92,7 +89,6 @@ TEST_F(DndTestStb, 01_Create_Show_Meta_Drop_Restart_Stb) {
{
SSchema
*
pSchema
=
&
pReq
->
pSchema
[
3
];
pSchema
->
colId
=
htonl
(
3
);
pSchema
->
bytes
=
htonl
(
8
);
pSchema
->
type
=
TSDB_DATA_TYPE_BIGINT
;
strcpy
(
pSchema
->
name
,
"tag2"
);
...
...
@@ -100,7 +96,6 @@ TEST_F(DndTestStb, 01_Create_Show_Meta_Drop_Restart_Stb) {
{
SSchema
*
pSchema
=
&
pReq
->
pSchema
[
4
];
pSchema
->
colId
=
htonl
(
4
);
pSchema
->
bytes
=
htonl
(
16
);
pSchema
->
type
=
TSDB_DATA_TYPE_BINARY
;
strcpy
(
pSchema
->
name
,
"tag3"
);
...
...
@@ -167,10 +162,42 @@ TEST_F(DndTestStb, 01_Create_Show_Meta_Drop_Restart_Stb) {
{
SSchema
*
pSchema
=
&
pRsp
->
pSchema
[
0
];
EXPECT_EQ
(
pSchema
->
type
,
TSDB_DATA_TYPE_TIMESTAMP
);
EXPECT_EQ
(
pSchema
->
colId
,
0
);
EXPECT_EQ
(
pSchema
->
colId
,
1
);
EXPECT_EQ
(
pSchema
->
bytes
,
8
);
EXPECT_STREQ
(
pSchema
->
name
,
"ts"
);
}
{
SSchema
*
pSchema
=
&
pRsp
->
pSchema
[
1
];
EXPECT_EQ
(
pSchema
->
type
,
TSDB_DATA_TYPE_INT
);
EXPECT_EQ
(
pSchema
->
colId
,
2
);
EXPECT_EQ
(
pSchema
->
bytes
,
4
);
EXPECT_STREQ
(
pSchema
->
name
,
"col1"
);
}
{
SSchema
*
pSchema
=
&
pRsp
->
pSchema
[
2
];
EXPECT_EQ
(
pSchema
->
type
,
TSDB_DATA_TYPE_TINYINT
);
EXPECT_EQ
(
pSchema
->
colId
,
3
);
EXPECT_EQ
(
pSchema
->
bytes
,
2
);
EXPECT_STREQ
(
pSchema
->
name
,
"tag1"
);
}
{
SSchema
*
pSchema
=
&
pRsp
->
pSchema
[
3
];
EXPECT_EQ
(
pSchema
->
type
,
TSDB_DATA_TYPE_BIGINT
);
EXPECT_EQ
(
pSchema
->
colId
,
4
);
EXPECT_EQ
(
pSchema
->
bytes
,
8
);
EXPECT_STREQ
(
pSchema
->
name
,
"tag2"
);
}
{
SSchema
*
pSchema
=
&
pRsp
->
pSchema
[
4
];
EXPECT_EQ
(
pSchema
->
type
,
TSDB_DATA_TYPE_BINARY
);
EXPECT_EQ
(
pSchema
->
colId
,
5
);
EXPECT_EQ
(
pSchema
->
bytes
,
16
);
EXPECT_STREQ
(
pSchema
->
name
,
"tag3"
);
}
}
// restart
...
...
source/dnode/mnode/impl/src/mndStb.c
浏览文件 @
7b6c9044
...
...
@@ -291,7 +291,6 @@ static int32_t mndCheckCreateStbMsg(SCreateStbMsg *pCreate) {
int32_t
totalCols
=
pCreate
->
numOfColumns
+
pCreate
->
numOfTags
;
for
(
int32_t
i
=
0
;
i
<
totalCols
;
++
i
)
{
SSchema
*
pSchema
=
&
pCreate
->
pSchema
[
i
];
pSchema
->
colId
=
htonl
(
pSchema
->
colId
);
pSchema
->
bytes
=
htonl
(
pSchema
->
bytes
);
}
...
...
@@ -317,10 +316,6 @@ static int32_t mndCheckCreateStbMsg(SCreateStbMsg *pCreate) {
terrno
=
TSDB_CODE_MND_INVALID_STB_OPTION
;
return
-
1
;
}
if
(
pSchema
->
colId
<
0
||
pSchema
->
colId
>=
maxColId
)
{
terrno
=
TSDB_CODE_MND_INVALID_STB_OPTION
;
return
-
1
;
}
if
(
pSchema
->
bytes
<=
0
)
{
terrno
=
TSDB_CODE_MND_INVALID_STB_OPTION
;
return
-
1
;
...
...
@@ -453,6 +448,10 @@ static int32_t mndCreateStb(SMnode *pMnode, SMnodeMsg *pMsg, SCreateStbMsg *pCre
}
memcpy
(
stbObj
.
pSchema
,
pCreate
->
pSchema
,
totalSize
);
for
(
int32_t
i
=
0
;
i
<
totalCols
;
++
i
)
{
stbObj
.
pSchema
[
i
].
colId
=
i
+
1
;
}
int32_t
code
=
0
;
STrans
*
pTrans
=
mndTransCreate
(
pMnode
,
TRN_POLICY_ROLLBACK
,
&
pMsg
->
rpcMsg
);
if
(
pTrans
==
NULL
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录