Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
e06d7083
T
TDengine
项目概览
慢慢CG
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
e06d7083
编写于
10月 22, 2020
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[td-1373]
上级
ad499c55
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
10 addition
and
15 deletion
+10
-15
src/client/src/tscSubquery.c
src/client/src/tscSubquery.c
+1
-3
src/query/inc/qTsbuf.h
src/query/inc/qTsbuf.h
+1
-1
src/query/src/qTsbuf.c
src/query/src/qTsbuf.c
+4
-5
src/query/tests/tsBufTest.cpp
src/query/tests/tsBufTest.cpp
+4
-6
未找到文件。
src/client/src/tscSubquery.c
浏览文件 @
e06d7083
...
...
@@ -761,9 +761,7 @@ static void tsCompRetrieveCallback(void* param, TAOS_RES* tres, int32_t numOfRow
pSupporter
->
pTSBuf
=
pBuf
;
}
else
{
assert
(
pQueryInfo
->
numOfTables
==
1
);
// for subquery, only one
STableMetaInfo
*
pTableMetaInfo
=
tscGetMetaInfo
(
pQueryInfo
,
0
);
tsBufMerge
(
pSupporter
->
pTSBuf
,
pBuf
,
pTableMetaInfo
->
vgroupIndex
);
tsBufMerge
(
pSupporter
->
pTSBuf
,
pBuf
);
tsBufDestroy
(
pBuf
);
}
...
...
src/query/inc/qTsbuf.h
浏览文件 @
e06d7083
...
...
@@ -111,7 +111,7 @@ STSBuf* tsBufCreateFromCompBlocks(const char* pData, int32_t numOfBlocks, int32_
void
*
tsBufDestroy
(
STSBuf
*
pTSBuf
);
void
tsBufAppend
(
STSBuf
*
pTSBuf
,
int32_t
vnodeId
,
tVariant
*
tag
,
const
char
*
pData
,
int32_t
len
);
int32_t
tsBufMerge
(
STSBuf
*
pDestBuf
,
const
STSBuf
*
pSrcBuf
,
int32_t
vnodeIdx
);
int32_t
tsBufMerge
(
STSBuf
*
pDestBuf
,
const
STSBuf
*
pSrcBuf
);
STSBuf
*
tsBufClone
(
STSBuf
*
pTSBuf
);
...
...
src/query/src/qTsbuf.c
浏览文件 @
e06d7083
...
...
@@ -715,7 +715,7 @@ STSElem tsBufGetElem(STSBuf* pTSBuf) {
* @param vnodeId
* @return
*/
int32_t
tsBufMerge
(
STSBuf
*
pDestBuf
,
const
STSBuf
*
pSrcBuf
,
int32_t
vnodeId
)
{
int32_t
tsBufMerge
(
STSBuf
*
pDestBuf
,
const
STSBuf
*
pSrcBuf
)
{
if
(
pDestBuf
==
NULL
||
pSrcBuf
==
NULL
||
pSrcBuf
->
numOfVnodes
<=
0
)
{
return
0
;
}
...
...
@@ -725,14 +725,13 @@ int32_t tsBufMerge(STSBuf* pDestBuf, const STSBuf* pSrcBuf, int32_t vnodeId) {
}
// src can only have one vnode index
if
(
pSrcBuf
->
numOfVnodes
>
1
)
{
return
-
1
;
}
assert
(
pSrcBuf
->
numOfVnodes
==
1
);
// there are data in buffer, flush to disk first
tsBufFlush
(
pDestBuf
);
// compared with the last vnode id
int32_t
vnodeId
=
tsBufGetLastVnodeInfo
((
STSBuf
*
)
pSrcBuf
)
->
info
.
vnode
;
if
(
vnodeId
!=
tsBufGetLastVnodeInfo
(
pDestBuf
)
->
info
.
vnode
)
{
int32_t
oldSize
=
pDestBuf
->
numOfVnodes
;
int32_t
newSize
=
oldSize
+
pSrcBuf
->
numOfVnodes
;
...
...
src/query/tests/tsBufTest.cpp
浏览文件 @
e06d7083
...
...
@@ -416,8 +416,8 @@ void mergeDiffVnodeBufferTest() {
int64_t
*
list
=
createTsList
(
num
,
start
,
step
);
t
.
i64Key
=
i
;
tsBufAppend
(
pTSBuf1
,
0
,
&
t
,
(
const
char
*
)
list
,
num
*
sizeof
(
int64_t
));
tsBufAppend
(
pTSBuf2
,
0
,
&
t
,
(
const
char
*
)
list
,
num
*
sizeof
(
int64_t
));
tsBufAppend
(
pTSBuf1
,
1
,
&
t
,
(
const
char
*
)
list
,
num
*
sizeof
(
int64_t
));
tsBufAppend
(
pTSBuf2
,
9
,
&
t
,
(
const
char
*
)
list
,
num
*
sizeof
(
int64_t
));
free
(
list
);
...
...
@@ -426,7 +426,7 @@ void mergeDiffVnodeBufferTest() {
tsBufFlush
(
pTSBuf2
);
tsBufMerge
(
pTSBuf1
,
pTSBuf2
,
9
);
tsBufMerge
(
pTSBuf1
,
pTSBuf2
);
EXPECT_EQ
(
pTSBuf1
->
numOfVnodes
,
2
);
EXPECT_EQ
(
pTSBuf1
->
numOfTotal
,
numOfTags
*
2
*
num
);
...
...
@@ -459,8 +459,6 @@ void mergeIdenticalVnodeBufferTest() {
start
+=
step
*
num
;
}
for
(
int32_t
i
=
numOfTags
;
i
<
numOfTags
*
2
;
++
i
)
{
int64_t
*
list
=
createTsList
(
num
,
start
,
step
);
...
...
@@ -473,7 +471,7 @@ void mergeIdenticalVnodeBufferTest() {
tsBufFlush
(
pTSBuf2
);
tsBufMerge
(
pTSBuf1
,
pTSBuf2
,
12
);
tsBufMerge
(
pTSBuf1
,
pTSBuf2
);
EXPECT_EQ
(
pTSBuf1
->
numOfVnodes
,
1
);
EXPECT_EQ
(
pTSBuf1
->
numOfTotal
,
numOfTags
*
2
*
num
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录