Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
3a2a8871
TDengine
项目概览
taosdata
/
TDengine
接近 2 年 前同步成功
通知
1192
Star
22018
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看板
提交
3a2a8871
编写于
2月 08, 2022
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update stb
上级
94de43c5
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
80 addition
and
29 deletion
+80
-29
include/common/tmsg.h
include/common/tmsg.h
+14
-17
source/common/src/tmsg.c
source/common/src/tmsg.c
+2
-2
source/dnode/mgmt/impl/test/vnode/vnode.cpp
source/dnode/mgmt/impl/test/vnode/vnode.cpp
+61
-7
source/dnode/vnode/src/vnd/vnodeWrite.c
source/dnode/vnode/src/vnd/vnodeWrite.c
+1
-1
source/libs/parser/src/dCDAstProcess.c
source/libs/parser/src/dCDAstProcess.c
+2
-2
未找到文件。
include/common/tmsg.h
浏览文件 @
3a2a8871
...
@@ -1178,31 +1178,28 @@ typedef struct SVCreateTbReq {
...
@@ -1178,31 +1178,28 @@ typedef struct SVCreateTbReq {
SSchema
*
pSchema
;
SSchema
*
pSchema
;
}
ntbCfg
;
}
ntbCfg
;
};
};
}
SVCreateTbReq
;
}
SVCreateTbReq
,
SVUpdateTbReq
;
typedef
struct
{
typedef
struct
{
uint64_t
ver
;
// use a general definition
}
SVCreateTbRsp
,
SVUpdateTbRsp
;
SArray
*
pArray
;
}
SVCreateTbBatchReq
;
int
tSerializeSVCreateTbReq
(
void
**
buf
,
SVCreateTbReq
*
pReq
);
int
32_t
tSerializeSVCreateTbReq
(
void
**
buf
,
SVCreateTbReq
*
pReq
);
void
*
tDeserializeSVCreateTbReq
(
void
*
buf
,
SVCreateTbReq
*
pReq
);
void
*
tDeserializeSVCreateTbReq
(
void
*
buf
,
SVCreateTbReq
*
pReq
);
int
tSVCreateTbBatchReqSerialize
(
void
**
buf
,
SVCreateTbBatchReq
*
pReq
);
int
32_t
tSerializeSVCreateTbRsp
(
void
**
buf
,
SVCreateTbRsp
*
pRsp
);
void
*
tSVCreateTbBatchReqDeserialize
(
void
*
buf
,
SVCreateTbBatchReq
*
pReq
);
void
*
tDeserializeSVCreateTbRsp
(
void
*
buf
,
SVCreateTbRsp
*
pRsp
);
typedef
struct
{
typedef
struct
{
SMsgHead
head
;
uint64_t
ver
;
// use a general definition
}
SVCreateTbRsp
;
SArray
*
pArray
;
}
SVCreateTbBatchReq
;
typedef
struct
{
typedef
struct
{
SMsgHead
head
;
}
SVCreateTbBatchRsp
;
char
name
[
TSDB_TABLE_FNAME_LEN
];
int8_t
ignoreNotExists
;
}
SVAlterTbReq
;
typedef
struct
{
int32_t
tSerializeSVCreateTbBatchReq
(
void
**
buf
,
SVCreateTbBatchReq
*
pReq
);
SMsgHead
head
;
void
*
tDeserializeSVCreateTbBatchReq
(
void
*
buf
,
SVCreateTbBatchReq
*
pReq
);
}
SVAlterTbRsp
;
int32_t
tSerializeSVCreateTbBatchReqp
(
void
**
buf
,
SVCreateTbBatchReq
*
pRsp
);
void
*
tDeserializeSVCreateTbBatchReq
(
void
*
buf
,
SVCreateTbBatchReq
*
pRsp
);
typedef
struct
{
typedef
struct
{
uint64_t
ver
;
uint64_t
ver
;
...
...
source/common/src/tmsg.c
浏览文件 @
3a2a8871
...
@@ -293,7 +293,7 @@ void *tDeserializeSVCreateTbReq(void *buf, SVCreateTbReq *pReq) {
...
@@ -293,7 +293,7 @@ void *tDeserializeSVCreateTbReq(void *buf, SVCreateTbReq *pReq) {
return
buf
;
return
buf
;
}
}
int
tS
VCreateTbBatchReqSerialize
(
void
**
buf
,
SVCreateTbBatchReq
*
pReq
)
{
int
tS
erializeSVCreateTbBatchReq
(
void
**
buf
,
SVCreateTbBatchReq
*
pReq
)
{
int
tlen
=
0
;
int
tlen
=
0
;
tlen
+=
taosEncodeFixedU64
(
buf
,
pReq
->
ver
);
tlen
+=
taosEncodeFixedU64
(
buf
,
pReq
->
ver
);
...
@@ -306,7 +306,7 @@ int tSVCreateTbBatchReqSerialize(void **buf, SVCreateTbBatchReq *pReq) {
...
@@ -306,7 +306,7 @@ int tSVCreateTbBatchReqSerialize(void **buf, SVCreateTbBatchReq *pReq) {
return
tlen
;
return
tlen
;
}
}
void
*
t
SVCreateTbBatchReqDeserialize
(
void
*
buf
,
SVCreateTbBatchReq
*
pReq
)
{
void
*
t
DeserializeSVCreateTbBatchReq
(
void
*
buf
,
SVCreateTbBatchReq
*
pReq
)
{
uint32_t
nsize
=
0
;
uint32_t
nsize
=
0
;
buf
=
taosDecodeFixedU64
(
buf
,
&
pReq
->
ver
);
buf
=
taosDecodeFixedU64
(
buf
,
&
pReq
->
ver
);
...
...
source/dnode/mgmt/impl/test/vnode/vnode.cpp
浏览文件 @
3a2a8871
...
@@ -220,15 +220,69 @@ TEST_F(DndTestVnode, 03_Create_Stb) {
...
@@ -220,15 +220,69 @@ TEST_F(DndTestVnode, 03_Create_Stb) {
}
}
TEST_F
(
DndTestVnode
,
04
_ALTER_Stb
)
{
TEST_F
(
DndTestVnode
,
04
_ALTER_Stb
)
{
#if 0
for
(
int
i
=
0
;
i
<
1
;
++
i
)
{
{
SVCreateTbReq
req
=
{
0
};
for (int i = 0; i < 3; ++i) {
req
.
ver
=
0
;
SRpcMsg* pRsp = test.SendReq(TDMT_VND_ALTER_STB, pReq, contLen);
req
.
name
=
(
char
*
)
"stb1"
;
ASSERT_NE(pRsp, nullptr);
req
.
ttl
=
0
;
ASSERT_EQ(pRsp->code, 0);
req
.
keep
=
0
;
req
.
type
=
TD_SUPER_TABLE
;
SSchema
schemas
[
5
]
=
{
0
};
{
SSchema
*
pSchema
=
&
schemas
[
0
];
pSchema
->
bytes
=
htonl
(
8
);
pSchema
->
type
=
TSDB_DATA_TYPE_TIMESTAMP
;
strcpy
(
pSchema
->
name
,
"ts"
);
}
{
SSchema
*
pSchema
=
&
schemas
[
1
];
pSchema
->
bytes
=
htonl
(
4
);
pSchema
->
type
=
TSDB_DATA_TYPE_INT
;
strcpy
(
pSchema
->
name
,
"col1"
);
}
{
SSchema
*
pSchema
=
&
schemas
[
2
];
pSchema
->
bytes
=
htonl
(
2
);
pSchema
->
type
=
TSDB_DATA_TYPE_TINYINT
;
strcpy
(
pSchema
->
name
,
"_tag1"
);
}
}
{
SSchema
*
pSchema
=
&
schemas
[
3
];
pSchema
->
bytes
=
htonl
(
8
);
pSchema
->
type
=
TSDB_DATA_TYPE_BIGINT
;
strcpy
(
pSchema
->
name
,
"_tag2"
);
}
{
SSchema
*
pSchema
=
&
schemas
[
4
];
pSchema
->
bytes
=
htonl
(
16
);
pSchema
->
type
=
TSDB_DATA_TYPE_BINARY
;
strcpy
(
pSchema
->
name
,
"_tag3"
);
}
req
.
stbCfg
.
suid
=
9527
;
req
.
stbCfg
.
nCols
=
2
;
req
.
stbCfg
.
pSchema
=
&
schemas
[
0
];
req
.
stbCfg
.
nTagCols
=
3
;
req
.
stbCfg
.
pTagSchema
=
&
schemas
[
2
];
int32_t
contLen
=
tSerializeSVCreateTbReq
(
NULL
,
&
req
)
+
sizeof
(
SMsgHead
);
SMsgHead
*
pHead
=
(
SMsgHead
*
)
rpcMallocCont
(
contLen
);
pHead
->
contLen
=
htonl
(
contLen
);
pHead
->
vgId
=
htonl
(
2
);
void
*
pBuf
=
POINTER_SHIFT
(
pHead
,
sizeof
(
SMsgHead
));
tSerializeSVCreateTbReq
(
&
pBuf
,
&
req
);
SRpcMsg
*
pRsp
=
test
.
SendReq
(
TDMT_VND_ALTER_STB
,
(
void
*
)
pHead
,
contLen
);
ASSERT_NE
(
pRsp
,
nullptr
);
ASSERT_EQ
(
pRsp
->
code
,
0
);
}
}
#endif
}
}
TEST_F
(
DndTestVnode
,
05
_DROP_Stb
)
{
TEST_F
(
DndTestVnode
,
05
_DROP_Stb
)
{
...
...
source/dnode/vnode/src/vnd/vnodeWrite.c
浏览文件 @
3a2a8871
...
@@ -83,7 +83,7 @@ int vnodeApplyWMsg(SVnode *pVnode, SRpcMsg *pMsg, SRpcMsg **pRsp) {
...
@@ -83,7 +83,7 @@ int vnodeApplyWMsg(SVnode *pVnode, SRpcMsg *pMsg, SRpcMsg **pRsp) {
free
(
vCreateTbReq
.
name
);
free
(
vCreateTbReq
.
name
);
break
;
break
;
case
TDMT_VND_CREATE_TABLE
:
case
TDMT_VND_CREATE_TABLE
:
t
SVCreateTbBatchReqDeserialize
(
POINTER_SHIFT
(
pMsg
->
pCont
,
sizeof
(
SMsgHead
)),
&
vCreateTbBatchReq
);
t
DeserializeSVCreateTbBatchReq
(
POINTER_SHIFT
(
pMsg
->
pCont
,
sizeof
(
SMsgHead
)),
&
vCreateTbBatchReq
);
for
(
int
i
=
0
;
i
<
taosArrayGetSize
(
vCreateTbBatchReq
.
pArray
);
i
++
)
{
for
(
int
i
=
0
;
i
<
taosArrayGetSize
(
vCreateTbBatchReq
.
pArray
);
i
++
)
{
SVCreateTbReq
*
pCreateTbReq
=
taosArrayGet
(
vCreateTbBatchReq
.
pArray
,
i
);
SVCreateTbReq
*
pCreateTbReq
=
taosArrayGet
(
vCreateTbBatchReq
.
pArray
,
i
);
if
(
metaCreateTable
(
pVnode
->
pMeta
,
pCreateTbReq
)
<
0
)
{
if
(
metaCreateTable
(
pVnode
->
pMeta
,
pCreateTbReq
)
<
0
)
{
...
...
source/libs/parser/src/dCDAstProcess.c
浏览文件 @
3a2a8871
...
@@ -598,7 +598,7 @@ static int32_t doCheckAndBuildCreateCTableReq(SCreateTableSql* pCreateTable, SPa
...
@@ -598,7 +598,7 @@ static int32_t doCheckAndBuildCreateCTableReq(SCreateTableSql* pCreateTable, SPa
}
}
static
int32_t
serializeVgroupTablesBatchImpl
(
SVgroupTablesBatch
*
pTbBatch
,
SArray
*
pBufArray
)
{
static
int32_t
serializeVgroupTablesBatchImpl
(
SVgroupTablesBatch
*
pTbBatch
,
SArray
*
pBufArray
)
{
int
tlen
=
sizeof
(
SMsgHead
)
+
tS
VCreateTbBatchReqSerialize
(
NULL
,
&
(
pTbBatch
->
req
));
int
tlen
=
sizeof
(
SMsgHead
)
+
tS
erializeSVCreateTbBatchReq
(
NULL
,
&
(
pTbBatch
->
req
));
void
*
buf
=
malloc
(
tlen
);
void
*
buf
=
malloc
(
tlen
);
if
(
buf
==
NULL
)
{
if
(
buf
==
NULL
)
{
// TODO: handle error
// TODO: handle error
...
@@ -608,7 +608,7 @@ static int32_t serializeVgroupTablesBatchImpl(SVgroupTablesBatch* pTbBatch, SArr
...
@@ -608,7 +608,7 @@ static int32_t serializeVgroupTablesBatchImpl(SVgroupTablesBatch* pTbBatch, SArr
((
SMsgHead
*
)
buf
)
->
contLen
=
htonl
(
tlen
);
((
SMsgHead
*
)
buf
)
->
contLen
=
htonl
(
tlen
);
void
*
pBuf
=
POINTER_SHIFT
(
buf
,
sizeof
(
SMsgHead
));
void
*
pBuf
=
POINTER_SHIFT
(
buf
,
sizeof
(
SMsgHead
));
tS
VCreateTbBatchReqSerialize
(
&
pBuf
,
&
(
pTbBatch
->
req
));
tS
erializeSVCreateTbBatchReq
(
&
pBuf
,
&
(
pTbBatch
->
req
));
SVgDataBlocks
*
pVgData
=
calloc
(
1
,
sizeof
(
SVgDataBlocks
));
SVgDataBlocks
*
pVgData
=
calloc
(
1
,
sizeof
(
SVgDataBlocks
));
pVgData
->
vg
=
pTbBatch
->
info
;
pVgData
->
vg
=
pTbBatch
->
info
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录