Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
98a4e099
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看板
未验证
提交
98a4e099
编写于
4月 20, 2022
作者:
H
Haojun Liao
提交者:
GitHub
4月 20, 2022
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #11652 from taosdata/feature/3.0_liaohj
fix(query): set the start row index to be the correct value.
上级
8213315f
cf486c57
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
18 addition
and
14 deletion
+18
-14
source/dnode/vnode/src/tsdb/tsdbRead.c
source/dnode/vnode/src/tsdb/tsdbRead.c
+18
-14
未找到文件。
source/dnode/vnode/src/tsdb/tsdbRead.c
浏览文件 @
98a4e099
...
...
@@ -1410,30 +1410,33 @@ static int32_t doCopyRowsFromFileBlock(STsdbReadHandle* pTsdbReadHandle, int32_t
if
(
!
isAllRowsNull
(
src
)
&&
pColInfo
->
info
.
colId
==
src
->
colId
)
{
if
(
!
IS_VAR_DATA_TYPE
(
pColInfo
->
info
.
type
))
{
// todo opt performance
// memmove(pData, (char*)src->pData + bytes * start, bytes * num);
for
(
int32_t
k
=
start
;
k
<
num
+
start
;
++
k
)
{
int32_t
rowIndex
=
numOfRows
;
for
(
int32_t
k
=
start
;
k
<=
end
;
++
k
,
++
rowIndex
)
{
SCellVal
sVal
=
{
0
};
if
(
tdGetColDataOfRow
(
&
sVal
,
src
,
k
,
pCols
->
bitmapMode
)
<
0
)
{
TASSERT
(
0
);
}
if
(
sVal
.
valType
==
TD_VTYPE_NULL
)
{
colDataAppendNULL
(
pColInfo
,
k
);
colDataAppendNULL
(
pColInfo
,
rowIndex
);
}
else
{
colDataAppend
(
pColInfo
,
k
,
sVal
.
val
,
false
);
colDataAppend
(
pColInfo
,
rowIndex
,
sVal
.
val
,
false
);
}
}
}
else
{
// handle the var-string
int32_t
rowIndex
=
numOfRows
;
// todo refactor, only copy one-by-one
for
(
int32_t
k
=
start
;
k
<
num
+
start
;
++
k
)
{
for
(
int32_t
k
=
start
;
k
<
num
+
start
;
++
k
,
++
rowIndex
)
{
SCellVal
sVal
=
{
0
};
if
(
tdGetColDataOfRow
(
&
sVal
,
src
,
k
,
pCols
->
bitmapMode
)
<
0
)
{
TASSERT
(
0
);
}
if
(
sVal
.
valType
==
TD_VTYPE_NULL
)
{
colDataAppendNULL
(
pColInfo
,
k
);
colDataAppendNULL
(
pColInfo
,
rowIndex
);
}
else
{
colDataAppend
(
pColInfo
,
k
,
sVal
.
val
,
false
);
colDataAppend
(
pColInfo
,
rowIndex
,
sVal
.
val
,
false
);
}
}
}
...
...
@@ -1441,8 +1444,9 @@ static int32_t doCopyRowsFromFileBlock(STsdbReadHandle* pTsdbReadHandle, int32_t
j
++
;
i
++
;
}
else
{
// pColInfo->info.colId < src->colId, it is a NULL data
for
(
int32_t
k
=
start
;
k
<
num
+
start
;
++
k
)
{
// TODO opt performance
colDataAppend
(
pColInfo
,
k
,
NULL
,
true
);
int32_t
rowIndex
=
numOfRows
;
for
(
int32_t
k
=
start
;
k
<
num
+
start
;
++
k
,
++
rowIndex
)
{
// TODO opt performance
colDataAppend
(
pColInfo
,
rowIndex
,
NULL
,
true
);
}
i
++
;
}
...
...
@@ -1450,8 +1454,10 @@ static int32_t doCopyRowsFromFileBlock(STsdbReadHandle* pTsdbReadHandle, int32_t
while
(
i
<
requiredNumOfCols
)
{
// the remain columns are all null data
SColumnInfoData
*
pColInfo
=
taosArrayGet
(
pTsdbReadHandle
->
pColumns
,
i
);
for
(
int32_t
k
=
start
;
k
<
num
+
start
;
++
k
)
{
colDataAppend
(
pColInfo
,
k
,
NULL
,
true
);
// TODO add a fast version to set a number of consecutive NULL value.
int32_t
rowIndex
=
numOfRows
;
for
(
int32_t
k
=
start
;
k
<
num
+
start
;
++
k
,
++
rowIndex
)
{
colDataAppend
(
pColInfo
,
rowIndex
,
NULL
,
true
);
// TODO add a fast version to set a number of consecutive NULL value.
}
i
++
;
}
...
...
@@ -1749,7 +1755,7 @@ int32_t getEndPosInDataBlock(STsdbReadHandle* pTsdbReadHandle, SDataBlockInfo* p
// be included in the query time window will be discarded
static
void
doMergeTwoLevelData
(
STsdbReadHandle
*
pTsdbReadHandle
,
STableCheckInfo
*
pCheckInfo
,
SBlock
*
pBlock
)
{
SQueryFilePos
*
cur
=
&
pTsdbReadHandle
->
cur
;
SDataBlockInfo
blockInfo
=
{
0
};
//
GET_FILE_DATA_BLOCK_INFO(pCheckInfo, pBlock);
SDataBlockInfo
blockInfo
=
GET_FILE_DATA_BLOCK_INFO
(
pCheckInfo
,
pBlock
);
STsdbCfg
*
pCfg
=
&
pTsdbReadHandle
->
pTsdb
->
config
;
initTableMemIterator
(
pTsdbReadHandle
,
pCheckInfo
);
...
...
@@ -1771,9 +1777,7 @@ static void doMergeTwoLevelData(STsdbReadHandle* pTsdbReadHandle, STableCheckInf
STable
*
pTable
=
NULL
;
int32_t
endPos
=
getEndPosInDataBlock
(
pTsdbReadHandle
,
&
blockInfo
);
tsdbDebug
(
"%p uid:%"
PRIu64
" start merge data block, file block range:%"
PRIu64
"-%"
PRIu64
" rows:%d, start:%d,"
"end:%d, %s"
,
tsdbDebug
(
"%p uid:%"
PRIu64
" start merge data block, file block range:%"
PRIu64
"-%"
PRIu64
" rows:%d, start:%d, end:%d, %s"
,
pTsdbReadHandle
,
pCheckInfo
->
tableId
,
blockInfo
.
window
.
skey
,
blockInfo
.
window
.
ekey
,
blockInfo
.
rows
,
cur
->
pos
,
endPos
,
pTsdbReadHandle
->
idStr
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录