Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
3493fffa
T
TDengine
项目概览
taosdata
/
TDengine
大约 1 年 前同步成功
通知
1181
Star
22014
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看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
3493fffa
编写于
4月 13, 2023
作者:
D
dapan1121
提交者:
GitHub
4月 13, 2023
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #20863 from taosdata/fix/TD-23556
fix: fix max/min(tag) random result
上级
7dc6bf0d
81610773
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
13 addition
and
6 deletion
+13
-6
source/libs/executor/src/scanoperator.c
source/libs/executor/src/scanoperator.c
+2
-2
tests/system-test/2-query/max.py
tests/system-test/2-query/max.py
+11
-4
未找到文件。
source/libs/executor/src/scanoperator.c
浏览文件 @
3493fffa
...
...
@@ -329,7 +329,7 @@ static int32_t loadDataBlock(SOperatorInfo* pOperator, STableScanBase* pTableSca
}
else
if
(
*
status
==
FUNC_DATA_REQUIRED_NOT_LOAD
)
{
qDebug
(
"%s data block skipped, brange:%"
PRId64
"-%"
PRId64
", rows:%"
PRId64
", uid:%"
PRIu64
,
GET_TASKID
(
pTaskInfo
),
pBlockInfo
->
window
.
skey
,
pBlockInfo
->
window
.
ekey
,
pBlockInfo
->
rows
,
pBlockInfo
->
id
.
uid
);
doSetTagColumnData
(
pTableScanInfo
,
pBlock
,
pTaskInfo
,
1
);
doSetTagColumnData
(
pTableScanInfo
,
pBlock
,
pTaskInfo
,
pBlock
->
info
.
rows
);
pCost
->
skipBlocks
+=
1
;
tsdbReleaseDataBlock
(
pTableScanInfo
->
dataReader
);
return
TSDB_CODE_SUCCESS
;
...
...
@@ -340,7 +340,7 @@ static int32_t loadDataBlock(SOperatorInfo* pOperator, STableScanBase* pTableSca
if
(
success
)
{
// failed to load the block sma data, data block statistics does not exist, load data block instead
qDebug
(
"%s data block SMA loaded, brange:%"
PRId64
"-%"
PRId64
", rows:%"
PRId64
,
GET_TASKID
(
pTaskInfo
),
pBlockInfo
->
window
.
skey
,
pBlockInfo
->
window
.
ekey
,
pBlockInfo
->
rows
);
doSetTagColumnData
(
pTableScanInfo
,
pBlock
,
pTaskInfo
,
1
);
doSetTagColumnData
(
pTableScanInfo
,
pBlock
,
pTaskInfo
,
pBlock
->
info
.
rows
);
tsdbReleaseDataBlock
(
pTableScanInfo
->
dataReader
);
return
TSDB_CODE_SUCCESS
;
}
else
{
...
...
tests/system-test/2-query/max.py
浏览文件 @
3493fffa
...
...
@@ -20,8 +20,8 @@ class TDTestCase:
intData
=
[]
floatData
=
[]
tdSql
.
execute
(
f
'''create table
{
dbname
}
.stb(ts timestamp, col1 tinyint, col2 smallint, col3 int, col4 bigint, col5 tinyint unsigned, col6 smallint unsigned,
col7 int unsigned, col8 bigint unsigned, col9 float, col10 double, col11 bool, col12 binary(20), col13 nchar(20)) tags(loc nchar(20))'''
)
tdSql
.
execute
(
f
"create table
{
dbname
}
.stb_1 using
{
dbname
}
.stb tags('beijing')"
)
col7 int unsigned, col8 bigint unsigned, col9 float, col10 double, col11 bool, col12 binary(20), col13 nchar(20)) tags(
t0 tinyint, t1 float,
loc nchar(20))'''
)
tdSql
.
execute
(
f
"create table
{
dbname
}
.stb_1 using
{
dbname
}
.stb tags(
5, 5.5,
'beijing')"
)
for
i
in
range
(
self
.
rowNum
):
tdSql
.
execute
(
f
"insert into
{
dbname
}
.stb_1 values(%d, %d, %d, %d, %d, %d, %d, %d, %d, %f, %f, %d, '
{
self
.
binary_str
}
%d', '
{
self
.
nchar_str
}
%d')"
%
(
self
.
ts
+
i
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
0.1
,
i
+
0.1
,
i
%
2
,
i
+
1
,
i
+
1
))
...
...
@@ -55,13 +55,20 @@ class TDTestCase:
tdSql
.
checkData
(
0
,
1
,
np
.
max
(
intData
))
tdSql
.
query
(
f
"select ts, min(col9) from
{
dbname
}
.stb"
)
tdSql
.
checkRows
(
1
)
tdSql
.
checkRows
(
1
)
tdSql
.
checkData
(
0
,
1
,
np
.
min
(
floatData
))
tdSql
.
query
(
f
"select ts, min(col9) from
{
dbname
}
.stb_1"
)
tdSql
.
checkRows
(
1
)
tdSql
.
checkRows
(
1
)
tdSql
.
checkData
(
0
,
1
,
np
.
min
(
floatData
))
# check tags
tdSql
.
query
(
f
"select max(t0) from
{
dbname
}
.stb"
)
tdSql
.
checkData
(
0
,
0
,
5
)
tdSql
.
query
(
f
"select max(t1) from
{
dbname
}
.stb"
)
tdSql
.
checkData
(
0
,
0
,
5.5
)
def
max_check_ntb_base
(
self
,
dbname
=
"db"
):
tdSql
.
prepare
()
intData
=
[]
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录