Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Cherenkov effect
TDengine
提交
f0df8cc6
T
TDengine
项目概览
Cherenkov effect
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
2
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看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
f0df8cc6
编写于
2月 05, 2020
作者:
P
plum-lihui
提交者:
GitHub
2月 05, 2020
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #1187 from taosdata/feature/liaohj
Feature/liaohj
上级
45c10cb5
a81ea816
变更
7
展开全部
隐藏空白更改
内联
并排
Showing
7 changed file
with
150 addition
and
144 deletion
+150
-144
src/client/src/tscSQLParser.c
src/client/src/tscSQLParser.c
+35
-28
src/client/src/tscServer.c
src/client/src/tscServer.c
+1
-2
src/client/src/tscSql.c
src/client/src/tscSql.c
+2
-0
src/client/src/tscStream.c
src/client/src/tscStream.c
+2
-0
src/client/src/tscSyntaxtreefunction.c
src/client/src/tscSyntaxtreefunction.c
+24
-24
src/client/src/tscUtil.c
src/client/src/tscUtil.c
+4
-0
src/system/detail/src/vnodeQueryImpl.c
src/system/detail/src/vnodeQueryImpl.c
+82
-90
未找到文件。
src/client/src/tscSQLParser.c
浏览文件 @
f0df8cc6
...
...
@@ -652,7 +652,16 @@ int32_t parseIntervalClause(SQueryInfo* pQueryInfo, SQuerySQL* pQuerySql) {
SColumnList
ids
=
getColumnList
(
1
,
0
,
PRIMARYKEY_TIMESTAMP_COL_INDEX
);
return
insertResultField
(
pQueryInfo
,
0
,
&
ids
,
TSDB_KEYSIZE
,
TSDB_DATA_TYPE_TIMESTAMP
,
aAggs
[
TSDB_FUNC_TS
].
aName
);
int32_t
ret
=
insertResultField
(
pQueryInfo
,
0
,
&
ids
,
TSDB_KEYSIZE
,
TSDB_DATA_TYPE_TIMESTAMP
,
aAggs
[
TSDB_FUNC_TS
].
aName
);
if
(
ret
!=
TSDB_CODE_SUCCESS
)
{
return
ret
;
}
if
(
setSlidingClause
(
pQueryInfo
,
pQuerySql
)
!=
TSDB_CODE_SUCCESS
)
{
return
TSDB_CODE_INVALID_SQL
;
}
return
TSDB_CODE_SUCCESS
;
}
int32_t
setSlidingClause
(
SQueryInfo
*
pQueryInfo
,
SQuerySQL
*
pQuerySql
)
{
...
...
@@ -675,6 +684,8 @@ int32_t setSlidingClause(SQueryInfo* pQueryInfo, SQuerySQL* pQuerySql) {
if
(
pQueryInfo
->
nSlidingTime
>
pQueryInfo
->
nAggTimeInterval
)
{
return
invalidSqlErrMsg
(
pQueryInfo
->
msg
,
msg1
);
}
}
else
{
pSliding
->
n
=
pQueryInfo
->
nAggTimeInterval
;
}
return
TSDB_CODE_SUCCESS
;
...
...
@@ -5394,10 +5405,6 @@ int32_t doCheckForStream(SSqlObj* pSql, SSqlInfo* pInfo) {
}
}
if
(
setSlidingClause
(
pQueryInfo
,
pQuerySql
)
!=
TSDB_CODE_SUCCESS
)
{
return
TSDB_CODE_INVALID_SQL
;
}
// set the created table[stream] name
if
(
setMeterID
(
pMeterMetaInfo
,
pzTableName
,
pSql
)
!=
TSDB_CODE_SUCCESS
)
{
return
invalidSqlErrMsg
(
pQueryInfo
->
msg
,
msg1
);
...
...
@@ -5581,29 +5588,29 @@ int32_t doCheckForQuery(SSqlObj* pSql, SQuerySQL* pQuerySql, int32_t index) {
return
invalidSqlErrMsg
(
pQueryInfo
->
msg
,
msg2
);
}
// set sliding value, the query time range needs to be decide in the first place
SSQLToken
*
pSliding
=
&
pQuerySql
->
sliding
;
if
(
pSliding
->
n
!=
0
)
{
if
(
!
tscEmbedded
&&
pCmd
->
inStream
==
0
&&
hasDefaultQueryTimeRange
(
pQueryInfo
))
{
// sliding only allowed in stream
const
char
*
msg
=
"time range expected for sliding window query"
;
return
invalidSqlErrMsg
(
tscGetErrorMsgPayload
(
pCmd
),
msg
);
}
getTimestampInUsFromStr
(
pSliding
->
z
,
pSliding
->
n
,
&
pQueryInfo
->
nSlidingTime
);
if
(
pMeterMetaInfo
->
pMeterMeta
->
precision
==
TSDB_TIME_PRECISION_MILLI
)
{
pQueryInfo
->
nSlidingTime
/=
1000
;
}
if
(
pQueryInfo
->
nSlidingTime
<
tsMinSlidingTime
)
{
return
invalidSqlErrMsg
(
pQueryInfo
->
msg
,
msg3
);
}
if
(
pQueryInfo
->
nSlidingTime
>
pQueryInfo
->
nAggTimeInterval
)
{
return
invalidSqlErrMsg
(
pQueryInfo
->
msg
,
msg4
);
}
}
else
{
pQueryInfo
->
nSlidingTime
=
-
1
;
}
//
// set sliding value, the query time range needs to be decide in the first place
//
SSQLToken* pSliding = &pQuerySql->sliding;
//
if (pSliding->n != 0) {
//
if (!tscEmbedded && pCmd->inStream == 0 && hasDefaultQueryTimeRange(pQueryInfo)) { // sliding only allowed in stream
//
const char* msg = "time range expected for sliding window query";
//
return invalidSqlErrMsg(tscGetErrorMsgPayload(pCmd), msg);
//
}
//
//
getTimestampInUsFromStr(pSliding->z, pSliding->n, &pQueryInfo->nSlidingTime);
//
if (pMeterMetaInfo->pMeterMeta->precision == TSDB_TIME_PRECISION_MILLI) {
//
pQueryInfo->nSlidingTime /= 1000;
//
}
//
//
if (pQueryInfo->nSlidingTime < tsMinSlidingTime) {
//
return invalidSqlErrMsg(pQueryInfo->msg, msg3);
//
}
//
//
if (pQueryInfo->nSlidingTime > pQueryInfo->nAggTimeInterval) {
//
return invalidSqlErrMsg(pQueryInfo->msg, msg4);
//
}
//
} else {
//
pQueryInfo->nSlidingTime = -1;
//
}
// in case of join query, time range is required.
if
(
QUERY_IS_JOIN_QUERY
(
pQueryInfo
->
type
))
{
...
...
src/client/src/tscServer.c
浏览文件 @
f0df8cc6
...
...
@@ -1110,8 +1110,7 @@ static void tscHandleSubRetrievalError(SRetrieveSupport *trsupport, SSqlObj *pSq
}
// all subqueries are failed
tscError
(
"%p retrieve from %d vnode(s) completed,code:%d.FAILED."
,
pPObj
,
pState
->
numOfTotal
,
pState
->
code
);
tscError
(
"%p retrieve from %d vnode(s) completed,code:%d.FAILED."
,
pPObj
,
pState
->
numOfTotal
,
pState
->
code
);
pPObj
->
res
.
code
=
-
(
pState
->
code
);
// release allocated resource
...
...
src/client/src/tscSql.c
浏览文件 @
f0df8cc6
...
...
@@ -754,6 +754,8 @@ void taos_free_result_imp(TAOS_RES* res, int keepCmd) {
pSql
->
pStream
==
NULL
&&
pMeterMetaInfo
->
pMeterMeta
!=
NULL
)))
{
pCmd
->
command
=
(
pCmd
->
command
>
TSDB_SQL_MGMT
)
?
TSDB_SQL_RETRIEVE
:
TSDB_SQL_FETCH
;
tscTrace
(
"%p code:%d, numOfRows:%d, command:%d"
,
pSql
,
pRes
->
code
,
pRes
->
numOfRows
,
pCmd
->
command
);
void
*
fp
=
pSql
->
fp
;
if
(
fp
!=
NULL
)
{
pSql
->
freed
=
1
;
...
...
src/client/src/tscStream.c
浏览文件 @
f0df8cc6
...
...
@@ -411,7 +411,9 @@ static void tscSetSlidingWindowInfo(SSqlObj *pSql, SSqlStream *pStream) {
}
pStream
->
slidingTime
=
pQueryInfo
->
nSlidingTime
;
pQueryInfo
->
nAggTimeInterval
=
0
;
// clear the interval value to avoid the force time window split by query processor
pQueryInfo
->
nSlidingTime
=
0
;
}
static
int64_t
tscGetStreamStartTimestamp
(
SSqlObj
*
pSql
,
SSqlStream
*
pStream
,
int64_t
stime
)
{
...
...
src/client/src/tscSyntaxtreefunction.c
浏览文件 @
f0df8cc6
...
...
@@ -26,7 +26,7 @@
int32_t step = ((_ord) == TSQL_SO_ASC) ? 1 : -1; \
\
if ((len1) == (len2)) { \
for (; i < (len2) && i >= 0; i += step, (out) +=
step
) { \
for (; i < (len2) && i >= 0; i += step, (out) +=
1
) { \
if (isNull((char *)&((left)[i]), _left_type) || isNull((char *)&((right)[i]), _right_type)) { \
setNull((char *)(out), _res_type, tDataTypeDesc[_res_type].nSize); \
continue; \
...
...
@@ -34,7 +34,7 @@
*(out) = (double)(left)[i] op(right)[i]; \
} \
} else if ((len1) == 1) { \
for (; i >= 0 && i < (len2); i += step, (out) +=
step
) { \
for (; i >= 0 && i < (len2); i += step, (out) +=
1
) { \
if (isNull((char *)(left), _left_type) || isNull((char *)&(right)[i], _right_type)) { \
setNull((char *)(out), _res_type, tDataTypeDesc[_res_type].nSize); \
continue; \
...
...
@@ -42,7 +42,7 @@
*(out) = (double)(left)[0] op(right)[i]; \
} \
} else if ((len2) == 1) { \
for (; i >= 0 && i < (len1); i += step, (out) +=
step
) { \
for (; i >= 0 && i < (len1); i += step, (out) +=
1
) { \
if (isNull((char *)&(left)[i], _left_type) || isNull((char *)(right), _right_type)) { \
setNull((char *)(out), _res_type, tDataTypeDesc[_res_type].nSize); \
continue; \
...
...
@@ -58,7 +58,7 @@
int32_t step = (_ord == TSQL_SO_ASC) ? 1 : -1; \
\
if (len1 == (len2)) { \
for (; i >= 0 && i < (len2); i += step, (out) +=
step
) { \
for (; i >= 0 && i < (len2); i += step, (out) +=
1
) { \
if (isNull((char *)&(left[i]), _left_type) || isNull((char *)&(right[i]), _right_type)) { \
setNull((char *)(out), _res_type, tDataTypeDesc[_res_type].nSize); \
continue; \
...
...
@@ -66,7 +66,7 @@
*(out) = (double)(left)[i] - ((int64_t)(((double)(left)[i]) / (right)[i])) * (right)[i]; \
} \
} else if (len1 == 1) { \
for (; i >= 0 && i < (len2); i += step, (out) +=
step
) { \
for (; i >= 0 && i < (len2); i += step, (out) +=
1
) { \
if (isNull((char *)(left), _left_type) || isNull((char *)&((right)[i]), _right_type)) { \
setNull((char *)(out), _res_type, tDataTypeDesc[_res_type].nSize); \
continue; \
...
...
@@ -74,7 +74,7 @@
*(out) = (double)(left)[0] - ((int64_t)(((double)(left)[0]) / (right)[i])) * (right)[i]; \
} \
} else if ((len2) == 1) { \
for (; i >= 0 && i < len1; i += step, (out) +=
step
) { \
for (; i >= 0 && i < len1; i += step, (out) +=
1
) { \
if (isNull((char *)&((left)[i]), _left_type) || isNull((char *)(right), _right_type)) { \
setNull((char *)(out), _res_type, tDataTypeDesc[_res_type].nSize); \
continue; \
...
...
@@ -112,7 +112,7 @@ void calc_fn_i32_i32_add(void *left, void *right, int32_t numLeft, int32_t numRi
int32_t
step
=
(
order
==
TSQL_SO_ASC
)
?
1
:
-
1
;
if
(
numLeft
==
numRight
)
{
for
(;
i
>=
0
&&
i
<
numRight
;
i
+=
step
,
pOutput
+=
step
)
{
for
(;
i
>=
0
&&
i
<
numRight
;
i
+=
step
,
pOutput
+=
1
)
{
if
(
isNull
((
char
*
)
&
(
pLeft
[
i
]),
TSDB_DATA_TYPE_INT
)
||
isNull
((
char
*
)
&
(
pRight
[
i
]),
TSDB_DATA_TYPE_INT
))
{
setNull
((
char
*
)(
pOutput
),
TSDB_DATA_TYPE_DOUBLE
,
tDataTypeDesc
[
TSDB_DATA_TYPE_DOUBLE
].
nSize
);
continue
;
...
...
@@ -121,7 +121,7 @@ void calc_fn_i32_i32_add(void *left, void *right, int32_t numLeft, int32_t numRi
*
pOutput
=
(
double
)
pLeft
[
i
]
+
pRight
[
i
];
}
}
else
if
(
numLeft
==
1
)
{
for
(;
i
>=
0
&&
i
<
numRight
;
i
+=
step
,
pOutput
+=
step
)
{
for
(;
i
>=
0
&&
i
<
numRight
;
i
+=
step
,
pOutput
+=
1
)
{
if
(
isNull
((
char
*
)(
pLeft
),
TSDB_DATA_TYPE_INT
)
||
isNull
((
char
*
)
&
(
pRight
[
i
]),
TSDB_DATA_TYPE_INT
))
{
setNull
((
char
*
)
pOutput
,
TSDB_DATA_TYPE_DOUBLE
,
tDataTypeDesc
[
TSDB_DATA_TYPE_DOUBLE
].
nSize
);
continue
;
...
...
@@ -130,7 +130,7 @@ void calc_fn_i32_i32_add(void *left, void *right, int32_t numLeft, int32_t numRi
*
pOutput
=
(
double
)
pLeft
[
0
]
+
pRight
[
i
];
}
}
else
if
(
numRight
==
1
)
{
for
(;
i
>=
0
&&
i
<
numLeft
;
i
+=
step
,
pOutput
+=
step
)
{
for
(;
i
>=
0
&&
i
<
numLeft
;
i
+=
step
,
pOutput
+=
1
)
{
if
(
isNull
((
char
*
)
&
(
pLeft
[
i
]),
TSDB_DATA_TYPE_INT
)
||
isNull
((
char
*
)(
pRight
),
TSDB_DATA_TYPE_INT
))
{
setNull
((
char
*
)
pOutput
,
TSDB_DATA_TYPE_DOUBLE
,
tDataTypeDesc
[
TSDB_DATA_TYPE_DOUBLE
].
nSize
);
continue
;
...
...
@@ -310,7 +310,7 @@ void calc_fn_i32_i32_sub(void *left, void *right, int32_t numLeft, int32_t numRi
int32_t
step
=
(
order
==
TSQL_SO_ASC
)
?
1
:
-
1
;
if
(
numLeft
==
numRight
)
{
for
(;
i
>=
0
&&
i
<
numRight
;
i
+=
step
,
pOutput
+=
step
)
{
for
(;
i
>=
0
&&
i
<
numRight
;
i
+=
step
,
pOutput
+=
1
)
{
if
(
isNull
((
char
*
)
&
(
pLeft
[
i
]),
TSDB_DATA_TYPE_INT
)
||
isNull
((
char
*
)
&
(
pRight
[
i
]),
TSDB_DATA_TYPE_INT
))
{
setNull
((
char
*
)
&
(
pOutput
[
i
]),
TSDB_DATA_TYPE_DOUBLE
,
tDataTypeDesc
[
TSDB_DATA_TYPE_DOUBLE
].
nSize
);
continue
;
...
...
@@ -318,7 +318,7 @@ void calc_fn_i32_i32_sub(void *left, void *right, int32_t numLeft, int32_t numRi
*
pOutput
=
(
double
)
pLeft
[
i
]
-
pRight
[
i
];
}
}
else
if
(
numLeft
==
1
)
{
for
(;
i
>=
0
&&
i
<
numRight
;
i
+=
step
,
pOutput
+=
step
)
{
for
(;
i
>=
0
&&
i
<
numRight
;
i
+=
step
,
pOutput
+=
1
)
{
if
(
isNull
((
char
*
)(
pLeft
),
TSDB_DATA_TYPE_INT
)
||
isNull
((
char
*
)
&
(
pRight
[
i
]),
TSDB_DATA_TYPE_INT
))
{
setNull
((
char
*
)(
pOutput
),
TSDB_DATA_TYPE_DOUBLE
,
tDataTypeDesc
[
TSDB_DATA_TYPE_DOUBLE
].
nSize
);
continue
;
...
...
@@ -326,7 +326,7 @@ void calc_fn_i32_i32_sub(void *left, void *right, int32_t numLeft, int32_t numRi
*
pOutput
=
(
double
)
pLeft
[
0
]
-
pRight
[
i
];
}
}
else
if
(
numRight
==
1
)
{
for
(;
i
>=
0
&&
i
<
numLeft
;
i
+=
step
,
pOutput
+=
step
)
{
for
(;
i
>=
0
&&
i
<
numLeft
;
i
+=
step
,
pOutput
+=
1
)
{
if
(
isNull
((
char
*
)
&
pLeft
[
i
],
TSDB_DATA_TYPE_INT
)
||
isNull
((
char
*
)(
pRight
),
TSDB_DATA_TYPE_INT
))
{
setNull
((
char
*
)(
pOutput
),
TSDB_DATA_TYPE_DOUBLE
,
tDataTypeDesc
[
TSDB_DATA_TYPE_DOUBLE
].
nSize
);
continue
;
...
...
@@ -521,7 +521,7 @@ void calc_fn_i32_i32_multi(void *left, void *right, int32_t numLeft, int32_t num
int32_t
step
=
(
order
==
TSQL_SO_ASC
)
?
1
:
-
1
;
if
(
numLeft
==
numRight
)
{
for
(;
i
>=
0
&&
i
<
numRight
;
i
+=
step
,
pOutput
+=
step
)
{
for
(;
i
>=
0
&&
i
<
numRight
;
i
+=
step
,
pOutput
+=
1
)
{
if
(
isNull
((
char
*
)
&
(
pLeft
[
i
]),
TSDB_DATA_TYPE_INT
)
||
isNull
((
char
*
)
&
(
pRight
[
i
]),
TSDB_DATA_TYPE_INT
))
{
setNull
((
char
*
)(
pOutput
),
TSDB_DATA_TYPE_DOUBLE
,
tDataTypeDesc
[
TSDB_DATA_TYPE_DOUBLE
].
nSize
);
continue
;
...
...
@@ -530,7 +530,7 @@ void calc_fn_i32_i32_multi(void *left, void *right, int32_t numLeft, int32_t num
*
pOutput
=
(
double
)
pLeft
[
i
]
*
pRight
[
i
];
}
}
else
if
(
numLeft
==
1
)
{
for
(;
i
>=
0
&&
i
<
numRight
;
i
+=
step
,
pOutput
+=
step
)
{
for
(;
i
>=
0
&&
i
<
numRight
;
i
+=
step
,
pOutput
+=
1
)
{
if
(
isNull
((
char
*
)(
pLeft
),
TSDB_DATA_TYPE_INT
)
||
isNull
((
char
*
)
&
(
pRight
[
i
]),
TSDB_DATA_TYPE_INT
))
{
setNull
((
char
*
)
pOutput
,
TSDB_DATA_TYPE_DOUBLE
,
tDataTypeDesc
[
TSDB_DATA_TYPE_DOUBLE
].
nSize
);
continue
;
...
...
@@ -539,7 +539,7 @@ void calc_fn_i32_i32_multi(void *left, void *right, int32_t numLeft, int32_t num
*
pOutput
=
(
double
)
pLeft
[
0
]
*
pRight
[
i
];
}
}
else
if
(
numRight
==
1
)
{
for
(;
i
>=
0
&&
i
<
numLeft
;
i
+=
step
,
pOutput
+=
step
)
{
for
(;
i
>=
0
&&
i
<
numLeft
;
i
+=
step
,
pOutput
+=
1
)
{
if
(
isNull
((
char
*
)
&
(
pLeft
[
i
]),
TSDB_DATA_TYPE_INT
)
||
isNull
((
char
*
)(
pRight
),
TSDB_DATA_TYPE_INT
))
{
setNull
((
char
*
)
pOutput
,
TSDB_DATA_TYPE_DOUBLE
,
tDataTypeDesc
[
TSDB_DATA_TYPE_DOUBLE
].
nSize
);
continue
;
...
...
@@ -719,7 +719,7 @@ void calc_fn_i32_i32_div(void *left, void *right, int32_t numLeft, int32_t numRi
int32_t
step
=
(
order
==
TSQL_SO_ASC
)
?
1
:
-
1
;
if
(
numLeft
==
numRight
)
{
for
(;
i
>=
0
&&
i
<
numRight
;
i
+=
step
,
pOutput
+=
step
)
{
for
(;
i
>=
0
&&
i
<
numRight
;
i
+=
step
,
pOutput
+=
1
)
{
if
(
isNull
((
char
*
)
&
(
pLeft
[
i
]),
TSDB_DATA_TYPE_INT
)
||
isNull
((
char
*
)
&
(
pRight
[
i
]),
TSDB_DATA_TYPE_INT
))
{
setNull
((
char
*
)(
pOutput
),
TSDB_DATA_TYPE_DOUBLE
,
tDataTypeDesc
[
TSDB_DATA_TYPE_DOUBLE
].
nSize
);
continue
;
...
...
@@ -728,7 +728,7 @@ void calc_fn_i32_i32_div(void *left, void *right, int32_t numLeft, int32_t numRi
*
pOutput
=
(
double
)
pLeft
[
i
]
/
pRight
[
i
];
}
}
else
if
(
numLeft
==
1
)
{
for
(;
i
>=
0
&&
i
<
numRight
;
i
+=
step
,
pOutput
+=
step
)
{
for
(;
i
>=
0
&&
i
<
numRight
;
i
+=
step
,
pOutput
+=
1
)
{
if
(
isNull
((
char
*
)(
pLeft
),
TSDB_DATA_TYPE_INT
)
||
isNull
((
char
*
)
&
(
pRight
[
i
]),
TSDB_DATA_TYPE_INT
))
{
setNull
((
char
*
)
pOutput
,
TSDB_DATA_TYPE_DOUBLE
,
tDataTypeDesc
[
TSDB_DATA_TYPE_DOUBLE
].
nSize
);
continue
;
...
...
@@ -737,7 +737,7 @@ void calc_fn_i32_i32_div(void *left, void *right, int32_t numLeft, int32_t numRi
*
pOutput
=
(
double
)
pLeft
[
0
]
/
pRight
[
i
];
}
}
else
if
(
numRight
==
1
)
{
for
(;
i
>=
0
&&
i
<
numLeft
;
i
+=
step
,
pOutput
+=
step
)
{
for
(;
i
>=
0
&&
i
<
numLeft
;
i
+=
step
,
pOutput
+=
1
)
{
if
(
isNull
((
char
*
)
&
(
pLeft
[
i
]),
TSDB_DATA_TYPE_INT
)
||
isNull
((
char
*
)(
pRight
),
TSDB_DATA_TYPE_INT
))
{
setNull
((
char
*
)
pOutput
,
TSDB_DATA_TYPE_DOUBLE
,
tDataTypeDesc
[
TSDB_DATA_TYPE_DOUBLE
].
nSize
);
continue
;
...
...
@@ -933,7 +933,7 @@ void calc_fn_i32_i32_rem(void *left, void *right, int32_t numLeft, int32_t numRi
int32_t
step
=
(
order
==
TSQL_SO_ASC
)
?
1
:
-
1
;
if
(
numLeft
==
numRight
)
{
for
(;
i
>=
0
&&
i
<
numRight
;
i
+=
step
,
pOutput
+=
step
)
{
for
(;
i
>=
0
&&
i
<
numRight
;
i
+=
step
,
pOutput
+=
1
)
{
if
(
isNull
((
char
*
)
&
(
pLeft
[
i
]),
TSDB_DATA_TYPE_INT
)
||
isNull
((
char
*
)
&
(
pRight
[
i
]),
TSDB_DATA_TYPE_INT
))
{
setNull
((
char
*
)(
pOutput
),
TSDB_DATA_TYPE_DOUBLE
,
tDataTypeDesc
[
TSDB_DATA_TYPE_DOUBLE
].
nSize
);
continue
;
...
...
@@ -942,7 +942,7 @@ void calc_fn_i32_i32_rem(void *left, void *right, int32_t numLeft, int32_t numRi
*
pOutput
=
(
double
)
pLeft
[
i
]
-
((
int64_t
)(((
double
)
pLeft
[
i
])
/
pRight
[
i
]))
*
pRight
[
i
];
}
}
else
if
(
numLeft
==
1
)
{
for
(;
i
>=
0
&&
i
<
numRight
;
i
+=
step
,
pOutput
+=
step
)
{
for
(;
i
>=
0
&&
i
<
numRight
;
i
+=
step
,
pOutput
+=
1
)
{
if
(
isNull
((
char
*
)(
pLeft
),
TSDB_DATA_TYPE_INT
)
||
isNull
((
char
*
)
&
(
pRight
[
i
]),
TSDB_DATA_TYPE_INT
))
{
setNull
((
char
*
)
pOutput
,
TSDB_DATA_TYPE_DOUBLE
,
tDataTypeDesc
[
TSDB_DATA_TYPE_DOUBLE
].
nSize
);
continue
;
...
...
@@ -951,7 +951,7 @@ void calc_fn_i32_i32_rem(void *left, void *right, int32_t numLeft, int32_t numRi
*
pOutput
=
(
double
)
pLeft
[
0
]
-
((
int64_t
)(((
double
)
pLeft
[
0
])
/
pRight
[
i
]))
*
pRight
[
i
];
}
}
else
if
(
numRight
==
1
)
{
for
(;
i
>=
0
&&
i
<
numLeft
;
i
+=
step
,
pOutput
+=
step
)
{
for
(;
i
>=
0
&&
i
<
numLeft
;
i
+=
step
,
pOutput
+=
1
)
{
if
(
isNull
((
char
*
)
&
(
pLeft
[
i
]),
TSDB_DATA_TYPE_INT
)
||
isNull
((
char
*
)(
pRight
),
TSDB_DATA_TYPE_INT
))
{
setNull
((
char
*
)
pOutput
,
TSDB_DATA_TYPE_DOUBLE
,
tDataTypeDesc
[
TSDB_DATA_TYPE_DOUBLE
].
nSize
);
continue
;
...
...
@@ -991,7 +991,7 @@ void calc_fn_i32_d_rem(void *left, void *right, int32_t numLeft, int32_t numRigh
int32_t
step
=
(
order
==
TSQL_SO_ASC
)
?
1
:
-
1
;
if
(
numLeft
==
numRight
)
{
for
(;
i
>=
0
&&
i
<
numRight
;
i
+=
step
,
pOutput
+=
step
)
{
for
(;
i
>=
0
&&
i
<
numRight
;
i
+=
step
,
pOutput
+=
1
)
{
if
(
isNull
((
char
*
)
&
(
pLeft
[
i
]),
TSDB_DATA_TYPE_INT
)
||
isNull
((
char
*
)
&
(
pRight
[
i
]),
TSDB_DATA_TYPE_INT
))
{
setNull
((
char
*
)(
pOutput
),
TSDB_DATA_TYPE_DOUBLE
,
tDataTypeDesc
[
TSDB_DATA_TYPE_DOUBLE
].
nSize
);
continue
;
...
...
@@ -1000,7 +1000,7 @@ void calc_fn_i32_d_rem(void *left, void *right, int32_t numLeft, int32_t numRigh
*
pOutput
=
(
double
)
pLeft
[
i
]
-
((
int64_t
)(((
double
)
pLeft
[
i
])
/
pRight
[
i
]))
*
pRight
[
i
];
}
}
else
if
(
numLeft
==
1
)
{
for
(;
i
>=
0
&&
i
<
numRight
;
i
+=
step
,
pOutput
+=
step
)
{
for
(;
i
>=
0
&&
i
<
numRight
;
i
+=
step
,
pOutput
+=
1
)
{
if
(
isNull
((
char
*
)(
pLeft
),
TSDB_DATA_TYPE_INT
)
||
isNull
((
char
*
)
&
(
pRight
[
i
]),
TSDB_DATA_TYPE_INT
))
{
setNull
((
char
*
)
pOutput
,
TSDB_DATA_TYPE_DOUBLE
,
tDataTypeDesc
[
TSDB_DATA_TYPE_DOUBLE
].
nSize
);
continue
;
...
...
@@ -1009,7 +1009,7 @@ void calc_fn_i32_d_rem(void *left, void *right, int32_t numLeft, int32_t numRigh
*
pOutput
=
(
double
)
pLeft
[
0
]
-
((
int64_t
)(((
double
)
pLeft
[
0
])
/
pRight
[
i
]))
*
pRight
[
i
];
}
}
else
if
(
numRight
==
1
)
{
for
(;
i
>=
0
&&
i
<
numLeft
;
i
+=
step
,
pOutput
+=
step
)
{
for
(;
i
>=
0
&&
i
<
numLeft
;
i
+=
step
,
pOutput
+=
1
)
{
if
(
isNull
((
char
*
)
&
(
pLeft
[
i
]),
TSDB_DATA_TYPE_INT
)
||
isNull
((
char
*
)(
pRight
),
TSDB_DATA_TYPE_INT
))
{
setNull
((
char
*
)
pOutput
,
TSDB_DATA_TYPE_DOUBLE
,
tDataTypeDesc
[
TSDB_DATA_TYPE_DOUBLE
].
nSize
);
continue
;
...
...
src/client/src/tscUtil.c
浏览文件 @
f0df8cc6
...
...
@@ -214,6 +214,10 @@ bool tscIsTwoStageMergeMetricQuery(SQueryInfo* pQueryInfo, int32_t tableIndex) {
if
(
pMeterMetaInfo
==
NULL
||
pMeterMetaInfo
->
pMetricMeta
==
NULL
)
{
return
false
;
}
if
((
pQueryInfo
->
type
&
TSDB_QUERY_TYPE_FREE_RESOURCE
)
==
TSDB_QUERY_TYPE_FREE_RESOURCE
)
{
return
false
;
}
// for ordered projection query, iterate all qualified vnodes sequentially
if
(
tscNonOrderedProjectionQueryOnSTable
(
pQueryInfo
,
tableIndex
))
{
...
...
src/system/detail/src/vnodeQueryImpl.c
浏览文件 @
f0df8cc6
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录