Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
2eb18e10
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
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看板
提交
2eb18e10
编写于
5月 26, 2021
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[td-225] add test cases.
上级
54fcf516
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
45 addition
and
2 deletion
+45
-2
src/client/src/tscSQLParser.c
src/client/src/tscSQLParser.c
+0
-1
src/client/src/tscServer.c
src/client/src/tscServer.c
+2
-0
src/client/src/tscUtil.c
src/client/src/tscUtil.c
+5
-0
tests/script/general/parser/nestquery.sim
tests/script/general/parser/nestquery.sim
+38
-1
未找到文件。
src/client/src/tscSQLParser.c
浏览文件 @
2eb18e10
...
@@ -7370,7 +7370,6 @@ static int32_t doValidateSubquery(SSqlNode* pSqlNode, int32_t index, SSqlObj* pS
...
@@ -7370,7 +7370,6 @@ static int32_t doValidateSubquery(SSqlNode* pSqlNode, int32_t index, SSqlObj* pS
SSqlNode
*
p
=
taosArrayGetP
(
subInfo
->
pSubquery
,
0
);
SSqlNode
*
p
=
taosArrayGetP
(
subInfo
->
pSubquery
,
0
);
SQueryInfo
*
pSub
=
calloc
(
1
,
sizeof
(
SQueryInfo
));
SQueryInfo
*
pSub
=
calloc
(
1
,
sizeof
(
SQueryInfo
));
printf
(
"-------------queryinfo:%p
\n
"
,
pSub
);
tscInitQueryInfo
(
pSub
);
tscInitQueryInfo
(
pSub
);
int32_t
code
=
validateSqlNode
(
pSql
,
p
,
pSub
);
int32_t
code
=
validateSqlNode
(
pSql
,
p
,
pSub
);
...
...
src/client/src/tscServer.c
浏览文件 @
2eb18e10
...
@@ -1614,6 +1614,7 @@ int tscProcessRetrieveLocalMergeRsp(SSqlObj *pSql) {
...
@@ -1614,6 +1614,7 @@ int tscProcessRetrieveLocalMergeRsp(SSqlObj *pSql) {
taosArrayPush
(
group
,
&
tableKeyInfo
);
taosArrayPush
(
group
,
&
tableKeyInfo
);
taosArrayPush
(
tableGroupInfo
.
pGroupList
,
&
group
);
taosArrayPush
(
tableGroupInfo
.
pGroupList
,
&
group
);
// todo remove it
SExprInfo
*
list
=
calloc
(
tscNumOfExprs
(
pQueryInfo
),
sizeof
(
SExprInfo
));
SExprInfo
*
list
=
calloc
(
tscNumOfExprs
(
pQueryInfo
),
sizeof
(
SExprInfo
));
for
(
int32_t
i
=
0
;
i
<
tscNumOfExprs
(
pQueryInfo
);
++
i
)
{
for
(
int32_t
i
=
0
;
i
<
tscNumOfExprs
(
pQueryInfo
);
++
i
)
{
SExprInfo
*
pExprInfo
=
tscExprGet
(
pQueryInfo
,
i
);
SExprInfo
*
pExprInfo
=
tscExprGet
(
pQueryInfo
,
i
);
...
@@ -1621,6 +1622,7 @@ int tscProcessRetrieveLocalMergeRsp(SSqlObj *pSql) {
...
@@ -1621,6 +1622,7 @@ int tscProcessRetrieveLocalMergeRsp(SSqlObj *pSql) {
}
}
pQueryInfo
->
pQInfo
=
createQInfoFromQueryNode
(
pQueryInfo
,
list
,
&
tableGroupInfo
,
NULL
,
NULL
,
pRes
->
pLocalMerger
,
MERGE_STAGE
);
pQueryInfo
->
pQInfo
=
createQInfoFromQueryNode
(
pQueryInfo
,
list
,
&
tableGroupInfo
,
NULL
,
NULL
,
pRes
->
pLocalMerger
,
MERGE_STAGE
);
tfree
(
list
);
}
}
uint64_t
localQueryId
=
0
;
uint64_t
localQueryId
=
0
;
...
...
src/client/src/tscUtil.c
浏览文件 @
2eb18e10
...
@@ -1010,6 +1010,11 @@ void handleDownstreamOperator(SSqlObj** pSqlObjList, int32_t numOfUpstream, SQue
...
@@ -1010,6 +1010,11 @@ void handleDownstreamOperator(SSqlObj** pSqlObjList, int32_t numOfUpstream, SQue
pSourceOperator
=
createJoinOperator
(
p
,
px
->
numOfTables
,
schema
,
num
);
pSourceOperator
=
createJoinOperator
(
p
,
px
->
numOfTables
,
schema
,
num
);
tfree
(
p
);
tfree
(
p
);
}
else
{
int32_t
num
=
taosArrayGetSize
(
px
->
colList
);
schema
=
calloc
(
num
,
sizeof
(
SSchema
));
memcpy
(
schema
,
pSchema
,
numOfCol1
*
sizeof
(
SSchema
));
}
}
SExprInfo
*
exprInfo
=
NULL
;
SExprInfo
*
exprInfo
=
NULL
;
...
...
tests/script/general/parser/nestquery.sim
浏览文件 @
2eb18e10
...
@@ -61,6 +61,43 @@ sleep 100
...
@@ -61,6 +61,43 @@ sleep 100
$i = 1
$i = 1
$tb = $tbPrefix . $i
$tb = $tbPrefix . $i
sql select count(*) from (select
print simple nest query test
sql select count(*) from (select count(*) from nest_mt0))
if $rows != 1 then
return -1
endi
if $data00 != 1 then
return -1
endi
sql select count(*) from (select count(*) from nest_mt0 group by tbname)
if $rows != 1 then
return -1
endi
if $data00 != 10 then
return -1
endi
sql select count(*) from (select count(*) from nest_mt0 interval(10h) group by tbname)
if $rows != 1 then
return -1
endi
if $data00 != 10 then
return -1
endi
print =================> alias name test
sql select count(a) from (select count(*) a from nest_tb0 interval(1h))
if $rows != 1 then
return -1
endi
if $data00 != 1 then
return -1
endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录