Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
b159b0ff
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
b159b0ff
编写于
4月 27, 2022
作者:
H
Haojun Liao
提交者:
GitHub
4月 27, 2022
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #11957 from taosdata/feature/3.0_liaohj
fix(query): enable the limitation on the number of query results
上级
cf815455
d41a9e8b
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
21 addition
and
8 deletion
+21
-8
source/client/src/clientImpl.c
source/client/src/clientImpl.c
+10
-3
source/libs/executor/src/executorimpl.c
source/libs/executor/src/executorimpl.c
+11
-4
source/libs/parser/src/parInsert.c
source/libs/parser/src/parInsert.c
+0
-1
未找到文件。
source/client/src/clientImpl.c
浏览文件 @
b159b0ff
...
...
@@ -358,8 +358,15 @@ SRequestObj* launchQuery(STscObj* pTscObj, const char* sql, int sqlLen) {
SQuery
*
pQuery
=
NULL
;
int32_t
code
=
buildRequest
(
pTscObj
,
sql
,
sqlLen
,
&
pRequest
);
if
(
TSDB_CODE_SUCCESS
==
code
)
{
code
=
parseSql
(
pRequest
,
false
,
&
pQuery
,
NULL
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
terrno
=
code
;
return
NULL
;
}
code
=
parseSql
(
pRequest
,
false
,
&
pQuery
,
NULL
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
pRequest
->
code
=
code
;
return
pRequest
;
}
return
launchQueryImpl
(
pRequest
,
pQuery
,
code
,
false
);
...
...
@@ -410,7 +417,7 @@ SRequestObj* execQuery(STscObj* pTscObj, const char* sql, int sqlLen) {
while
(
retryNum
++
<
REQUEST_MAX_TRY_TIMES
)
{
pRequest
=
launchQuery
(
pTscObj
,
sql
,
sqlLen
);
if
(
TSDB_CODE_SUCCESS
==
pRequest
->
code
||
!
NEED_CLIENT_HANDLE_ERROR
(
pRequest
->
code
))
{
if
(
pRequest
==
NULL
||
TSDB_CODE_SUCCESS
==
pRequest
->
code
||
!
NEED_CLIENT_HANDLE_ERROR
(
pRequest
->
code
))
{
break
;
}
...
...
source/libs/executor/src/executorimpl.c
浏览文件 @
b159b0ff
...
...
@@ -4994,13 +4994,20 @@ static int32_t handleLimitOffset(SOperatorInfo* pOperator, SSDataBlock* pBlock)
pProjectInfo
->
curOffset
=
0
;
}
if
(
pRes
->
info
.
rows
>=
pOperator
->
resultInfo
.
threshold
)
{
// check for the limitation in each group
if
(
pProjectInfo
->
limit
.
limit
>
0
&&
pProjectInfo
->
curOutput
+
pRes
->
info
.
rows
>=
pProjectInfo
->
limit
.
limit
)
{
pRes
->
info
.
rows
=
(
int32_t
)(
pProjectInfo
->
limit
.
limit
-
pProjectInfo
->
curOutput
);
// check for the limitation in each group
if
(
pProjectInfo
->
limit
.
limit
>
0
&&
pProjectInfo
->
curOutput
+
pRes
->
info
.
rows
>=
pProjectInfo
->
limit
.
limit
)
{
pRes
->
info
.
rows
=
(
int32_t
)(
pProjectInfo
->
limit
.
limit
-
pProjectInfo
->
curOutput
);
if
(
pProjectInfo
->
slimit
.
limit
==
-
1
||
pProjectInfo
->
slimit
.
limit
<=
pProjectInfo
->
curGroupOutput
)
{
pOperator
->
status
=
OP_EXEC_DONE
;
}
return
PROJECT_RETRIEVE_DONE
;
}
// If there are slimit/soffset value exists, multi-round result can not be packed into one group, since the
// they may not belong to the same group the limit/offset value is not valid in this case.
if
(
pRes
->
info
.
rows
>=
pOperator
->
resultInfo
.
threshold
||
pProjectInfo
->
slimit
.
offset
!=
-
1
||
pProjectInfo
->
slimit
.
limit
!=
-
1
)
{
return
PROJECT_RETRIEVE_DONE
;
}
else
{
// not full enough, continue to accumulate the output data in the buffer.
return
PROJECT_RETRIEVE_CONTINUE
;
...
...
source/libs/parser/src/parInsert.c
浏览文件 @
b159b0ff
...
...
@@ -1069,7 +1069,6 @@ static int32_t parseInsertBody(SInsertParseContext* pCxt) {
if
(
TSDB_QUERY_HAS_TYPE
(
pCxt
->
pOutput
->
insertType
,
TSDB_QUERY_TYPE_STMT_INSERT
)
&&
tbNum
>
0
)
{
return
buildInvalidOperationMsg
(
&
pCxt
->
msg
,
"single table allowed in one stmt"
);
;
}
destroyInsertParseContextForTable
(
pCxt
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录