Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
63e27798
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看板
提交
63e27798
编写于
12月 03, 2021
作者:
X
xywang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[TS-715]<enhance>: added threshold for 'UNION ALL'
上级
90c13670
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
11 addition
and
8 deletion
+11
-8
src/client/src/tscSQLParser.c
src/client/src/tscSQLParser.c
+9
-0
tests/pytest/query/unionAllTest.py
tests/pytest/query/unionAllTest.py
+2
-8
未找到文件。
src/client/src/tscSQLParser.c
浏览文件 @
63e27798
...
...
@@ -368,19 +368,28 @@ static int32_t handlePassword(SSqlCmd* pCmd, SStrToken* pPwd) {
// validate the out put field type for "UNION ALL" subclause
static
int32_t
normalizeVarDataTypeLength
(
SSqlCmd
*
pCmd
)
{
const
char
*
msg1
=
"columns in select clause not identical"
;
const
char
*
msg2
=
"too many select clause siblings, at most 100 allowed"
;
int32_t
siblings
=
0
;
int32_t
diffSize
=
0
;
// if there is only one element, the limit of clause is the limit of global result.
SQueryInfo
*
pQueryInfo1
=
pCmd
->
pQueryInfo
;
SQueryInfo
*
pSibling
=
pQueryInfo1
->
sibling
;
// pQueryInfo1 itself
++
siblings
;
while
(
pSibling
!=
NULL
)
{
int32_t
ret
=
tscFieldInfoCompare
(
&
pQueryInfo1
->
fieldsInfo
,
&
pSibling
->
fieldsInfo
,
&
diffSize
);
if
(
ret
!=
0
)
{
return
invalidOperationMsg
(
tscGetErrorMsgPayload
(
pCmd
),
msg1
);
}
if
(
++
siblings
>
100
)
{
return
invalidOperationMsg
(
tscGetErrorMsgPayload
(
pCmd
),
msg2
);
}
pSibling
=
pSibling
->
sibling
;
}
...
...
tests/pytest/query/unionAllTest.py
浏览文件 @
63e27798
...
...
@@ -109,7 +109,7 @@ class TDTestCase:
tdSql
.
execute
(
"create table st2(ts timestamp, c1 int, c2 int, c3 int) tags(loc nchar(20))"
)
for
i
in
range
(
7000
):
for
i
in
range
(
101
):
if
i
==
0
:
sql
=
"select last(*) from sub0 "
else
:
...
...
@@ -118,13 +118,7 @@ class TDTestCase:
tdSql
.
execute
(
"create table sub%d using st2 tags('nchar%d')"
%
(
i
,
i
))
tdSql
.
execute
(
"insert into sub%d values(%d, %d, %d, %d)"
%
(
i
,
self
.
ts
+
i
,
i
,
i
,
i
))
exception
=
"Exception(
\"
ProgrammingError('Result set too large to be output', -2147483097)
\"
)"
try
:
tdSql
.
query
(
sql
)
except
Exception
as
e
:
if
{
exception
}
!=
{
repr
(
e
)}:
tdLog
.
info
(
f
"sql:
{
sql
}
,
{
exception
}
expected, actually raises
{
repr
(
e
)
}
"
)
raise
e
tdSql
.
error
(
sql
)
def
stop
(
self
):
tdSql
.
close
()
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录