Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
aec4c231
T
TDengine
项目概览
taosdata
/
TDengine
接近 2 年 前同步成功
通知
1192
Star
22018
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看板
提交
aec4c231
编写于
7月 15, 2022
作者:
X
Xiaoyu Wang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: multi-rows function validity check
上级
3f1f0943
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
45 addition
and
54 deletion
+45
-54
include/libs/function/functionMgt.h
include/libs/function/functionMgt.h
+1
-2
source/libs/function/inc/functionMgtInt.h
source/libs/function/inc/functionMgtInt.h
+3
-4
source/libs/function/src/builtins.c
source/libs/function/src/builtins.c
+11
-11
source/libs/function/src/functionMgt.c
source/libs/function/src/functionMgt.c
+2
-4
source/libs/parser/src/parTranslater.c
source/libs/parser/src/parTranslater.c
+22
-27
source/libs/parser/test/parSelectTest.cpp
source/libs/parser/test/parSelectTest.cpp
+6
-6
未找到文件。
include/libs/function/functionMgt.h
浏览文件 @
aec4c231
...
...
@@ -190,14 +190,13 @@ bool fmIsUserDefinedFunc(int32_t funcId);
bool
fmIsDistExecFunc
(
int32_t
funcId
);
bool
fmIsForbidFillFunc
(
int32_t
funcId
);
bool
fmIsForbidStreamFunc
(
int32_t
funcId
);
bool
fmIsForbidWindowFunc
(
int32_t
funcId
);
bool
fmIsForbidGroupByFunc
(
int32_t
funcId
);
bool
fmIsIntervalInterpoFunc
(
int32_t
funcId
);
bool
fmIsInterpFunc
(
int32_t
funcId
);
bool
fmIsLastRowFunc
(
int32_t
funcId
);
bool
fmIsSystemInfoFunc
(
int32_t
funcId
);
bool
fmIsImplicitTsFunc
(
int32_t
funcId
);
bool
fmIsClientPseudoColumnFunc
(
int32_t
funcId
);
bool
fmIsMultiRowsFunc
(
int32_t
funcId
);
int32_t
fmGetDistMethod
(
const
SFunctionNode
*
pFunc
,
SFunctionNode
**
pPartialFunc
,
SFunctionNode
**
pMergeFunc
);
...
...
source/libs/function/inc/functionMgtInt.h
浏览文件 @
aec4c231
...
...
@@ -44,10 +44,9 @@ extern "C" {
#define FUNC_MGT_FORBID_FILL_FUNC FUNC_MGT_FUNC_CLASSIFICATION_MASK(15)
#define FUNC_MGT_INTERVAL_INTERPO_FUNC FUNC_MGT_FUNC_CLASSIFICATION_MASK(16)
#define FUNC_MGT_FORBID_STREAM_FUNC FUNC_MGT_FUNC_CLASSIFICATION_MASK(17)
#define FUNC_MGT_FORBID_WINDOW_FUNC FUNC_MGT_FUNC_CLASSIFICATION_MASK(18)
#define FUNC_MGT_FORBID_GROUP_BY_FUNC FUNC_MGT_FUNC_CLASSIFICATION_MASK(19)
#define FUNC_MGT_SYSTEM_INFO_FUNC FUNC_MGT_FUNC_CLASSIFICATION_MASK(20)
#define FUNC_MGT_CLIENT_PC_FUNC FUNC_MGT_FUNC_CLASSIFICATION_MASK(21)
#define FUNC_MGT_SYSTEM_INFO_FUNC FUNC_MGT_FUNC_CLASSIFICATION_MASK(18)
#define FUNC_MGT_CLIENT_PC_FUNC FUNC_MGT_FUNC_CLASSIFICATION_MASK(19)
#define FUNC_MGT_MULTI_ROWS_FUNC FUNC_MGT_FUNC_CLASSIFICATION_MASK(20)
#define FUNC_MGT_TEST_MASK(val, mask) (((val) & (mask)) != 0)
...
...
source/libs/function/src/builtins.c
浏览文件 @
aec4c231
...
...
@@ -2078,7 +2078,7 @@ const SBuiltinFuncDefinition funcMgtBuiltins[] = {
{
.
name
=
"top"
,
.
type
=
FUNCTION_TYPE_TOP
,
.
classification
=
FUNC_MGT_AGG_FUNC
|
FUNC_MGT_SELECT_FUNC
|
FUNC_MGT_
INDEFINITE
_ROWS_FUNC
|
FUNC_MGT_FORBID_STREAM_FUNC
,
.
classification
=
FUNC_MGT_AGG_FUNC
|
FUNC_MGT_SELECT_FUNC
|
FUNC_MGT_
MULTI
_ROWS_FUNC
|
FUNC_MGT_FORBID_STREAM_FUNC
,
.
translateFunc
=
translateTopBot
,
.
getEnvFunc
=
getTopBotFuncEnv
,
.
initFunc
=
topBotFunctionSetup
,
...
...
@@ -2092,7 +2092,7 @@ const SBuiltinFuncDefinition funcMgtBuiltins[] = {
{
.
name
=
"bottom"
,
.
type
=
FUNCTION_TYPE_BOTTOM
,
.
classification
=
FUNC_MGT_AGG_FUNC
|
FUNC_MGT_SELECT_FUNC
|
FUNC_MGT_
INDEFINITE
_ROWS_FUNC
|
FUNC_MGT_FORBID_STREAM_FUNC
,
.
classification
=
FUNC_MGT_AGG_FUNC
|
FUNC_MGT_SELECT_FUNC
|
FUNC_MGT_
MULTI
_ROWS_FUNC
|
FUNC_MGT_FORBID_STREAM_FUNC
,
.
translateFunc
=
translateTopBot
,
.
getEnvFunc
=
getTopBotFuncEnv
,
.
initFunc
=
topBotFunctionSetup
,
...
...
@@ -2319,7 +2319,7 @@ const SBuiltinFuncDefinition funcMgtBuiltins[] = {
{
.
name
=
"histogram"
,
.
type
=
FUNCTION_TYPE_HISTOGRAM
,
.
classification
=
FUNC_MGT_AGG_FUNC
|
FUNC_MGT_
INDEFINITE
_ROWS_FUNC
|
FUNC_MGT_FORBID_FILL_FUNC
,
.
classification
=
FUNC_MGT_AGG_FUNC
|
FUNC_MGT_
MULTI
_ROWS_FUNC
|
FUNC_MGT_FORBID_FILL_FUNC
,
.
translateFunc
=
translateHistogram
,
.
getEnvFunc
=
getHistogramFuncEnv
,
.
initFunc
=
histogramFunctionSetup
,
...
...
@@ -2395,7 +2395,7 @@ const SBuiltinFuncDefinition funcMgtBuiltins[] = {
{
.
name
=
"diff"
,
.
type
=
FUNCTION_TYPE_DIFF
,
.
classification
=
FUNC_MGT_INDEFINITE_ROWS_FUNC
|
FUNC_MGT_TIMELINE_FUNC
|
FUNC_MGT_FORBID_STREAM_FUNC
|
FUNC_MGT_FORBID_WINDOW_FUNC
,
.
classification
=
FUNC_MGT_INDEFINITE_ROWS_FUNC
|
FUNC_MGT_TIMELINE_FUNC
|
FUNC_MGT_FORBID_STREAM_FUNC
,
.
translateFunc
=
translateDiff
,
.
getEnvFunc
=
getDiffFuncEnv
,
.
initFunc
=
diffFunctionSetup
,
...
...
@@ -2405,7 +2405,7 @@ const SBuiltinFuncDefinition funcMgtBuiltins[] = {
{
.
name
=
"statecount"
,
.
type
=
FUNCTION_TYPE_STATE_COUNT
,
.
classification
=
FUNC_MGT_INDEFINITE_ROWS_FUNC
|
FUNC_MGT_TIMELINE_FUNC
|
FUNC_MGT_FORBID_STREAM_FUNC
|
FUNC_MGT_FORBID_WINDOW_FUNC
,
.
classification
=
FUNC_MGT_INDEFINITE_ROWS_FUNC
|
FUNC_MGT_TIMELINE_FUNC
|
FUNC_MGT_FORBID_STREAM_FUNC
,
.
translateFunc
=
translateStateCount
,
.
getEnvFunc
=
getStateFuncEnv
,
.
initFunc
=
functionSetup
,
...
...
@@ -2415,7 +2415,7 @@ const SBuiltinFuncDefinition funcMgtBuiltins[] = {
{
.
name
=
"stateduration"
,
.
type
=
FUNCTION_TYPE_STATE_DURATION
,
.
classification
=
FUNC_MGT_INDEFINITE_ROWS_FUNC
|
FUNC_MGT_TIMELINE_FUNC
|
FUNC_MGT_IMPLICIT_TS_FUNC
|
FUNC_MGT_FORBID_STREAM_FUNC
|
FUNC_MGT_FORBID_WINDOW_FUNC
,
.
classification
=
FUNC_MGT_INDEFINITE_ROWS_FUNC
|
FUNC_MGT_TIMELINE_FUNC
|
FUNC_MGT_IMPLICIT_TS_FUNC
|
FUNC_MGT_FORBID_STREAM_FUNC
,
.
translateFunc
=
translateStateDuration
,
.
getEnvFunc
=
getStateFuncEnv
,
.
initFunc
=
functionSetup
,
...
...
@@ -2425,7 +2425,7 @@ const SBuiltinFuncDefinition funcMgtBuiltins[] = {
{
.
name
=
"csum"
,
.
type
=
FUNCTION_TYPE_CSUM
,
.
classification
=
FUNC_MGT_INDEFINITE_ROWS_FUNC
|
FUNC_MGT_TIMELINE_FUNC
|
FUNC_MGT_FORBID_STREAM_FUNC
|
FUNC_MGT_FORBID_WINDOW_FUNC
,
.
classification
=
FUNC_MGT_INDEFINITE_ROWS_FUNC
|
FUNC_MGT_TIMELINE_FUNC
|
FUNC_MGT_FORBID_STREAM_FUNC
,
.
translateFunc
=
translateCsum
,
.
getEnvFunc
=
getCsumFuncEnv
,
.
initFunc
=
functionSetup
,
...
...
@@ -2435,7 +2435,7 @@ const SBuiltinFuncDefinition funcMgtBuiltins[] = {
{
.
name
=
"mavg"
,
.
type
=
FUNCTION_TYPE_MAVG
,
.
classification
=
FUNC_MGT_INDEFINITE_ROWS_FUNC
|
FUNC_MGT_TIMELINE_FUNC
|
FUNC_MGT_FORBID_STREAM_FUNC
|
FUNC_MGT_FORBID_WINDOW_FUNC
,
.
classification
=
FUNC_MGT_INDEFINITE_ROWS_FUNC
|
FUNC_MGT_TIMELINE_FUNC
|
FUNC_MGT_FORBID_STREAM_FUNC
,
.
translateFunc
=
translateMavg
,
.
getEnvFunc
=
getMavgFuncEnv
,
.
initFunc
=
mavgFunctionSetup
,
...
...
@@ -2445,7 +2445,7 @@ const SBuiltinFuncDefinition funcMgtBuiltins[] = {
{
.
name
=
"sample"
,
.
type
=
FUNCTION_TYPE_SAMPLE
,
.
classification
=
FUNC_MGT_AGG_FUNC
|
FUNC_MGT_SELECT_FUNC
|
FUNC_MGT_
INDEFINITE
_ROWS_FUNC
|
FUNC_MGT_FORBID_STREAM_FUNC
,
.
classification
=
FUNC_MGT_AGG_FUNC
|
FUNC_MGT_SELECT_FUNC
|
FUNC_MGT_
MULTI
_ROWS_FUNC
|
FUNC_MGT_FORBID_STREAM_FUNC
,
.
translateFunc
=
translateSample
,
.
getEnvFunc
=
getSampleFuncEnv
,
.
initFunc
=
sampleFunctionSetup
,
...
...
@@ -2456,7 +2456,7 @@ const SBuiltinFuncDefinition funcMgtBuiltins[] = {
.
name
=
"tail"
,
.
type
=
FUNCTION_TYPE_TAIL
,
.
classification
=
FUNC_MGT_SELECT_FUNC
|
FUNC_MGT_INDEFINITE_ROWS_FUNC
|
FUNC_MGT_TIMELINE_FUNC
|
FUNC_MGT_FORBID_STREAM_FUNC
|
FUNC_MGT_
FORBID_WINDOW_FUNC
|
FUNC_MGT_FORBID_GROUP_BY_FUNC
|
FUNC_MGT_
IMPLICIT_TS_FUNC
,
FUNC_MGT_IMPLICIT_TS_FUNC
,
.
translateFunc
=
translateTail
,
.
getEnvFunc
=
getTailFuncEnv
,
.
initFunc
=
tailFunctionSetup
,
...
...
@@ -2467,7 +2467,7 @@ const SBuiltinFuncDefinition funcMgtBuiltins[] = {
.
name
=
"unique"
,
.
type
=
FUNCTION_TYPE_UNIQUE
,
.
classification
=
FUNC_MGT_SELECT_FUNC
|
FUNC_MGT_INDEFINITE_ROWS_FUNC
|
FUNC_MGT_TIMELINE_FUNC
|
FUNC_MGT_FORBID_STREAM_FUNC
|
FUNC_MGT_
FORBID_WINDOW_FUNC
|
FUNC_MGT_FORBID_GROUP_BY_FUNC
|
FUNC_MGT_
IMPLICIT_TS_FUNC
,
FUNC_MGT_FORBID_STREAM_FUNC
|
FUNC_MGT_IMPLICIT_TS_FUNC
,
.
translateFunc
=
translateUnique
,
.
getEnvFunc
=
getUniqueFuncEnv
,
.
initFunc
=
uniqueFunctionSetup
,
...
...
source/libs/function/src/functionMgt.c
浏览文件 @
aec4c231
...
...
@@ -175,16 +175,14 @@ bool fmIsIntervalInterpoFunc(int32_t funcId) { return isSpecificClassifyFunc(fun
bool
fmIsForbidStreamFunc
(
int32_t
funcId
)
{
return
isSpecificClassifyFunc
(
funcId
,
FUNC_MGT_FORBID_STREAM_FUNC
);
}
bool
fmIsForbidWindowFunc
(
int32_t
funcId
)
{
return
isSpecificClassifyFunc
(
funcId
,
FUNC_MGT_FORBID_WINDOW_FUNC
);
}
bool
fmIsForbidGroupByFunc
(
int32_t
funcId
)
{
return
isSpecificClassifyFunc
(
funcId
,
FUNC_MGT_FORBID_GROUP_BY_FUNC
);
}
bool
fmIsSystemInfoFunc
(
int32_t
funcId
)
{
return
isSpecificClassifyFunc
(
funcId
,
FUNC_MGT_SYSTEM_INFO_FUNC
);
}
bool
fmIsImplicitTsFunc
(
int32_t
funcId
)
{
return
isSpecificClassifyFunc
(
funcId
,
FUNC_MGT_IMPLICIT_TS_FUNC
);
}
bool
fmIsClientPseudoColumnFunc
(
int32_t
funcId
)
{
return
isSpecificClassifyFunc
(
funcId
,
FUNC_MGT_CLIENT_PC_FUNC
);
}
bool
fmIsMultiRowsFunc
(
int32_t
funcId
)
{
return
isSpecificClassifyFunc
(
funcId
,
FUNC_MGT_MULTI_ROWS_FUNC
);
}
bool
fmIsInterpFunc
(
int32_t
funcId
)
{
if
(
funcId
<
0
||
funcId
>=
funcMgtBuiltinsNum
)
{
return
false
;
...
...
source/libs/parser/src/parTranslater.c
浏览文件 @
aec4c231
...
...
@@ -1096,6 +1096,24 @@ static int32_t translateIndefiniteRowsFunc(STranslateContext* pCxt, SFunctionNod
((
SSelectStmt
*
)
pCxt
->
pCurrStmt
)
->
hasIndefiniteRowsFunc
||
((
SSelectStmt
*
)
pCxt
->
pCurrStmt
)
->
hasAggFuncs
)
{
return
generateSyntaxErrMsg
(
&
pCxt
->
msgBuf
,
TSDB_CODE_PAR_NOT_ALLOWED_FUNC
);
}
if
(
NULL
!=
((
SSelectStmt
*
)
pCxt
->
pCurrStmt
)
->
pWindow
||
NULL
!=
((
SSelectStmt
*
)
pCxt
->
pCurrStmt
)
->
pGroupByList
)
{
return
generateSyntaxErrMsgExt
(
&
pCxt
->
msgBuf
,
TSDB_CODE_PAR_NOT_ALLOWED_FUNC
,
"%s function is not supported in window query or group query"
,
pFunc
->
functionName
);
}
if
(
hasInvalidFuncNesting
(
pFunc
->
pParameterList
))
{
return
generateSyntaxErrMsg
(
&
pCxt
->
msgBuf
,
TSDB_CODE_PAR_AGG_FUNC_NESTING
);
}
return
TSDB_CODE_SUCCESS
;
}
static
int32_t
translateMultiRowsFunc
(
STranslateContext
*
pCxt
,
SFunctionNode
*
pFunc
)
{
if
(
!
fmIsMultiRowsFunc
(
pFunc
->
funcId
))
{
return
TSDB_CODE_SUCCESS
;
}
if
(
!
isSelectStmt
(
pCxt
->
pCurrStmt
)
||
SQL_CLAUSE_SELECT
!=
pCxt
->
currClause
||
((
SSelectStmt
*
)
pCxt
->
pCurrStmt
)
->
hasIndefiniteRowsFunc
||
((
SSelectStmt
*
)
pCxt
->
pCurrStmt
)
->
hasAggFuncs
)
{
return
generateSyntaxErrMsg
(
&
pCxt
->
msgBuf
,
TSDB_CODE_PAR_NOT_ALLOWED_FUNC
);
}
if
(
hasInvalidFuncNesting
(
pFunc
->
pParameterList
))
{
return
generateSyntaxErrMsg
(
&
pCxt
->
msgBuf
,
TSDB_CODE_PAR_AGG_FUNC_NESTING
);
}
...
...
@@ -1131,16 +1149,6 @@ static int32_t translateWindowPseudoColumnFunc(STranslateContext* pCxt, SFunctio
return
TSDB_CODE_SUCCESS
;
}
static
int32_t
translateForbidWindowFunc
(
STranslateContext
*
pCxt
,
SFunctionNode
*
pFunc
)
{
if
(
!
fmIsForbidWindowFunc
(
pFunc
->
funcId
))
{
return
TSDB_CODE_SUCCESS
;
}
if
(
isSelectStmt
(
pCxt
->
pCurrStmt
)
&&
NULL
!=
((
SSelectStmt
*
)
pCxt
->
pCurrStmt
)
->
pWindow
)
{
return
generateSyntaxErrMsg
(
&
pCxt
->
msgBuf
,
TSDB_CODE_PAR_WINDOW_NOT_ALLOWED_FUNC
,
pFunc
->
functionName
);
}
return
TSDB_CODE_SUCCESS
;
}
static
int32_t
translateForbidStreamFunc
(
STranslateContext
*
pCxt
,
SFunctionNode
*
pFunc
)
{
if
(
!
fmIsForbidStreamFunc
(
pFunc
->
funcId
))
{
return
TSDB_CODE_SUCCESS
;
...
...
@@ -1151,16 +1159,6 @@ static int32_t translateForbidStreamFunc(STranslateContext* pCxt, SFunctionNode*
return
TSDB_CODE_SUCCESS
;
}
static
int32_t
translateForbidGroupByFunc
(
STranslateContext
*
pCxt
,
SFunctionNode
*
pFunc
)
{
if
(
!
fmIsForbidGroupByFunc
(
pFunc
->
funcId
))
{
return
TSDB_CODE_SUCCESS
;
}
if
(
isSelectStmt
(
pCxt
->
pCurrStmt
)
&&
NULL
!=
((
SSelectStmt
*
)
pCxt
->
pCurrStmt
)
->
pGroupByList
)
{
return
generateSyntaxErrMsg
(
&
pCxt
->
msgBuf
,
TSDB_CODE_PAR_GROUP_BY_NOT_ALLOWED_FUNC
,
pFunc
->
functionName
);
}
return
TSDB_CODE_SUCCESS
;
}
static
int32_t
translateRepeatScanFunc
(
STranslateContext
*
pCxt
,
SFunctionNode
*
pFunc
)
{
if
(
!
fmIsRepeatScanFunc
(
pFunc
->
funcId
))
{
return
TSDB_CODE_SUCCESS
;
...
...
@@ -1191,7 +1189,7 @@ static int32_t translateMultiResFunc(STranslateContext* pCxt, SFunctionNode* pFu
if
(
!
fmIsMultiResFunc
(
pFunc
->
funcId
))
{
return
TSDB_CODE_SUCCESS
;
}
if
(
SQL_CLAUSE_SELECT
!=
pCxt
->
currClause
)
{
if
(
SQL_CLAUSE_SELECT
!=
pCxt
->
currClause
)
{
SNode
*
pPara
=
nodesListGetNode
(
pFunc
->
pParameterList
,
0
);
if
(
isStar
(
pPara
)
||
isTableStar
(
pPara
))
{
return
generateSyntaxErrMsgExt
(
&
pCxt
->
msgBuf
,
TSDB_CODE_PAR_NOT_ALLOWED_FUNC
,
...
...
@@ -1322,21 +1320,18 @@ static int32_t translateNoramlFunction(STranslateContext* pCxt, SFunctionNode* p
if
(
TSDB_CODE_SUCCESS
==
code
)
{
code
=
translateWindowPseudoColumnFunc
(
pCxt
,
pFunc
);
}
if
(
TSDB_CODE_SUCCESS
==
code
)
{
code
=
translateForbidWindowFunc
(
pCxt
,
pFunc
);
}
if
(
TSDB_CODE_SUCCESS
==
code
)
{
code
=
translateForbidStreamFunc
(
pCxt
,
pFunc
);
}
if
(
TSDB_CODE_SUCCESS
==
code
)
{
code
=
translateForbidGroupByFunc
(
pCxt
,
pFunc
);
}
if
(
TSDB_CODE_SUCCESS
==
code
)
{
code
=
translateRepeatScanFunc
(
pCxt
,
pFunc
);
}
if
(
TSDB_CODE_SUCCESS
==
code
)
{
code
=
translateMultiResFunc
(
pCxt
,
pFunc
);
}
if
(
TSDB_CODE_SUCCESS
==
code
)
{
code
=
translateMultiRowsFunc
(
pCxt
,
pFunc
);
}
if
(
TSDB_CODE_SUCCESS
==
code
)
{
setFuncClassification
(
pCxt
->
pCurrStmt
,
pFunc
);
}
...
...
source/libs/parser/test/parSelectTest.cpp
浏览文件 @
aec4c231
...
...
@@ -152,9 +152,9 @@ TEST_F(ParserSelectTest, IndefiniteRowsFuncSemanticCheck) {
run
(
"SELECT DIFF(c1), CSUM(c1) FROM t1"
,
TSDB_CODE_PAR_NOT_ALLOWED_FUNC
);
run
(
"SELECT CSUM(c3) FROM t1 STATE_WINDOW(c1)"
,
TSDB_CODE_PAR_
WINDOW_
NOT_ALLOWED_FUNC
);
run
(
"SELECT CSUM(c3) FROM t1 STATE_WINDOW(c1)"
,
TSDB_CODE_PAR_NOT_ALLOWED_FUNC
);
run
(
"SELECT DIFF(c1) FROM t1 INTERVAL(10s)"
,
TSDB_CODE_PAR_
WINDOW_
NOT_ALLOWED_FUNC
);
run
(
"SELECT DIFF(c1) FROM t1 INTERVAL(10s)"
,
TSDB_CODE_PAR_NOT_ALLOWED_FUNC
);
}
TEST_F
(
ParserSelectTest
,
useDefinedFunc
)
{
...
...
@@ -178,9 +178,9 @@ TEST_F(ParserSelectTest, uniqueFunc) {
TEST_F
(
ParserSelectTest
,
uniqueFuncSemanticCheck
)
{
useDb
(
"root"
,
"test"
);
run
(
"SELECT UNIQUE(c1) FROM t1 INTERVAL(10S)"
,
TSDB_CODE_PAR_
WINDOW_
NOT_ALLOWED_FUNC
);
run
(
"SELECT UNIQUE(c1) FROM t1 INTERVAL(10S)"
,
TSDB_CODE_PAR_NOT_ALLOWED_FUNC
);
run
(
"SELECT UNIQUE(c1) FROM t1 GROUP BY c2"
,
TSDB_CODE_PAR_
GROUP_BY_
NOT_ALLOWED_FUNC
);
run
(
"SELECT UNIQUE(c1) FROM t1 GROUP BY c2"
,
TSDB_CODE_PAR_NOT_ALLOWED_FUNC
);
}
TEST_F
(
ParserSelectTest
,
tailFunc
)
{
...
...
@@ -194,9 +194,9 @@ TEST_F(ParserSelectTest, tailFunc) {
TEST_F
(
ParserSelectTest
,
tailFuncSemanticCheck
)
{
useDb
(
"root"
,
"test"
);
run
(
"SELECT TAIL(c1, 10) FROM t1 INTERVAL(10S)"
,
TSDB_CODE_PAR_
WINDOW_
NOT_ALLOWED_FUNC
);
run
(
"SELECT TAIL(c1, 10) FROM t1 INTERVAL(10S)"
,
TSDB_CODE_PAR_NOT_ALLOWED_FUNC
);
run
(
"SELECT TAIL(c1, 10) FROM t1 GROUP BY c2"
,
TSDB_CODE_PAR_
GROUP_BY_
NOT_ALLOWED_FUNC
);
run
(
"SELECT TAIL(c1, 10) FROM t1 GROUP BY c2"
,
TSDB_CODE_PAR_NOT_ALLOWED_FUNC
);
}
TEST_F
(
ParserSelectTest
,
partitionBy
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录