Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
43f9702b
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看板
未验证
提交
43f9702b
编写于
1月 05, 2022
作者:
H
Hongze Cheng
提交者:
GitHub
1月 05, 2022
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #9599 from taosdata/feature/3.0_wxy
TD-12696 bug fix for insert
上级
3e0960c0
17b9917b
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
9 addition
and
19 deletion
+9
-19
include/common/tmsg.h
include/common/tmsg.h
+0
-4
source/libs/parser/src/dataBlockMgt.c
source/libs/parser/src/dataBlockMgt.c
+1
-1
source/libs/parser/src/insertParser.c
source/libs/parser/src/insertParser.c
+2
-4
source/libs/parser/test/insertParserTest.cpp
source/libs/parser/test/insertParserTest.cpp
+2
-6
source/libs/parser/test/mockCatalogService.cpp
source/libs/parser/test/mockCatalogService.cpp
+3
-3
source/libs/planner/test/phyPlanTests.cpp
source/libs/planner/test/phyPlanTests.cpp
+1
-1
未找到文件。
include/common/tmsg.h
浏览文件 @
43f9702b
...
...
@@ -156,10 +156,6 @@ typedef struct {
uint16_t
port
;
}
SEpAddr
;
typedef
struct
{
int32_t
numOfVnodes
;
}
SMsgDesc
;
typedef
struct
SMsgHead
{
int32_t
contLen
;
int32_t
vgId
;
...
...
source/libs/parser/src/dataBlockMgt.c
浏览文件 @
43f9702b
...
...
@@ -467,7 +467,7 @@ static int trimDataBlock(void* pDataBlock, STableDataBlocks* pTableDataBlock, SB
}
int32_t
mergeTableDataBlocks
(
SHashObj
*
pHashObj
,
int8_t
schemaAttached
,
uint8_t
payloadType
,
SArray
**
pVgDataBlocks
)
{
const
int
INSERT_HEAD_SIZE
=
sizeof
(
S
MsgDesc
)
+
sizeof
(
S
SubmitMsg
);
const
int
INSERT_HEAD_SIZE
=
sizeof
(
SSubmitMsg
);
int
code
=
0
;
bool
isRawPayload
=
IS_RAW_PAYLOAD
(
payloadType
);
SHashObj
*
pVnodeDataBlockHashList
=
taosHashInit
(
128
,
taosGetDefaultHashFunction
(
TSDB_DATA_TYPE_BIGINT
),
true
,
false
);
...
...
source/libs/parser/src/insertParser.c
浏览文件 @
43f9702b
...
...
@@ -121,11 +121,9 @@ static int32_t findCol(SToken* pColname, int32_t start, int32_t end, SSchema* pS
}
static
void
buildMsgHeader
(
SVgDataBlocks
*
blocks
)
{
SMsgDesc
*
desc
=
(
SMsgDesc
*
)
blocks
->
pData
;
desc
->
numOfVnodes
=
htonl
(
1
);
SSubmitMsg
*
submit
=
(
SSubmitMsg
*
)(
desc
+
1
);
SSubmitMsg
*
submit
=
(
SSubmitMsg
*
)
blocks
->
pData
;
submit
->
header
.
vgId
=
htonl
(
blocks
->
vg
.
vgId
);
submit
->
header
.
contLen
=
htonl
(
blocks
->
size
-
sizeof
(
SMsgDesc
)
);
submit
->
header
.
contLen
=
htonl
(
blocks
->
size
);
submit
->
length
=
submit
->
header
.
contLen
;
submit
->
numOfBlocks
=
htonl
(
blocks
->
numOfTables
);
SSubmitBlk
*
blk
=
(
SSubmitBlk
*
)(
submit
+
1
);
...
...
source/libs/parser/test/insertParserTest.cpp
浏览文件 @
43f9702b
...
...
@@ -70,9 +70,7 @@ protected:
for
(
size_t
i
=
0
;
i
<
num
;
++
i
)
{
SVgDataBlocks
*
vg
=
(
SVgDataBlocks
*
)
taosArrayGetP
(
res_
->
pDataBlocks
,
i
);
cout
<<
"vgId:"
<<
vg
->
vg
.
vgId
<<
", numOfTables:"
<<
vg
->
numOfTables
<<
", dataSize:"
<<
vg
->
size
<<
endl
;
SMsgDesc
*
desc
=
(
SMsgDesc
*
)(
vg
->
pData
);
cout
<<
"numOfVnodes:"
<<
ntohl
(
desc
->
numOfVnodes
)
<<
endl
;
SSubmitMsg
*
submit
=
(
SSubmitMsg
*
)(
desc
+
1
);
SSubmitMsg
*
submit
=
(
SSubmitMsg
*
)
vg
->
pData
;
cout
<<
"length:"
<<
ntohl
(
submit
->
length
)
<<
", numOfBlocks:"
<<
ntohl
(
submit
->
numOfBlocks
)
<<
endl
;
int32_t
numOfBlocks
=
ntohl
(
submit
->
numOfBlocks
);
SSubmitBlk
*
blk
=
(
SSubmitBlk
*
)(
submit
+
1
);
...
...
@@ -95,9 +93,7 @@ protected:
SVgDataBlocks
*
vg
=
(
SVgDataBlocks
*
)
taosArrayGetP
(
res_
->
pDataBlocks
,
i
);
ASSERT_EQ
(
vg
->
numOfTables
,
numOfTables
);
ASSERT_GE
(
vg
->
size
,
0
);
SMsgDesc
*
desc
=
(
SMsgDesc
*
)(
vg
->
pData
);
ASSERT_EQ
(
ntohl
(
desc
->
numOfVnodes
),
1
);
SSubmitMsg
*
submit
=
(
SSubmitMsg
*
)(
desc
+
1
);
SSubmitMsg
*
submit
=
(
SSubmitMsg
*
)
vg
->
pData
;
ASSERT_GE
(
ntohl
(
submit
->
length
),
0
);
ASSERT_GE
(
ntohl
(
submit
->
numOfBlocks
),
0
);
int32_t
numOfBlocks
=
ntohl
(
submit
->
numOfBlocks
);
...
...
source/libs/parser/test/mockCatalogService.cpp
浏览文件 @
43f9702b
...
...
@@ -27,8 +27,8 @@ std::unique_ptr<MockCatalogService> mockCatalogService;
class
TableBuilder
:
public
ITableBuilder
{
public:
virtual
TableBuilder
&
addColumn
(
const
std
::
string
&
name
,
int8_t
type
,
int32_t
bytes
)
{
assert
(
colId_
<
schema
()
->
tableInfo
.
numOfTags
+
schema
()
->
tableInfo
.
numOfColumns
);
SSchema
*
col
=
schema
()
->
schema
+
colId_
;
assert
(
colId_
<
=
schema
()
->
tableInfo
.
numOfTags
+
schema
()
->
tableInfo
.
numOfColumns
);
SSchema
*
col
=
schema
()
->
schema
+
(
colId_
-
1
)
;
col
->
type
=
type
;
col
->
colId
=
colId_
++
;
col
->
bytes
=
bytes
;
...
...
@@ -66,7 +66,7 @@ private:
return
std
::
unique_ptr
<
TableBuilder
>
(
new
TableBuilder
(
meta
));
}
TableBuilder
(
STableMeta
*
schemaMeta
)
:
colId_
(
0
),
rowsize_
(
0
),
meta_
(
new
MockTableMeta
())
{
TableBuilder
(
STableMeta
*
schemaMeta
)
:
colId_
(
1
),
rowsize_
(
0
),
meta_
(
new
MockTableMeta
())
{
meta_
->
schema
.
reset
(
schemaMeta
);
}
...
...
source/libs/planner/test/phyPlanTests.cpp
浏览文件 @
43f9702b
...
...
@@ -33,7 +33,7 @@ protected:
void
pushScan
(
const
string
&
db
,
const
string
&
table
,
int32_t
scanOp
)
{
shared_ptr
<
MockTableMeta
>
meta
=
mockCatalogService
->
getTableMeta
(
db
,
table
);
EXPECT_TRUE
(
meta
);
unique_ptr
<
SQueryPlanNode
>
scan
((
SQueryPlanNode
*
)
c
alloc
(
1
,
sizeof
(
SQueryPlanNode
)));
unique_ptr
<
SQueryPlanNode
>
scan
((
SQueryPlanNode
*
)
myC
alloc
(
1
,
sizeof
(
SQueryPlanNode
)));
scan
->
info
.
type
=
scanOp
;
scan
->
numOfCols
=
meta
->
schema
->
tableInfo
.
numOfColumns
;
scan
->
pSchema
=
(
SSchema
*
)
myCalloc
(
1
,
sizeof
(
SSchema
)
*
scan
->
numOfCols
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录