Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
5cf4dac0
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看板
提交
5cf4dac0
编写于
8月 02, 2022
作者:
M
Minglei Jin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: new pSchema if reader's schema is null
上级
43355a89
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
17 addition
and
10 deletion
+17
-10
source/dnode/vnode/src/tsdb/tsdbRead.c
source/dnode/vnode/src/tsdb/tsdbRead.c
+17
-10
未找到文件。
source/dnode/vnode/src/tsdb/tsdbRead.c
浏览文件 @
5cf4dac0
...
...
@@ -146,7 +146,8 @@ static int32_t doMergeRowsInFileBlocks(SBlockData* pBlockData, STableBlockScanI
static
int32_t
doMergeRowsInBuf
(
SIterInfo
*
pIter
,
uint64_t
uid
,
int64_t
ts
,
SArray
*
pDelList
,
SRowMerger
*
pMerger
,
STsdbReader
*
pReader
);
static
int32_t
doAppendRowFromTSRow
(
SSDataBlock
*
pBlock
,
STsdbReader
*
pReader
,
STSRow
*
pTSRow
);
static
int32_t
doAppendRowFromBlock
(
SSDataBlock
*
pResBlock
,
STsdbReader
*
pReader
,
SBlockData
*
pBlockData
,
int32_t
rowIndex
);
static
int32_t
doAppendRowFromBlock
(
SSDataBlock
*
pResBlock
,
STsdbReader
*
pReader
,
SBlockData
*
pBlockData
,
int32_t
rowIndex
);
static
void
setComposedBlockFlag
(
STsdbReader
*
pReader
,
bool
composed
);
static
void
updateSchema
(
TSDBROW
*
pRow
,
uint64_t
uid
,
STsdbReader
*
pReader
);
static
bool
hasBeenDropped
(
const
SArray
*
pDelList
,
int32_t
*
index
,
TSDBKEY
*
pKey
,
int32_t
order
);
...
...
@@ -1444,9 +1445,9 @@ static int32_t buildComposedDataBlockImpl(STsdbReader* pReader, STableBlockScanI
// 2. the direct next point is not an duplicated timestamp
if
((
pDumpInfo
->
rowIndex
<
pDumpInfo
->
totalRows
-
1
&&
pReader
->
order
==
TSDB_ORDER_ASC
)
||
(
pDumpInfo
->
rowIndex
>
0
&&
pReader
->
order
==
TSDB_ORDER_DESC
))
{
int32_t
step
=
pReader
->
order
==
TSDB_ORDER_ASC
?
1
:
-
1
;
int32_t
step
=
pReader
->
order
==
TSDB_ORDER_ASC
?
1
:
-
1
;
int64_t
nextKey
=
pBlockData
->
aTSKEY
[
pDumpInfo
->
rowIndex
+
step
];
if
(
nextKey
!=
key
)
{
// merge is not needed
if
(
nextKey
!=
key
)
{
// merge is not needed
doAppendRowFromBlock
(
pReader
->
pResBlock
,
pReader
,
pBlockData
,
pDumpInfo
->
rowIndex
);
pDumpInfo
->
rowIndex
+=
step
;
return
TSDB_CODE_SUCCESS
;
...
...
@@ -2134,15 +2135,18 @@ int32_t doMergeRowsInBuf(SIterInfo* pIter, uint64_t uid, int64_t ts, SArray* pDe
int32_t
sversion
=
TSDBROW_SVERSION
(
pRow
);
STSchema
*
pTSchema
=
NULL
;
if
(
sversion
!=
pReader
->
pSchema
->
version
)
{
if
(
pReader
->
pSchema
==
NULL
||
sversion
!=
pReader
->
pSchema
->
version
)
{
metaGetTbTSchemaEx
(
pReader
->
pTsdb
->
pVnode
->
pMeta
,
pReader
->
suid
,
uid
,
sversion
,
&
pTSchema
);
if
(
pReader
->
pSchema
==
NULL
)
{
pReader
->
pSchema
=
pTSchema
;
}
}
else
{
pTSchema
=
pReader
->
pSchema
;
}
tRowMergerAdd
(
pMerger
,
pRow
,
pTSchema
);
if
(
sversion
!=
pReader
->
pSchema
->
version
)
{
if
(
pTSchema
!=
pReader
->
pSchema
)
{
taosMemoryFree
(
pTSchema
);
}
}
...
...
@@ -2230,7 +2234,7 @@ int32_t doMergeRowsInFileBlocks(SBlockData* pBlockData, STableBlockScanInfo* pSc
int32_t
step
=
asc
?
1
:
-
1
;
pDumpInfo
->
rowIndex
+=
step
;
if
((
pDumpInfo
->
rowIndex
<=
pBlockData
->
nRow
-
1
&&
asc
)
||
(
pDumpInfo
->
rowIndex
>=
0
&&
!
asc
))
{
if
((
pDumpInfo
->
rowIndex
<=
pBlockData
->
nRow
-
1
&&
asc
)
||
(
pDumpInfo
->
rowIndex
>=
0
&&
!
asc
))
{
pDumpInfo
->
rowIndex
=
doMergeRowsInFileBlockImpl
(
pBlockData
,
pDumpInfo
->
rowIndex
,
key
,
pMerger
,
&
pReader
->
verRange
,
step
);
}
...
...
@@ -2271,8 +2275,11 @@ void doMergeMultiRows(TSDBROW* pRow, uint64_t uid, SIterInfo* pIter, SArray* pDe
// updateSchema(pRow, uid, pReader);
int32_t
sversion
=
TSDBROW_SVERSION
(
pRow
);
STSchema
*
pTSchema
=
NULL
;
if
(
sversion
!=
pReader
->
pSchema
->
version
)
{
if
(
pReader
->
pSchema
==
NULL
||
sversion
!=
pReader
->
pSchema
->
version
)
{
metaGetTbTSchemaEx
(
pReader
->
pTsdb
->
pVnode
->
pMeta
,
pReader
->
suid
,
uid
,
sversion
,
&
pTSchema
);
if
(
pReader
->
pSchema
==
NULL
)
{
pReader
->
pSchema
=
pTSchema
;
}
}
else
{
pTSchema
=
pReader
->
pSchema
;
}
...
...
@@ -2282,7 +2289,7 @@ void doMergeMultiRows(TSDBROW* pRow, uint64_t uid, SIterInfo* pIter, SArray* pDe
tRowMergerGetRow
(
&
merge
,
pTSRow
);
tRowMergerClear
(
&
merge
);
if
(
sversion
!=
pReader
->
pSchema
->
version
)
{
if
(
pTSchema
!=
pReader
->
pSchema
)
{
taosMemoryFree
(
pTSchema
);
}
}
...
...
@@ -2425,9 +2432,9 @@ int32_t doAppendRowFromBlock(SSDataBlock* pResBlock, STsdbReader* pReader, SBloc
int32_t
numOfInputCols
=
taosArrayGetSize
(
pBlockData
->
aIdx
);
int32_t
numOfOutputCols
=
blockDataGetNumOfCols
(
pResBlock
);
while
(
i
<
numOfOutputCols
&&
j
<
numOfInputCols
)
{
while
(
i
<
numOfOutputCols
&&
j
<
numOfInputCols
)
{
SColumnInfoData
*
pCol
=
taosArrayGet
(
pResBlock
->
pDataBlock
,
i
);
SColData
*
pData
=
tBlockDataGetColDataByIdx
(
pBlockData
,
j
);
SColData
*
pData
=
tBlockDataGetColDataByIdx
(
pBlockData
,
j
);
if
(
pData
->
cid
==
pCol
->
info
.
colId
)
{
tColDataGetValue
(
pData
,
rowIndex
,
&
cv
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录