Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
9f1af4e8
T
TDengine
项目概览
taosdata
/
TDengine
大约 2 年 前同步成功
通知
1192
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看板
未验证
提交
9f1af4e8
编写于
1月 11, 2022
作者:
H
Haojun Liao
提交者:
GitHub
1月 11, 2022
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #9650 from taosdata/fix/TS-802-V24
[TS-802]<fix>(query): add parent query have order by desc case
上级
812bef29
0df873dd
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
23 addition
and
2 deletion
+23
-2
src/common/src/tglobal.c
src/common/src/tglobal.c
+1
-1
src/query/src/qExecutor.c
src/query/src/qExecutor.c
+6
-0
tests/pytest/query/queryBase.py
tests/pytest/query/queryBase.py
+16
-1
未找到文件。
src/common/src/tglobal.c
浏览文件 @
9f1af4e8
...
...
@@ -289,7 +289,7 @@ char Compressor[32] = "ZSTD_COMPRESSOR"; // ZSTD_COMPRESSOR or GZIP_COMPRES
#endif
// long query death-lock
int8_t
tsDeadLockKillQuery
=
0
;
int8_t
tsDeadLockKillQuery
=
1
;
// default JSON string type
char
tsDefaultJSONStrType
[
7
]
=
"nchar"
;
...
...
src/query/src/qExecutor.c
浏览文件 @
9f1af4e8
...
...
@@ -1808,11 +1808,17 @@ static bool functionNeedToExecute(SQueryRuntimeEnv *pRuntimeEnv, SQLFunctionCtx
}
if
(
functionId
==
TSDB_FUNC_FIRST_DST
||
functionId
==
TSDB_FUNC_FIRST
)
{
// if param[2] is set value, input data come from client, order is no relation with pQueryAttr->order , so always return true
if
(
pCtx
->
param
[
2
].
nType
==
TSDB_DATA_TYPE_INT
)
return
true
;
return
QUERY_IS_ASC_QUERY
(
pQueryAttr
);
}
// denote the order type
if
((
functionId
==
TSDB_FUNC_LAST_DST
||
functionId
==
TSDB_FUNC_LAST
))
{
// if param[2] is set value, input data come from client, order is no relation with pQueryAttr->order , so always return true
if
(
pCtx
->
param
[
2
].
nType
==
TSDB_DATA_TYPE_INT
)
return
true
;
return
pCtx
->
param
[
0
].
i64
==
pQueryAttr
->
order
.
order
;
}
...
...
tests/pytest/query/queryBase.py
浏览文件 @
9f1af4e8
...
...
@@ -155,6 +155,21 @@ class TDTestCase:
tdSql
.
waitedQuery
(
sql
,
1
,
WAITS
)
tdSql
.
checkData
(
0
,
1
,
192419100
)
# add parent query order by
# first
sql
=
"select first(*) from (select first(i1) from st interval(10m) order by ts asc) order by ts desc;"
tdSql
.
waitedQuery
(
sql
,
1
,
WAITS
)
tdSql
.
checkData
(
0
,
1
,
0
)
sql
=
"select first(*) from (select first(i1) from st interval(10m) order by ts desc) order by ts asc;"
tdSql
.
waitedQuery
(
sql
,
1
,
WAITS
)
tdSql
.
checkData
(
0
,
1
,
0
)
# last
sql
=
"select last(*) from (select first(i1) from st interval(10m) order by ts asc) order by ts desc;"
tdSql
.
waitedQuery
(
sql
,
1
,
WAITS
)
tdSql
.
checkData
(
0
,
1
,
229400
)
sql
=
"select last(*) from (select first(i1) from st interval(10m) order by ts desc) order by ts asc;"
tdSql
.
waitedQuery
(
sql
,
1
,
WAITS
)
tdSql
.
checkData
(
0
,
1
,
229400
)
#
# add case with filename
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录