Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
15a08b99
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看板
提交
15a08b99
编写于
7月 30, 2022
作者:
X
Xiaoyu Wang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: some problems of planner
上级
b08a28d5
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
17 addition
and
4 deletion
+17
-4
source/libs/nodes/src/nodesCodeFuncs.c
source/libs/nodes/src/nodesCodeFuncs.c
+7
-0
source/libs/nodes/src/nodesUtilFuncs.c
source/libs/nodes/src/nodesUtilFuncs.c
+1
-1
source/libs/planner/test/planSubqueryTest.cpp
source/libs/planner/test/planSubqueryTest.cpp
+6
-0
tests/script/tsim/parser/condition_query.sim
tests/script/tsim/parser/condition_query.sim
+3
-3
未找到文件。
source/libs/nodes/src/nodesCodeFuncs.c
浏览文件 @
15a08b99
...
...
@@ -2684,6 +2684,7 @@ static int32_t jsonToDataType(const SJson* pJson, void* pObj) {
static
const
char
*
jkExprDataType
=
"DataType"
;
static
const
char
*
jkExprAliasName
=
"AliasName"
;
static
const
char
*
jkExprUserAlias
=
"UserAlias"
;
static
int32_t
exprNodeToJson
(
const
void
*
pObj
,
SJson
*
pJson
)
{
const
SExprNode
*
pNode
=
(
const
SExprNode
*
)
pObj
;
...
...
@@ -2692,6 +2693,9 @@ static int32_t exprNodeToJson(const void* pObj, SJson* pJson) {
if
(
TSDB_CODE_SUCCESS
==
code
)
{
code
=
tjsonAddStringToObject
(
pJson
,
jkExprAliasName
,
pNode
->
aliasName
);
}
if
(
TSDB_CODE_SUCCESS
==
code
)
{
code
=
tjsonAddStringToObject
(
pJson
,
jkExprUserAlias
,
pNode
->
userAlias
);
}
return
code
;
}
...
...
@@ -2703,6 +2707,9 @@ static int32_t jsonToExprNode(const SJson* pJson, void* pObj) {
if
(
TSDB_CODE_SUCCESS
==
code
)
{
code
=
tjsonGetStringValue
(
pJson
,
jkExprAliasName
,
pNode
->
aliasName
);
}
if
(
TSDB_CODE_SUCCESS
==
code
)
{
code
=
tjsonGetStringValue
(
pJson
,
jkExprUserAlias
,
pNode
->
userAlias
);
}
return
code
;
}
...
...
source/libs/nodes/src/nodesUtilFuncs.c
浏览文件 @
15a08b99
...
...
@@ -1502,7 +1502,7 @@ static EDealRes collectColumns(SNode* pNode, void* pContext) {
SCollectColumnsCxt
*
pCxt
=
(
SCollectColumnsCxt
*
)
pContext
;
if
(
QUERY_NODE_COLUMN
==
nodeType
(
pNode
))
{
SColumnNode
*
pCol
=
(
SColumnNode
*
)
pNode
;
if
(
isCollectType
(
pCxt
->
collectType
,
pCol
->
colType
)
&&
if
(
isCollectType
(
pCxt
->
collectType
,
pCol
->
colType
)
&&
0
!=
strcmp
(
pCol
->
colName
,
"*"
)
&&
(
NULL
==
pCxt
->
pTableAlias
||
0
==
strcmp
(
pCxt
->
pTableAlias
,
pCol
->
tableAlias
)))
{
return
doCollect
(
pCxt
,
pCol
,
pNode
);
}
...
...
source/libs/planner/test/planSubqueryTest.cpp
浏览文件 @
15a08b99
...
...
@@ -73,3 +73,9 @@ TEST_F(PlanSubqeuryTest, outerInterval) {
run
(
"SELECT COUNT(*) FROM (SELECT ts, TOP(c1, 10) FROM st1s1) INTERVAL(5s)"
);
}
TEST_F
(
PlanSubqeuryTest
,
outerPartition
)
{
useDb
(
"root"
,
"test"
);
run
(
"SELECT c1, COUNT(*) FROM (SELECT ts, c1 FROM st1) PARTITION BY c1"
);
}
tests/script/tsim/parser/condition_query.sim
浏览文件 @
15a08b99
...
...
@@ -2631,7 +2631,7 @@ sql_error select tb1.ts,tb1.c1,tb2_1.u1 from tb1, tb2_1 where tb1.ts=tb2_1.ts or
print "ts&tbname test"
sql
_error
select count(*) from stb1 where ts > 0 or tbname like 'tb%';
sql select count(*) from stb1 where ts > 0 or tbname like 'tb%';
print "ts&tag test"
sql select count(*) from stb1 where ts > 0 or t1 > 0;
...
...
@@ -2717,9 +2717,9 @@ print "tbname&tag&join test"
print "column&ts&tbname&tag test"
sql
_error
select * from stb1 where (tbname like 'tb%' or ts > '2021-05-05 18:19:01.000') and (t1 > 5 or t1 < 4) and c1 > 0;
sql select * from stb1 where (tbname like 'tb%' or ts > '2021-05-05 18:19:01.000') and (t1 > 5 or t1 < 4) and c1 > 0;
sql select * from stb1 where (ts > '2021-05-05 18:19:01.000') and (ts > '2021-05-05 18:19:02.000' or t1 > 3) and (t1 > 5 or t1 < 4) and c1 > 0;
sql
_error select ts,c1,c7 from stb1 where ts > '2021-05-05 18:19:03.000' or ts > '2021-05-05 18:19:20.000' and col
> 0 and t1 > 0;
sql
select ts,c1,c7 from stb1 where ts > '2021-05-05 18:19:03.000' or ts > '2021-05-05 18:19:20.000' and c1
> 0 and t1 > 0;
print "column&ts&tbname&join test"
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录