Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
5dcd319d
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看板
提交
5dcd319d
编写于
10月 19, 2022
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(query): update last_row callback function.
上级
c7c99ae3
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
10 addition
and
11 deletion
+10
-11
source/dnode/vnode/src/tsdb/tsdbCacheRead.c
source/dnode/vnode/src/tsdb/tsdbCacheRead.c
+10
-11
未找到文件。
source/dnode/vnode/src/tsdb/tsdbCacheRead.c
浏览文件 @
5dcd319d
...
@@ -69,7 +69,6 @@ static void saveOneRow(SArray* pRow, SSDataBlock* pBlock, SCacheRowsReader* pRea
...
@@ -69,7 +69,6 @@ static void saveOneRow(SArray* pRow, SSDataBlock* pBlock, SCacheRowsReader* pRea
}
else
{
}
else
{
ASSERT
((
pReader
->
type
&
CACHESCAN_RETRIEVE_LAST_ROW
)
==
CACHESCAN_RETRIEVE_LAST_ROW
);
ASSERT
((
pReader
->
type
&
CACHESCAN_RETRIEVE_LAST_ROW
)
==
CACHESCAN_RETRIEVE_LAST_ROW
);
SColVal
colVal
=
{
0
};
for
(
int32_t
i
=
0
;
i
<
pReader
->
numOfCols
;
++
i
)
{
for
(
int32_t
i
=
0
;
i
<
pReader
->
numOfCols
;
++
i
)
{
SColumnInfoData
*
pColInfoData
=
taosArrayGet
(
pBlock
->
pDataBlock
,
i
);
SColumnInfoData
*
pColInfoData
=
taosArrayGet
(
pBlock
->
pDataBlock
,
i
);
...
@@ -79,17 +78,18 @@ static void saveOneRow(SArray* pRow, SSDataBlock* pBlock, SCacheRowsReader* pRea
...
@@ -79,17 +78,18 @@ static void saveOneRow(SArray* pRow, SSDataBlock* pBlock, SCacheRowsReader* pRea
}
else
{
}
else
{
int32_t
slotId
=
slotIds
[
i
];
int32_t
slotId
=
slotIds
[
i
];
SLastCol
*
pColVal
=
(
SLastCol
*
)
taosArrayGet
(
pRow
,
slotId
);
SLastCol
*
pColVal
=
(
SLastCol
*
)
taosArrayGet
(
pRow
,
slotId
);
SColVal
*
pVal
=
&
pColVal
->
colVal
;
if
(
IS_VAR_DATA_TYPE
(
colVal
.
type
))
{
if
(
IS_VAR_DATA_TYPE
(
pColVal
->
colVal
.
type
))
{
if
(
!
COL_VAL_IS_VALUE
(
&
pColVal
->
colVal
))
{
if
(
!
COL_VAL_IS_VALUE
(
&
pColVal
->
colVal
))
{
colDataAppendNULL
(
pColInfoData
,
numOfRows
);
colDataAppendNULL
(
pColInfoData
,
numOfRows
);
}
else
{
}
else
{
varDataSetLen
(
pReader
->
transferBuf
[
slotId
],
colVal
.
value
.
nData
);
varDataSetLen
(
pReader
->
transferBuf
[
slotId
],
pVal
->
value
.
nData
);
memcpy
(
varDataVal
(
pReader
->
transferBuf
[
slotId
]),
colVal
.
value
.
pData
,
colVal
.
value
.
nData
);
memcpy
(
varDataVal
(
pReader
->
transferBuf
[
slotId
]),
pVal
->
value
.
pData
,
pVal
->
value
.
nData
);
colDataAppend
(
pColInfoData
,
numOfRows
,
pReader
->
transferBuf
[
slotId
],
false
);
colDataAppend
(
pColInfoData
,
numOfRows
,
pReader
->
transferBuf
[
slotId
],
false
);
}
}
}
else
{
}
else
{
colDataAppend
(
pColInfoData
,
numOfRows
,
(
const
char
*
)
&
colVal
.
value
,
!
COL_VAL_IS_VALUE
(
&
pColVal
->
col
Val
));
colDataAppend
(
pColInfoData
,
numOfRows
,
(
const
char
*
)
&
pVal
->
value
.
val
,
!
COL_VAL_IS_VALUE
(
p
Val
));
}
}
}
}
}
}
...
@@ -157,6 +157,8 @@ void* tsdbCacherowsReaderClose(void* pReader) {
...
@@ -157,6 +157,8 @@ void* tsdbCacherowsReaderClose(void* pReader) {
static
int32_t
doExtractCacheRow
(
SCacheRowsReader
*
pr
,
SLRUCache
*
lruCache
,
uint64_t
uid
,
SArray
**
pRow
,
static
int32_t
doExtractCacheRow
(
SCacheRowsReader
*
pr
,
SLRUCache
*
lruCache
,
uint64_t
uid
,
SArray
**
pRow
,
LRUHandle
**
h
)
{
LRUHandle
**
h
)
{
int32_t
code
=
TSDB_CODE_SUCCESS
;
int32_t
code
=
TSDB_CODE_SUCCESS
;
*
pRow
=
NULL
;
if
((
pr
->
type
&
CACHESCAN_RETRIEVE_LAST_ROW
)
==
CACHESCAN_RETRIEVE_LAST_ROW
)
{
if
((
pr
->
type
&
CACHESCAN_RETRIEVE_LAST_ROW
)
==
CACHESCAN_RETRIEVE_LAST_ROW
)
{
code
=
tsdbCacheGetLastrowH
(
lruCache
,
uid
,
pr
->
pVnode
->
pTsdb
,
h
);
code
=
tsdbCacheGetLastrowH
(
lruCache
,
uid
,
pr
->
pVnode
->
pTsdb
,
h
);
}
else
{
}
else
{
...
@@ -208,12 +210,9 @@ int32_t tsdbRetrieveCacheRows(void* pReader, SSDataBlock* pResBlock, const int32
...
@@ -208,12 +210,9 @@ int32_t tsdbRetrieveCacheRows(void* pReader, SSDataBlock* pResBlock, const int32
goto
_end
;
goto
_end
;
}
}
for
(
int32_t
i
=
0
;
i
<
pr
->
numOfCols
;
++
i
)
{
for
(
int32_t
i
=
0
;
i
<
pr
->
pSchema
->
numOfCols
;
++
i
)
{
SLastCol
p
=
{
0
};
p
.
ts
=
INT64_MIN
;
struct
STColumn
*
pCol
=
&
pr
->
pSchema
->
columns
[
i
];
struct
STColumn
*
pCol
=
&
pr
->
pSchema
->
columns
[
i
];
p
.
colVal
.
type
=
pCol
->
type
;
SLastCol
p
=
{.
ts
=
INT64_MIN
,
.
colVal
.
type
=
pCol
->
type
}
;
if
(
IS_VAR_DATA_TYPE
(
pCol
->
type
))
{
if
(
IS_VAR_DATA_TYPE
(
pCol
->
type
))
{
p
.
colVal
.
value
.
pData
=
taosMemoryCalloc
(
pCol
->
bytes
,
sizeof
(
char
));
p
.
colVal
.
value
.
pData
=
taosMemoryCalloc
(
pCol
->
bytes
,
sizeof
(
char
));
...
@@ -254,7 +253,7 @@ int32_t tsdbRetrieveCacheRows(void* pReader, SSDataBlock* pResBlock, const int32
...
@@ -254,7 +253,7 @@ int32_t tsdbRetrieveCacheRows(void* pReader, SSDataBlock* pResBlock, const int32
hasRes
=
true
;
hasRes
=
true
;
p
->
ts
=
pColVal
->
ts
;
p
->
ts
=
pColVal
->
ts
;
if
(
!
COL_VAL_IS_VALUE
(
&
pColVal
->
colVal
))
{
if
(
COL_VAL_IS_VALUE
(
&
pColVal
->
colVal
))
{
if
(
IS_VAR_DATA_TYPE
(
pColVal
->
colVal
.
type
))
{
if
(
IS_VAR_DATA_TYPE
(
pColVal
->
colVal
.
type
))
{
uint8_t
*
px
=
p
->
colVal
.
value
.
pData
;
uint8_t
*
px
=
p
->
colVal
.
value
.
pData
;
p
->
colVal
=
pColVal
->
colVal
;
p
->
colVal
=
pColVal
->
colVal
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录