Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
c9488054
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看板
未验证
提交
c9488054
编写于
9月 18, 2021
作者:
D
dapan1121
提交者:
GitHub
9月 18, 2021
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #7986 from taosdata/hotfix/TD-6985
[td-6985]add join condition check
上级
6984c19c
bb8e49ab
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
22 addition
and
9 deletion
+22
-9
src/client/src/tscSQLParser.c
src/client/src/tscSQLParser.c
+19
-7
tests/pytest/crash_gen/service_manager.py
tests/pytest/crash_gen/service_manager.py
+2
-1
tests/pytest/fulltest.sh
tests/pytest/fulltest.sh
+1
-1
未找到文件。
src/client/src/tscSQLParser.c
浏览文件 @
c9488054
...
...
@@ -4455,7 +4455,7 @@ static int32_t validateLikeExpr(tSqlExpr* pExpr, STableMeta* pTableMeta, int32_t
}
static
int32_t
handleExprInQueryCond
(
SSqlCmd
*
pCmd
,
SQueryInfo
*
pQueryInfo
,
tSqlExpr
**
pExpr
,
SCondExpr
*
pCondExpr
,
int32_t
*
type
,
int32_t
parentOptr
)
{
int32_t
*
type
,
int32_t
parentOptr
,
int32_t
*
tbIdx
)
{
const
char
*
msg1
=
"table query cannot use tags filter"
;
const
char
*
msg2
=
"illegal column name"
;
const
char
*
msg3
=
"only one query time range allowed"
;
...
...
@@ -4474,6 +4474,8 @@ static int32_t handleExprInQueryCond(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, tSql
return
invalidOperationMsg
(
tscGetErrorMsgPayload
(
pCmd
),
msg2
);
}
*
tbIdx
=
index
.
tableIndex
;
assert
(
tSqlExprIsParentOfLeaf
(
*
pExpr
));
STableMetaInfo
*
pTableMetaInfo
=
tscGetMetaInfo
(
pQueryInfo
,
index
.
tableIndex
);
...
...
@@ -4612,12 +4614,12 @@ static int32_t handleExprInQueryCond(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, tSql
}
int32_t
getQueryCondExpr
(
SSqlCmd
*
pCmd
,
SQueryInfo
*
pQueryInfo
,
tSqlExpr
**
pExpr
,
SCondExpr
*
pCondExpr
,
int32_t
*
type
,
int32_t
parentOptr
)
{
int32_t
*
type
,
int32_t
parentOptr
,
int32_t
*
tbIdx
)
{
if
(
pExpr
==
NULL
)
{
return
TSDB_CODE_SUCCESS
;
}
const
char
*
msg1
=
"query condition between
different column
s must use 'AND'"
;
const
char
*
msg1
=
"query condition between
columns/table
s must use 'AND'"
;
if
((
*
pExpr
)
->
flags
&
(
1
<<
EXPR_FLAG_TS_ERROR
))
{
return
TSDB_CODE_TSC_INVALID_OPERATION
;
...
...
@@ -4632,14 +4634,16 @@ int32_t getQueryCondExpr(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, tSqlExpr** pExpr
int32_t
leftType
=
-
1
;
int32_t
rightType
=
-
1
;
int32_t
leftTbIdx
=
0
;
int32_t
rightTbIdx
=
0
;
if
(
!
tSqlExprIsParentOfLeaf
(
*
pExpr
))
{
int32_t
ret
=
getQueryCondExpr
(
pCmd
,
pQueryInfo
,
&
(
*
pExpr
)
->
pLeft
,
pCondExpr
,
&
leftType
,
(
*
pExpr
)
->
tokenId
);
int32_t
ret
=
getQueryCondExpr
(
pCmd
,
pQueryInfo
,
&
(
*
pExpr
)
->
pLeft
,
pCondExpr
,
&
leftType
,
(
*
pExpr
)
->
tokenId
,
&
leftTbIdx
);
if
(
ret
!=
TSDB_CODE_SUCCESS
)
{
return
ret
;
}
ret
=
getQueryCondExpr
(
pCmd
,
pQueryInfo
,
&
(
*
pExpr
)
->
pRight
,
pCondExpr
,
&
rightType
,
(
*
pExpr
)
->
tokenId
);
ret
=
getQueryCondExpr
(
pCmd
,
pQueryInfo
,
&
(
*
pExpr
)
->
pRight
,
pCondExpr
,
&
rightType
,
(
*
pExpr
)
->
tokenId
,
&
rightTbIdx
);
if
(
ret
!=
TSDB_CODE_SUCCESS
)
{
return
ret
;
}
...
...
@@ -4654,7 +4658,14 @@ int32_t getQueryCondExpr(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, tSqlExpr** pExpr
}
}
if
(((
leftTbIdx
!=
rightTbIdx
)
||
(
leftTbIdx
==
-
1
||
rightTbIdx
==
-
1
))
&&
((
*
pExpr
)
->
tokenId
==
TK_OR
))
{
return
invalidOperationMsg
(
tscGetErrorMsgPayload
(
pCmd
),
msg1
);
}
*
type
=
rightType
;
*
tbIdx
=
(
leftTbIdx
==
rightTbIdx
)
?
leftTbIdx
:
-
1
;
return
TSDB_CODE_SUCCESS
;
}
...
...
@@ -4668,7 +4679,7 @@ int32_t getQueryCondExpr(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, tSqlExpr** pExpr
return
TSDB_CODE_TSC_INVALID_OPERATION
;
}
return
handleExprInQueryCond
(
pCmd
,
pQueryInfo
,
pExpr
,
pCondExpr
,
type
,
parentOptr
);
return
handleExprInQueryCond
(
pCmd
,
pQueryInfo
,
pExpr
,
pCondExpr
,
type
,
parentOptr
,
tbIdx
);
}
static
void
doExtractExprForSTable
(
SSqlCmd
*
pCmd
,
tSqlExpr
**
pExpr
,
SQueryInfo
*
pQueryInfo
,
tSqlExpr
**
pOut
,
int32_t
tableIndex
)
{
...
...
@@ -5210,7 +5221,8 @@ int32_t validateWhereNode(SQueryInfo* pQueryInfo, tSqlExpr** pExpr, SSqlObj* pSq
}
int32_t
type
=
0
;
if
((
ret
=
getQueryCondExpr
(
&
pSql
->
cmd
,
pQueryInfo
,
pExpr
,
&
condExpr
,
&
type
,
(
*
pExpr
)
->
tokenId
))
!=
TSDB_CODE_SUCCESS
)
{
int32_t
tbIdx
=
0
;
if
((
ret
=
getQueryCondExpr
(
&
pSql
->
cmd
,
pQueryInfo
,
pExpr
,
&
condExpr
,
&
type
,
(
*
pExpr
)
->
tokenId
,
&
tbIdx
))
!=
TSDB_CODE_SUCCESS
)
{
goto
PARSE_WHERE_EXIT
;
}
...
...
tests/pytest/crash_gen/service_manager.py
浏览文件 @
c9488054
...
...
@@ -134,7 +134,8 @@ cDebugFlag 135
rpcDebugFlag 135
qDebugFlag 135
# httpDebugFlag 143
# asyncLog 0
asyncLog 0
debugflag 143
# tables 10
maxtablesPerVnode 10
rpcMaxTime 101
...
...
tests/pytest/fulltest.sh
浏览文件 @
c9488054
...
...
@@ -263,7 +263,7 @@ python3 ./test.py -f query/nestedQuery/queryInterval.py
python3 ./test.py
-f
query/queryStateWindow.py
# python3 ./test.py -f query/nestedQuery/queryWithOrderLimit.py
python3 ./test.py
-f
query/nestquery_last_row.py
python3 ./test.py
-f
query/nestedQuery/nestedQuery.py
#
python3 ./test.py -f query/nestedQuery/nestedQuery.py
python3 ./test.py
-f
query/queryCnameDisplay.py
python3 ./test.py
-f
query/operator_cost.py
python3 test.py
-f
query/nestedQuery/queryWithSpread.py
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录