Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
d4b0e102
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
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看板
提交
d4b0e102
编写于
5月 19, 2023
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix:do some internal refactor.
上级
a488f31b
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
6 addition
and
8 deletion
+6
-8
include/common/ttime.h
include/common/ttime.h
+1
-1
source/common/src/ttime.c
source/common/src/ttime.c
+0
-2
source/libs/executor/src/executil.c
source/libs/executor/src/executil.c
+1
-1
source/libs/parser/src/parTranslater.c
source/libs/parser/src/parTranslater.c
+4
-4
未找到文件。
include/common/ttime.h
浏览文件 @
d4b0e102
...
@@ -23,7 +23,7 @@
...
@@ -23,7 +23,7 @@
extern
"C"
{
extern
"C"
{
#endif
#endif
#define
TIME_IS_VAR
_DURATION(_t) ((_t) == 'n' || (_t) == 'y' || (_t) == 'N' || (_t) == 'Y')
#define
IS_CALENDAR_TIME
_DURATION(_t) ((_t) == 'n' || (_t) == 'y' || (_t) == 'N' || (_t) == 'Y')
#define TIME_UNIT_NANOSECOND 'b'
#define TIME_UNIT_NANOSECOND 'b'
#define TIME_UNIT_MICROSECOND 'u'
#define TIME_UNIT_MICROSECOND 'u'
...
...
source/common/src/ttime.c
浏览文件 @
d4b0e102
...
@@ -709,8 +709,6 @@ int32_t parseNatualDuration(const char* token, int32_t tokenLen, int64_t* durati
...
@@ -709,8 +709,6 @@ int32_t parseNatualDuration(const char* token, int32_t tokenLen, int64_t* durati
return
getDuration
(
*
duration
,
*
unit
,
duration
,
timePrecision
);
return
getDuration
(
*
duration
,
*
unit
,
duration
,
timePrecision
);
}
}
#define IS_CALENDAR_TIME_DURATION(_d) (((_d) == 'n') || ((_d) == 'y'))
int64_t
taosTimeAdd
(
int64_t
t
,
int64_t
duration
,
char
unit
,
int32_t
precision
)
{
int64_t
taosTimeAdd
(
int64_t
t
,
int64_t
duration
,
char
unit
,
int32_t
precision
)
{
if
(
duration
==
0
)
{
if
(
duration
==
0
)
{
return
t
;
return
t
;
...
...
source/libs/executor/src/executil.c
浏览文件 @
d4b0e102
...
@@ -1759,7 +1759,7 @@ STimeWindow getActiveTimeWindow(SDiskbasedBuf* pBuf, SResultRowInfo* pResultRowI
...
@@ -1759,7 +1759,7 @@ STimeWindow getActiveTimeWindow(SDiskbasedBuf* pBuf, SResultRowInfo* pResultRowI
void
getNextTimeWindow
(
const
SInterval
*
pInterval
,
STimeWindow
*
tw
,
int32_t
order
)
{
void
getNextTimeWindow
(
const
SInterval
*
pInterval
,
STimeWindow
*
tw
,
int32_t
order
)
{
int32_t
factor
=
GET_FORWARD_DIRECTION_FACTOR
(
order
);
int32_t
factor
=
GET_FORWARD_DIRECTION_FACTOR
(
order
);
if
(
pInterval
->
slidingUnit
!=
'n'
&&
pInterval
->
slidingUnit
!=
'y'
)
{
if
(
!
IS_CALENDAR_TIME_DURATION
(
pInterval
->
slidingUnit
)
)
{
tw
->
skey
+=
pInterval
->
sliding
*
factor
;
tw
->
skey
+=
pInterval
->
sliding
*
factor
;
tw
->
ekey
=
taosTimeAdd
(
tw
->
skey
,
pInterval
->
interval
,
pInterval
->
intervalUnit
,
pInterval
->
precision
)
-
1
;
tw
->
ekey
=
taosTimeAdd
(
tw
->
skey
,
pInterval
->
interval
,
pInterval
->
intervalUnit
,
pInterval
->
precision
)
-
1
;
return
;
return
;
...
...
source/libs/parser/src/parTranslater.c
浏览文件 @
d4b0e102
...
@@ -3004,7 +3004,7 @@ static int32_t checkFill(STranslateContext* pCxt, SFillNode* pFill, SValueNode*
...
@@ -3004,7 +3004,7 @@ static int32_t checkFill(STranslateContext* pCxt, SFillNode* pFill, SValueNode*
int64_t
timeRange
=
TABS
(
pFill
->
timeRange
.
skey
-
pFill
->
timeRange
.
ekey
);
int64_t
timeRange
=
TABS
(
pFill
->
timeRange
.
skey
-
pFill
->
timeRange
.
ekey
);
int64_t
intervalRange
=
0
;
int64_t
intervalRange
=
0
;
if
(
TIME_IS_VAR
_DURATION
(
pInterval
->
unit
))
{
if
(
IS_CALENDAR_TIME
_DURATION
(
pInterval
->
unit
))
{
int64_t
f
=
1
;
int64_t
f
=
1
;
if
(
pInterval
->
unit
==
'n'
)
{
if
(
pInterval
->
unit
==
'n'
)
{
f
=
30LL
*
MILLISECOND_PER_DAY
;
f
=
30LL
*
MILLISECOND_PER_DAY
;
...
@@ -3072,7 +3072,7 @@ static int32_t checkIntervalWindow(STranslateContext* pCxt, SIntervalWindowNode*
...
@@ -3072,7 +3072,7 @@ static int32_t checkIntervalWindow(STranslateContext* pCxt, SIntervalWindowNode*
uint8_t
precision
=
((
SColumnNode
*
)
pInterval
->
pCol
)
->
node
.
resType
.
precision
;
uint8_t
precision
=
((
SColumnNode
*
)
pInterval
->
pCol
)
->
node
.
resType
.
precision
;
SValueNode
*
pInter
=
(
SValueNode
*
)
pInterval
->
pInterval
;
SValueNode
*
pInter
=
(
SValueNode
*
)
pInterval
->
pInterval
;
bool
valInter
=
TIME_IS_VAR
_DURATION
(
pInter
->
unit
);
bool
valInter
=
IS_CALENDAR_TIME
_DURATION
(
pInter
->
unit
);
if
(
pInter
->
datum
.
i
<=
0
||
(
!
valInter
&&
pInter
->
datum
.
i
<
tsMinIntervalTime
))
{
if
(
pInter
->
datum
.
i
<=
0
||
(
!
valInter
&&
pInter
->
datum
.
i
<
tsMinIntervalTime
))
{
return
generateSyntaxErrMsg
(
&
pCxt
->
msgBuf
,
TSDB_CODE_PAR_INTER_VALUE_TOO_SMALL
,
tsMinIntervalTime
,
return
generateSyntaxErrMsg
(
&
pCxt
->
msgBuf
,
TSDB_CODE_PAR_INTER_VALUE_TOO_SMALL
,
tsMinIntervalTime
,
getPrecisionStr
(
precision
));
getPrecisionStr
(
precision
));
...
@@ -3086,7 +3086,7 @@ static int32_t checkIntervalWindow(STranslateContext* pCxt, SIntervalWindowNode*
...
@@ -3086,7 +3086,7 @@ static int32_t checkIntervalWindow(STranslateContext* pCxt, SIntervalWindowNode*
if
(
pInter
->
unit
==
'n'
&&
pOffset
->
unit
==
'y'
)
{
if
(
pInter
->
unit
==
'n'
&&
pOffset
->
unit
==
'y'
)
{
return
generateSyntaxErrMsg
(
&
pCxt
->
msgBuf
,
TSDB_CODE_PAR_INTER_OFFSET_UNIT
);
return
generateSyntaxErrMsg
(
&
pCxt
->
msgBuf
,
TSDB_CODE_PAR_INTER_OFFSET_UNIT
);
}
}
bool
fixed
=
!
TIME_IS_VAR
_DURATION
(
pOffset
->
unit
)
&&
!
valInter
;
bool
fixed
=
!
IS_CALENDAR_TIME
_DURATION
(
pOffset
->
unit
)
&&
!
valInter
;
if
((
fixed
&&
pOffset
->
datum
.
i
>=
pInter
->
datum
.
i
)
||
if
((
fixed
&&
pOffset
->
datum
.
i
>=
pInter
->
datum
.
i
)
||
(
!
fixed
&&
getMonthsFromTimeVal
(
pOffset
->
datum
.
i
,
precision
,
pOffset
->
unit
)
>=
(
!
fixed
&&
getMonthsFromTimeVal
(
pOffset
->
datum
.
i
,
precision
,
pOffset
->
unit
)
>=
getMonthsFromTimeVal
(
pInter
->
datum
.
i
,
precision
,
pInter
->
unit
)))
{
getMonthsFromTimeVal
(
pInter
->
datum
.
i
,
precision
,
pInter
->
unit
)))
{
...
@@ -3098,7 +3098,7 @@ static int32_t checkIntervalWindow(STranslateContext* pCxt, SIntervalWindowNode*
...
@@ -3098,7 +3098,7 @@ static int32_t checkIntervalWindow(STranslateContext* pCxt, SIntervalWindowNode*
const
static
int32_t
INTERVAL_SLIDING_FACTOR
=
100
;
const
static
int32_t
INTERVAL_SLIDING_FACTOR
=
100
;
SValueNode
*
pSliding
=
(
SValueNode
*
)
pInterval
->
pSliding
;
SValueNode
*
pSliding
=
(
SValueNode
*
)
pInterval
->
pSliding
;
if
(
TIME_IS_VAR
_DURATION
(
pSliding
->
unit
))
{
if
(
IS_CALENDAR_TIME
_DURATION
(
pSliding
->
unit
))
{
return
generateSyntaxErrMsg
(
&
pCxt
->
msgBuf
,
TSDB_CODE_PAR_INTER_SLIDING_UNIT
);
return
generateSyntaxErrMsg
(
&
pCxt
->
msgBuf
,
TSDB_CODE_PAR_INTER_SLIDING_UNIT
);
}
}
if
((
pSliding
->
datum
.
i
<
convertTimePrecision
(
tsMinSlidingTime
,
TSDB_TIME_PRECISION_MILLI
,
precision
))
||
if
((
pSliding
->
datum
.
i
<
convertTimePrecision
(
tsMinSlidingTime
,
TSDB_TIME_PRECISION_MILLI
,
precision
))
||
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录