Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
4b824dde
T
TDengine
项目概览
慢慢CG
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
4b824dde
编写于
3月 08, 2021
作者:
D
dapan1121
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix bug
上级
e8eb77b8
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
19 addition
and
11 deletion
+19
-11
src/client/inc/tsclient.h
src/client/inc/tsclient.h
+1
-0
src/client/src/tscLocalMerge.c
src/client/src/tscLocalMerge.c
+1
-2
src/client/src/tscSQLParser.c
src/client/src/tscSQLParser.c
+8
-2
src/query/src/qParserImpl.c
src/query/src/qParserImpl.c
+9
-7
未找到文件。
src/client/inc/tsclient.h
浏览文件 @
4b824dde
...
...
@@ -131,6 +131,7 @@ typedef struct SColumn {
typedef
struct
SExprFilter
{
tSQLExpr
*
pExpr
;
//used for having parse
SSqlExpr
*
pSqlExpr
;
SArray
*
fp
;
SColumn
*
pFilters
;
//having filter info
}
SExprFilter
;
...
...
src/client/src/tscLocalMerge.c
浏览文件 @
4b824dde
...
...
@@ -1287,8 +1287,7 @@ int32_t doHavingFilter(SQueryInfo* pQueryInfo, tFilePage* pOutput, bool* notSkip
int32_t
type
=
pInterField
->
field
.
type
;
SSqlExpr
*
pExpr
=
tscSqlExprGet
(
pQueryInfo
,
i
);
char
*
pInput
=
pOutput
->
data
+
pOutput
->
num
*
pExpr
->
offset
;
char
*
pInput
=
pOutput
->
data
+
pOutput
->
num
*
pFieldFilters
->
pSqlExpr
->
offset
;
doFilterFieldData
(
pQueryInfo
,
pInput
,
pOutput
,
pFieldFilters
,
type
,
notSkipped
);
if
(
*
notSkipped
==
false
)
{
...
...
src/client/src/tscSQLParser.c
浏览文件 @
4b824dde
...
...
@@ -6708,6 +6708,9 @@ static int32_t checkQueryRangeForFill(SSqlCmd* pCmd, SQueryInfo* pQueryInfo) {
++
pQueryInfo
->
havingFieldNum
;
size_t
n
=
tscSqlExprNumOfExprs
(
pQueryInfo
);
SSqlExpr
*
pSqlExpr
=
tscSqlExprGet
(
pQueryInfo
,
n
-
1
);
int32_t
slot
=
tscNumOfFields
(
pQueryInfo
)
-
1
;
SInternalField
*
pInfo
=
tscFieldInfoGetInternalField
(
&
pQueryInfo
->
fieldsInfo
,
slot
);
pInfo
->
visible
=
false
;
...
...
@@ -6726,6 +6729,7 @@ static int32_t checkQueryRangeForFill(SSqlCmd* pCmd, SQueryInfo* pQueryInfo) {
}
pFieldFilters
->
pFilters
=
pFilters
;
pFieldFilters
->
pSqlExpr
=
pSqlExpr
;
pInfo
->
pFieldFilters
=
pFieldFilters
;
}
...
...
@@ -6740,7 +6744,7 @@ int32_t tscGetExprFilters(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, tSQLExpr* pExpr
SInternalField
*
pInfo
=
NULL
;
for
(
int32_t
i
=
pQueryInfo
->
havingFieldNum
-
1
;
i
>=
0
;
--
i
)
{
pInfo
=
tscFieldInfoGetInternalField
(
&
pQueryInfo
->
fieldsInfo
,
i
);
pInfo
=
tscFieldInfoGetInternalField
(
&
pQueryInfo
->
fieldsInfo
,
pQueryInfo
->
fieldsInfo
.
numOfOutput
-
1
-
i
);
if
(
pInfo
->
pFieldFilters
&&
0
==
tSqlExprCompare
(
pInfo
->
pFieldFilters
->
pExpr
,
pExpr
))
{
*
pField
=
pInfo
;
...
...
@@ -6818,10 +6822,12 @@ static int32_t handleExprInHavingClause(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, t
return
TSDB_CODE_TSC_OUT_OF_MEMORY
;
}
}
else
if
(
sqlOptr
==
TK_OR
)
{
int32_t
ret
=
tsc
InsertExprField
s
(
pCmd
,
pQueryInfo
,
pExpr
->
pLeft
,
&
pInfo
);
int32_t
ret
=
tsc
GetExprFilter
s
(
pCmd
,
pQueryInfo
,
pExpr
->
pLeft
,
&
pInfo
);
if
(
ret
)
{
return
ret
;
}
pColumn
=
pInfo
->
pFieldFilters
->
pFilters
;
// TODO fixme: failed to invalid the filter expression: "col1 = 1 OR col2 = 2"
pColFilter
=
addColumnFilterInfo
(
pColumn
);
...
...
src/query/src/qParserImpl.c
浏览文件 @
4b824dde
...
...
@@ -324,13 +324,15 @@ int32_t tSqlExprCompare(tSQLExpr *left, tSQLExpr *right) {
if
(
left
->
pParam
&&
left
->
pParam
->
nExpr
!=
right
->
pParam
->
nExpr
)
{
return
1
;
}
for
(
int32_t
i
=
0
;
i
<
right
->
pParam
->
nExpr
;
i
++
)
{
tSQLExpr
*
pSubLeft
=
left
->
pParam
->
a
[
i
].
pNode
;
tSQLExpr
*
pSubRight
=
right
->
pParam
->
a
[
i
].
pNode
;
if
(
tSqlExprCompare
(
pSubLeft
,
pSubRight
))
{
return
1
;
if
(
right
->
pParam
&&
left
->
pParam
)
{
for
(
int32_t
i
=
0
;
i
<
right
->
pParam
->
nExpr
;
i
++
)
{
tSQLExpr
*
pSubLeft
=
left
->
pParam
->
a
[
i
].
pNode
;
tSQLExpr
*
pSubRight
=
right
->
pParam
->
a
[
i
].
pNode
;
if
(
tSqlExprCompare
(
pSubLeft
,
pSubRight
))
{
return
1
;
}
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录