Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
a3348f71
T
TDengine
项目概览
taosdata
/
TDengine
11 个月 前同步成功
通知
1179
Star
22014
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看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
a3348f71
编写于
8月 22, 2022
作者:
S
Shengliang Guan
提交者:
GitHub
8月 22, 2022
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #16299 from taosdata/fix/3.0_bugfix_wxy
fix: the syntax problem of querying the state value in the state window
上级
99c75560
4cf9bd6a
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
18 addition
and
3 deletion
+18
-3
include/libs/nodes/querynodes.h
include/libs/nodes/querynodes.h
+1
-0
source/libs/executor/src/executil.c
source/libs/executor/src/executil.c
+3
-0
source/libs/parser/src/parInsert.c
source/libs/parser/src/parInsert.c
+5
-0
source/libs/parser/src/parTranslater.c
source/libs/parser/src/parTranslater.c
+9
-3
未找到文件。
include/libs/nodes/querynodes.h
浏览文件 @
a3348f71
...
...
@@ -276,6 +276,7 @@ typedef struct SSelectStmt {
bool
hasLastRowFunc
;
bool
hasTimeLineFunc
;
bool
hasUdaf
;
bool
hasStateKey
;
bool
onlyHasKeepOrderFunc
;
bool
groupSort
;
}
SSelectStmt
;
...
...
source/libs/executor/src/executil.c
浏览文件 @
a3348f71
...
...
@@ -408,6 +408,7 @@ static SColumnInfoData* getColInfoResult(void* metaHandle, uint64_t suid, SArray
tags
=
taosHashInit
(
32
,
taosGetDefaultHashFunction
(
TSDB_DATA_TYPE_BIGINT
),
false
,
HASH_NO_LOCK
);
code
=
metaGetTableTags
(
metaHandle
,
suid
,
uidList
,
tags
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
qError
(
"failed to get table tags from meta, reason:%s, suid:%"
PRIu64
,
tstrerror
(
code
),
suid
);
terrno
=
code
;
goto
end
;
}
...
...
@@ -482,11 +483,13 @@ static SColumnInfoData* getColInfoResult(void* metaHandle, uint64_t suid, SArray
SDataType
type
=
{.
type
=
TSDB_DATA_TYPE_BOOL
,
.
bytes
=
sizeof
(
bool
)};
code
=
createResultData
(
&
type
,
rows
,
&
output
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
qError
(
"failed to create result, reason:%s"
,
tstrerror
(
code
));
goto
end
;
}
code
=
scalarCalculate
(
pTagCond
,
pBlockList
,
&
output
);
if
(
code
!=
TSDB_CODE_SUCCESS
){
qError
(
"failed to calculate scalar, reason:%s"
,
tstrerror
(
code
));
terrno
=
code
;
}
// int64_t st2 = taosGetTimestampUs();
...
...
source/libs/parser/src/parInsert.c
浏览文件 @
a3348f71
...
...
@@ -681,6 +681,11 @@ static int32_t parseBoundColumns(SInsertParseContext* pCxt, SParsedDataColInfo*
break
;
}
char
tmpTokenBuf
[
TSDB_COL_NAME_LEN
+
2
]
=
{
0
};
// used for deleting Escape character backstick(`)
strncpy
(
tmpTokenBuf
,
sToken
.
z
,
sToken
.
n
);
sToken
.
z
=
tmpTokenBuf
;
sToken
.
n
=
strdequote
(
sToken
.
z
);
col_id_t
t
=
lastColIdx
+
1
;
col_id_t
index
=
findCol
(
&
sToken
,
t
,
nCols
,
pSchema
);
if
(
index
<
0
&&
t
>
0
)
{
...
...
source/libs/parser/src/parTranslater.c
浏览文件 @
a3348f71
...
...
@@ -1881,6 +1881,12 @@ static EDealRes doCheckExprForGroupBy(SNode** pNode, void* pContext) {
return
rewriteExprToGroupKeyFunc
(
pCxt
,
pNode
);
}
}
if
(
NULL
!=
pSelect
->
pWindow
&&
QUERY_NODE_STATE_WINDOW
==
nodeType
(
pSelect
->
pWindow
))
{
if
(
nodesEqualNode
(((
SStateWindowNode
*
)
pSelect
->
pWindow
)
->
pExpr
,
*
pNode
))
{
pSelect
->
hasStateKey
=
true
;
return
rewriteExprToGroupKeyFunc
(
pCxt
,
pNode
);
}
}
if
(
isScanPseudoColumnFunc
(
*
pNode
)
||
QUERY_NODE_COLUMN
==
nodeType
(
*
pNode
))
{
if
(
pSelect
->
selectFuncNum
>
1
||
pSelect
->
hasOtherVectorFunc
||
!
pSelect
->
hasSelectFunc
)
{
return
generateDealNodeErrMsg
(
pCxt
,
getGroupByErrorCode
(
pCxt
));
...
...
@@ -1973,7 +1979,7 @@ static int32_t checkWindowFuncCoexist(STranslateContext* pCxt, SSelectStmt* pSel
if
(
NULL
==
pSelect
->
pWindow
)
{
return
TSDB_CODE_SUCCESS
;
}
if
(
NULL
!=
pSelect
->
pWindow
&&
!
pSelect
->
hasAggFuncs
)
{
if
(
NULL
!=
pSelect
->
pWindow
&&
!
pSelect
->
hasAggFuncs
&&
!
pSelect
->
hasStateKey
)
{
return
generateSyntaxErrMsg
(
&
pCxt
->
msgBuf
,
TSDB_CODE_PAR_NO_VALID_FUNC_IN_WIN
);
}
return
TSDB_CODE_SUCCESS
;
...
...
@@ -2825,7 +2831,7 @@ static int32_t createDefaultFillNode(STranslateContext* pCxt, SNode** pOutput) {
static
int32_t
checkEvery
(
STranslateContext
*
pCxt
,
SValueNode
*
pInterval
)
{
int32_t
len
=
strlen
(
pInterval
->
literal
);
char
*
unit
=
&
pInterval
->
literal
[
len
-
1
];
char
*
unit
=
&
pInterval
->
literal
[
len
-
1
];
if
(
*
unit
==
'n'
||
*
unit
==
'y'
)
{
return
generateSyntaxErrMsgExt
(
&
pCxt
->
msgBuf
,
TSDB_CODE_PAR_WRONG_VALUE_TYPE
,
"Unsupported time unit in EVERY clause"
);
...
...
@@ -2837,7 +2843,7 @@ static int32_t checkEvery(STranslateContext* pCxt, SValueNode* pInterval) {
static
int32_t
translateInterpEvery
(
STranslateContext
*
pCxt
,
SNode
**
pEvery
)
{
int32_t
code
=
TSDB_CODE_SUCCESS
;
code
=
checkEvery
(
pCxt
,
(
SValueNode
*
)(
*
pEvery
));
code
=
checkEvery
(
pCxt
,
(
SValueNode
*
)(
*
pEvery
));
if
(
TSDB_CODE_SUCCESS
==
code
)
{
code
=
translateExpr
(
pCxt
,
pEvery
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录