Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
83782fb2
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1187
Star
22018
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看板
提交
83782fb2
编写于
12月 02, 2022
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(query): fix invalid tag fill and clear nullbitmp
上级
1faf616f
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
33 addition
and
16 deletion
+33
-16
include/common/tdatablock.h
include/common/tdatablock.h
+3
-3
source/common/src/tdatablock.c
source/common/src/tdatablock.c
+4
-4
source/libs/executor/src/tfill.c
source/libs/executor/src/tfill.c
+22
-6
tests/script/tsim/parser/lastrow_query.sim
tests/script/tsim/parser/lastrow_query.sim
+2
-2
tests/script/tsim/valgrind/checkUdf.sim
tests/script/tsim/valgrind/checkUdf.sim
+2
-1
未找到文件。
include/common/tdatablock.h
浏览文件 @
83782fb2
...
...
@@ -41,9 +41,9 @@ typedef struct SBlockOrderInfo {
BMCharPos(bm_, r_) |= (1u << (7u - BitPos(r_))); \
} while (0)
#define colDataClearNull_f(bm_, r_) \
do { \
BMCharPos(bm_, r_) &=
~(1u << (7u - BitPos(r_
))); \
#define colDataClearNull_f(bm_, r_)
\
do {
\
BMCharPos(bm_, r_) &=
((char)(~(1u << (7u - BitPos(r_))
))); \
} while (0)
#define colDataIsNull_var(pColumnInfoData, row) (pColumnInfoData->varmeta.offset[row] == -1)
...
...
source/common/src/tdatablock.c
浏览文件 @
83782fb2
...
...
@@ -1679,15 +1679,15 @@ static void colDataKeepFirstNRows(SColumnInfoData* pColInfoData, size_t n, size_
pColInfoData
->
varmeta
.
length
=
colDataMoveVarData
(
pColInfoData
,
0
,
n
);
memset
(
&
pColInfoData
->
varmeta
.
offset
[
n
],
0
,
total
-
n
);
}
else
{
// reset the bitmap value
int32_t
stopIndex
=
BitmapLen
(
n
)
*
8
;
for
(
int32_t
i
=
n
+
1
;
i
<
stopIndex
;
++
i
)
{
/*
int32_t stopIndex = BitmapLen(n) * 8;
for(int32_t i = n; i < stopIndex; ++i) {
colDataClearNull_f(pColInfoData->nullbitmap, i);
}
int32_t remain = BitmapLen(total) - BitmapLen(n);
if (remain > 0) {
memset
(
pColInfoData
->
nullbitmap
,
0
,
remain
);
}
memset(pColInfoData->nullbitmap
+BitmapLen(n)
, 0, remain);
}
*/
}
}
...
...
source/libs/executor/src/tfill.c
浏览文件 @
83782fb2
...
...
@@ -60,8 +60,18 @@ static void setNullRow(SSDataBlock* pBlock, SFillInfo* pFillInfo, int32_t rowInd
if
(
pCol
->
notFillCol
)
{
bool
filled
=
fillIfWindowPseudoColumn
(
pFillInfo
,
pCol
,
pDstColInfo
,
rowIndex
);
if
(
!
filled
)
{
SArray
*
p
=
FILL_IS_ASC_FILL
(
pFillInfo
)
?
pFillInfo
->
prev
.
pRowVal
:
pFillInfo
->
next
.
pRowVal
;
SGroupKeys
*
pKey
=
taosArrayGet
(
p
,
i
);
SRowVal
*
p
=
NULL
;
if
(
FILL_IS_ASC_FILL
(
pFillInfo
))
{
if
(
pFillInfo
->
prev
.
key
!=
0
)
{
p
=
&
pFillInfo
->
prev
;
// prev has been set value
}
else
{
// otherwise, use the value in the next row
p
=
&
pFillInfo
->
next
;
}
}
else
{
p
=
&
pFillInfo
->
next
;
}
SGroupKeys
*
pKey
=
taosArrayGet
(
p
->
pRowVal
,
i
);
doSetVal
(
pDstColInfo
,
rowIndex
,
pKey
);
}
}
else
{
...
...
@@ -261,7 +271,10 @@ static void initBeforeAfterDataBuf(SFillInfo* pFillInfo) {
static
void
saveColData
(
SArray
*
rowBuf
,
int32_t
columnIndex
,
const
char
*
src
,
bool
isNull
);
static
void
copyCurrentRowIntoBuf
(
SFillInfo
*
pFillInfo
,
int32_t
rowIndex
,
SArray
*
pRow
)
{
static
void
copyCurrentRowIntoBuf
(
SFillInfo
*
pFillInfo
,
int32_t
rowIndex
,
SRowVal
*
pRowVal
)
{
SColumnInfoData
*
pTsCol
=
taosArrayGet
(
pFillInfo
->
pSrcBlock
->
pDataBlock
,
pFillInfo
->
srcTsSlotId
);
pRowVal
->
key
=
((
int64_t
*
)
pTsCol
->
pData
)[
rowIndex
];
for
(
int32_t
i
=
0
;
i
<
pFillInfo
->
numOfCols
;
++
i
)
{
int32_t
type
=
pFillInfo
->
pFillCol
[
i
].
pExpr
->
pExpr
->
nodeType
;
if
(
type
==
QUERY_NODE_COLUMN
||
type
==
QUERY_NODE_OPERATOR
||
type
==
QUERY_NODE_FUNCTION
)
{
...
...
@@ -272,7 +285,7 @@ static void copyCurrentRowIntoBuf(SFillInfo* pFillInfo, int32_t rowIndex, SArray
bool
isNull
=
colDataIsNull_s
(
pSrcCol
,
rowIndex
);
char
*
p
=
colDataGetData
(
pSrcCol
,
rowIndex
);
saveColData
(
pRow
,
i
,
p
,
isNull
);
saveColData
(
pRow
Val
->
pRowVal
,
i
,
p
,
isNull
);
}
else
{
ASSERT
(
0
);
}
...
...
@@ -296,7 +309,7 @@ static int32_t fillResultImpl(SFillInfo* pFillInfo, SSDataBlock* pBlock, int32_t
// set the next value for interpolation
if
((
pFillInfo
->
currentKey
<
ts
&&
ascFill
)
||
(
pFillInfo
->
currentKey
>
ts
&&
!
ascFill
))
{
copyCurrentRowIntoBuf
(
pFillInfo
,
pFillInfo
->
index
,
pFillInfo
->
next
.
pRowVal
);
copyCurrentRowIntoBuf
(
pFillInfo
,
pFillInfo
->
index
,
&
pFillInfo
->
next
);
}
if
(((
pFillInfo
->
currentKey
<
ts
&&
ascFill
)
||
(
pFillInfo
->
currentKey
>
ts
&&
!
ascFill
))
&&
...
...
@@ -318,7 +331,7 @@ static int32_t fillResultImpl(SFillInfo* pFillInfo, SSDataBlock* pBlock, int32_t
if
(
pFillInfo
->
type
==
TSDB_FILL_NEXT
&&
(
pFillInfo
->
index
+
1
)
<
pFillInfo
->
numOfRows
)
{
int32_t
nextRowIndex
=
pFillInfo
->
index
+
1
;
copyCurrentRowIntoBuf
(
pFillInfo
,
nextRowIndex
,
pFillInfo
->
next
.
pRowVal
);
copyCurrentRowIntoBuf
(
pFillInfo
,
nextRowIndex
,
&
pFillInfo
->
next
);
}
// copy rows to dst buffer
...
...
@@ -334,6 +347,9 @@ static int32_t fillResultImpl(SFillInfo* pFillInfo, SSDataBlock* pBlock, int32_t
if
(
!
colDataIsNull_s
(
pSrc
,
pFillInfo
->
index
))
{
colDataAppend
(
pDst
,
index
,
src
,
false
);
saveColData
(
pFillInfo
->
prev
.
pRowVal
,
i
,
src
,
false
);
if
(
pFillInfo
->
srcTsSlotId
==
dstSlotId
)
{
pFillInfo
->
prev
.
key
=
*
(
int64_t
*
)
src
;
}
}
else
{
// the value is null
if
(
pDst
->
info
.
type
==
TSDB_DATA_TYPE_TIMESTAMP
)
{
colDataAppend
(
pDst
,
index
,
(
const
char
*
)
&
pFillInfo
->
currentKey
,
false
);
...
...
tests/script/tsim/parser/lastrow_query.sim
浏览文件 @
83782fb2
...
...
@@ -70,10 +70,10 @@ sql select _wstart, t1,t1,count(*),t1,t1 from lr_stb0 where ts>'2018-09-24 00:00
if $row != 2 then
return -1
endi
if $data01 !=
NULL
then
if $data01 !=
8
then
return -1
endi
if $data02 !=
NULL
then
if $data02 !=
8
then
return -1
endi
if $data03 != NULL then
...
...
tests/script/tsim/valgrind/checkUdf.sim
浏览文件 @
83782fb2
...
...
@@ -121,12 +121,13 @@ if $data01 != 152.420471066 then
return -1
endi
sql select udf2(f2) from udf.t2 group by 1-udf1(f1)
;
sql select udf2(f2) from udf.t2 group by 1-udf1(f1)
order by 1-udf1(f1)
print $rows , $data00 , $data10
if $rows != 2 then
return -1
endi
if $data00 != 2.000000000 then
print expect 2.000000000 , actual: $data00
return -1
endi
if $data10 != 12.083045974 then
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录