Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
a37da4e7
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看板
提交
a37da4e7
编写于
6月 21, 2021
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[td-4776]<fix>:update the error message.
上级
3dc8eca0
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
10 addition
and
14 deletion
+10
-14
src/client/src/tscSQLParser.c
src/client/src/tscSQLParser.c
+9
-12
src/query/src/qAggMain.c
src/query/src/qAggMain.c
+1
-2
未找到文件。
src/client/src/tscSQLParser.c
浏览文件 @
a37da4e7
...
...
@@ -2254,10 +2254,11 @@ int32_t addExprAndResultField(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, int32_t col
case
TSDB_FUNC_LEASTSQR
:
{
// 1. valid the number of parameters
int32_t
numOfParams
=
(
pItem
->
pNode
->
pParam
==
NULL
)
?
0
:
(
int32_t
)
taosArrayGetSize
(
pItem
->
pNode
->
pParam
);
// no parameters or more than one parameter for function
if
(
pItem
->
pNode
->
pParam
==
NULL
||
(
functionId
!=
TSDB_FUNC_LEASTSQR
&&
functionId
!=
TSDB_FUNC_DERIVATIVE
&&
numOfParams
!=
1
)
||
((
functionId
==
TSDB_FUNC_LEASTSQR
||
functionId
==
TSDB_FUNC_DERIVATIVE
)
&&
numOfParams
!=
3
))
{
/* no parameters or more than one parameter for function */
return
invalidOperationMsg
(
tscGetErrorMsgPayload
(
pCmd
),
msg2
);
}
...
...
@@ -2271,14 +2272,15 @@ int32_t addExprAndResultField(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, int32_t col
return
invalidOperationMsg
(
tscGetErrorMsgPayload
(
pCmd
),
msg3
);
}
if
(
index
.
columnIndex
==
TSDB_TBNAME_COLUMN_INDEX
)
{
pTableMetaInfo
=
tscGetMetaInfo
(
pQueryInfo
,
index
.
tableIndex
);
STableComInfo
info
=
tscGetTableInfo
(
pTableMetaInfo
->
pTableMeta
);
// functions can not be applied to tags
if
(
index
.
columnIndex
==
TSDB_TBNAME_COLUMN_INDEX
||
(
index
.
columnIndex
>=
tscGetNumOfColumns
(
pTableMetaInfo
->
pTableMeta
)))
{
return
invalidOperationMsg
(
tscGetErrorMsgPayload
(
pCmd
),
msg6
);
}
// 2. check if sql function can be applied on this column data type
pTableMetaInfo
=
tscGetMetaInfo
(
pQueryInfo
,
index
.
tableIndex
);
STableComInfo
info
=
tscGetTableInfo
(
pTableMetaInfo
->
pTableMeta
);
SSchema
*
pSchema
=
tscGetTableColumnSchema
(
pTableMetaInfo
->
pTableMeta
,
index
.
columnIndex
);
if
(
!
IS_NUMERIC_TYPE
(
pSchema
->
type
))
{
...
...
@@ -2307,11 +2309,6 @@ int32_t addExprAndResultField(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, int32_t col
insertResultField
(
pQueryInfo
,
0
,
&
ids
,
TSDB_KEYSIZE
,
TSDB_DATA_TYPE_TIMESTAMP
,
aAggs
[
TSDB_FUNC_TS_DUMMY
].
name
,
pExpr
);
}
// functions can not be applied to tags
if
(
index
.
columnIndex
>=
tscGetNumOfColumns
(
pTableMetaInfo
->
pTableMeta
))
{
return
invalidOperationMsg
(
tscGetErrorMsgPayload
(
pCmd
),
msg6
);
}
SExprInfo
*
pExpr
=
tscExprAppend
(
pQueryInfo
,
functionId
,
&
index
,
resultType
,
resultSize
,
getNewResColId
(
pCmd
),
intermediateResSize
,
false
);
if
(
functionId
==
TSDB_FUNC_LEASTSQR
)
{
// set the leastsquares parameters
...
...
@@ -2340,9 +2337,9 @@ int32_t addExprAndResultField(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, int32_t col
}
if
(
info
.
precision
==
TSDB_TIME_PRECISION_MILLI
)
{
tickPerSec
/=
1000000
;
tickPerSec
/=
TSDB_TICK_PER_SECOND
(
TSDB_TIME_PRECISION_MICRO
)
;
}
else
if
(
info
.
precision
==
TSDB_TIME_PRECISION_MICRO
)
{
tickPerSec
/=
1000
;
tickPerSec
/=
TSDB_TICK_PER_SECOND
(
TSDB_TIME_PRECISION_MILLI
)
;
}
if
(
tickPerSec
<=
0
||
tickPerSec
<
TSDB_TICK_PER_SECOND
(
info
.
precision
))
{
...
...
src/query/src/qAggMain.c
浏览文件 @
a37da4e7
...
...
@@ -4166,8 +4166,7 @@ void blockinfo_func_finalizer(SQLFunctionCtx* pCtx) {
* function compatible list.
* tag and ts are not involved in the compatibility check
*
* 1. functions that are not simultaneously present with any other functions. e.g.,
* diff/ts_z/top/bottom
* 1. functions that are not simultaneously present with any other functions. e.g., diff/ts_z/top/bottom
* 2. functions that are only allowed to be present only with same functions. e.g., last_row, interp
* 3. functions that are allowed to be present with other functions.
* e.g., count/sum/avg/min/max/stddev/percentile/apercentile/first/last...
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录