Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
ee5e9a71
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看板
提交
ee5e9a71
编写于
1月 19, 2021
作者:
D
dapan1121
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
query interval with client tz
上级
eaaa2514
变更
9
显示空白变更内容
内联
并排
Showing
9 changed file
with
25 addition
and
9 deletion
+25
-9
src/client/src/tscLocalMerge.c
src/client/src/tscLocalMerge.c
+1
-1
src/client/src/tscSQLParser.c
src/client/src/tscSQLParser.c
+2
-0
src/client/src/tscServer.c
src/client/src/tscServer.c
+1
-0
src/client/src/tscSubquery.c
src/client/src/tscSubquery.c
+2
-2
src/os/inc/osTime.h
src/os/inc/osTime.h
+1
-1
src/os/src/detail/osTime.c
src/os/src/detail/osTime.c
+12
-2
src/query/inc/qFill.h
src/query/inc/qFill.h
+1
-1
src/query/src/qExecutor.c
src/query/src/qExecutor.c
+2
-1
src/query/src/qFill.c
src/query/src/qFill.c
+3
-1
未找到文件。
src/client/src/tscLocalMerge.c
浏览文件 @
ee5e9a71
...
@@ -385,7 +385,7 @@ void tscCreateLocalReducer(tExtMemBuffer **pMemBuffer, int32_t numOfBuffer, tOrd
...
@@ -385,7 +385,7 @@ void tscCreateLocalReducer(tExtMemBuffer **pMemBuffer, int32_t numOfBuffer, tOrd
SFillColInfo
*
pFillCol
=
createFillColInfo
(
pQueryInfo
);
SFillColInfo
*
pFillCol
=
createFillColInfo
(
pQueryInfo
);
pReducer
->
pFillInfo
=
taosInitFillInfo
(
pQueryInfo
->
order
.
order
,
revisedSTime
,
pQueryInfo
->
groupbyExpr
.
numOfGroupCols
,
pReducer
->
pFillInfo
=
taosInitFillInfo
(
pQueryInfo
->
order
.
order
,
revisedSTime
,
pQueryInfo
->
groupbyExpr
.
numOfGroupCols
,
4096
,
(
int32_t
)
pQueryInfo
->
fieldsInfo
.
numOfOutput
,
pQueryInfo
->
interval
.
sliding
,
pQueryInfo
->
interval
.
slidingUnit
,
4096
,
(
int32_t
)
pQueryInfo
->
fieldsInfo
.
numOfOutput
,
pQueryInfo
->
interval
.
sliding
,
pQueryInfo
->
interval
.
slidingUnit
,
tinfo
.
precision
,
pQueryInfo
->
fillType
,
pFillCol
,
pSql
);
tinfo
.
precision
,
pQueryInfo
->
fillType
,
pFillCol
,
pSql
,
timezone
);
}
}
}
}
...
...
src/client/src/tscSQLParser.c
浏览文件 @
ee5e9a71
...
@@ -776,6 +776,8 @@ int32_t parseIntervalClause(SSqlObj* pSql, SQueryInfo* pQueryInfo, SQuerySQL* pQ
...
@@ -776,6 +776,8 @@ int32_t parseIntervalClause(SSqlObj* pSql, SQueryInfo* pQueryInfo, SQuerySQL* pQ
return
TSDB_CODE_TSC_INVALID_SQL
;
return
TSDB_CODE_TSC_INVALID_SQL
;
}
}
pQueryInfo
->
interval
.
tz
=
timezone
;
return
TSDB_CODE_SUCCESS
;
return
TSDB_CODE_SUCCESS
;
}
}
...
...
src/client/src/tscServer.c
浏览文件 @
ee5e9a71
...
@@ -728,6 +728,7 @@ int tscBuildQueryMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
...
@@ -728,6 +728,7 @@ int tscBuildQueryMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
pQueryMsg
->
limit
=
htobe64
(
pQueryInfo
->
limit
.
limit
);
pQueryMsg
->
limit
=
htobe64
(
pQueryInfo
->
limit
.
limit
);
pQueryMsg
->
offset
=
htobe64
(
pQueryInfo
->
limit
.
offset
);
pQueryMsg
->
offset
=
htobe64
(
pQueryInfo
->
limit
.
offset
);
pQueryMsg
->
numOfCols
=
htons
((
int16_t
)
taosArrayGetSize
(
pQueryInfo
->
colList
));
pQueryMsg
->
numOfCols
=
htons
((
int16_t
)
taosArrayGetSize
(
pQueryInfo
->
colList
));
pQueryMsg
->
interval
.
tz
=
htobe64
(
timezone
);
pQueryMsg
->
interval
.
interval
=
htobe64
(
pQueryInfo
->
interval
.
interval
);
pQueryMsg
->
interval
.
interval
=
htobe64
(
pQueryInfo
->
interval
.
interval
);
pQueryMsg
->
interval
.
sliding
=
htobe64
(
pQueryInfo
->
interval
.
sliding
);
pQueryMsg
->
interval
.
sliding
=
htobe64
(
pQueryInfo
->
interval
.
sliding
);
pQueryMsg
->
interval
.
offset
=
htobe64
(
pQueryInfo
->
interval
.
offset
);
pQueryMsg
->
interval
.
offset
=
htobe64
(
pQueryInfo
->
interval
.
offset
);
...
...
src/client/src/tscSubquery.c
浏览文件 @
ee5e9a71
...
@@ -2292,8 +2292,8 @@ static void multiVnodeInsertFinalize(void* param, TAOS_RES* tres, int numOfRows)
...
@@ -2292,8 +2292,8 @@ static void multiVnodeInsertFinalize(void* param, TAOS_RES* tres, int numOfRows)
}
}
}
}
tscError
(
"%p Async insertion completed, total inserted:%d rows, numOfFailed:%d, numOfTotal:%d"
,
pParentObj
,
tscError
(
"%p Async insertion completed, total inserted:%d rows, numOfFailed:%d, numOfTotal:%d
, code:%d
"
,
pParentObj
,
pParentObj
->
res
.
numOfRows
,
numOfFailed
,
numOfSub
);
pParentObj
->
res
.
numOfRows
,
numOfFailed
,
numOfSub
,
pParentObj
->
res
.
code
);
tscDebug
(
"%p cleanup %d tableMeta in hashTable"
,
pParentObj
,
pParentObj
->
cmd
.
numOfTables
);
tscDebug
(
"%p cleanup %d tableMeta in hashTable"
,
pParentObj
,
pParentObj
->
cmd
.
numOfTables
);
for
(
int32_t
i
=
0
;
i
<
pParentObj
->
cmd
.
numOfTables
;
++
i
)
{
for
(
int32_t
i
=
0
;
i
<
pParentObj
->
cmd
.
numOfTables
;
++
i
)
{
...
...
src/os/inc/osTime.h
浏览文件 @
ee5e9a71
...
@@ -63,7 +63,7 @@ static FORCE_INLINE int64_t taosGetTimestamp(int32_t precision) {
...
@@ -63,7 +63,7 @@ static FORCE_INLINE int64_t taosGetTimestamp(int32_t precision) {
typedef
struct
SInterval
{
typedef
struct
SInterval
{
int
32
_t
tz
;
// query client timezone
int
64
_t
tz
;
// query client timezone
char
intervalUnit
;
char
intervalUnit
;
char
slidingUnit
;
char
slidingUnit
;
char
offsetUnit
;
char
offsetUnit
;
...
...
src/os/src/detail/osTime.c
浏览文件 @
ee5e9a71
...
@@ -479,6 +479,15 @@ int64_t taosTimeTruncate(int64_t t, const SInterval* pInterval, int32_t precisio
...
@@ -479,6 +479,15 @@ int64_t taosTimeTruncate(int64_t t, const SInterval* pInterval, int32_t precisio
}
}
start
=
(
int64_t
)(
mktime
(
&
tm
)
*
TSDB_TICK_PER_SECOND
(
precision
));
start
=
(
int64_t
)(
mktime
(
&
tm
)
*
TSDB_TICK_PER_SECOND
(
precision
));
#if defined(WINDOWS) && _MSC_VER >= 1900
// see https://docs.microsoft.com/en-us/cpp/c-runtime-library/daylight-dstbias-timezone-and-tzname?view=vs-2019
int64_t
timezone
=
_timezone
;
int32_t
daylight
=
_daylight
;
char
**
tzname
=
_tzname
;
#endif
assert
(
pInterval
->
tz
%
3600
==
0
);
start
-=
(
timezone
-
pInterval
->
tz
)
*
TSDB_TICK_PER_SECOND
(
precision
);
}
else
{
}
else
{
int64_t
delta
=
t
-
pInterval
->
interval
;
int64_t
delta
=
t
-
pInterval
->
interval
;
int32_t
factor
=
(
delta
>=
0
)
?
1
:
-
1
;
int32_t
factor
=
(
delta
>=
0
)
?
1
:
-
1
;
...
@@ -497,8 +506,9 @@ int64_t taosTimeTruncate(int64_t t, const SInterval* pInterval, int32_t precisio
...
@@ -497,8 +506,9 @@ int64_t taosTimeTruncate(int64_t t, const SInterval* pInterval, int32_t precisio
int32_t
daylight
=
_daylight
;
int32_t
daylight
=
_daylight
;
char
**
tzname
=
_tzname
;
char
**
tzname
=
_tzname
;
#endif
#endif
assert
(
pInterval
->
tz
%
3600
==
0
);
start
+=
(
int64_t
)(
timezone
*
TSDB_TICK_PER_SECOND
(
precision
));
start
+=
(
int64_t
)(
pInterval
->
tz
*
TSDB_TICK_PER_SECOND
(
precision
));
}
}
int64_t
end
=
0
;
int64_t
end
=
0
;
...
...
src/query/inc/qFill.h
浏览文件 @
ee5e9a71
...
@@ -70,7 +70,7 @@ typedef struct SPoint {
...
@@ -70,7 +70,7 @@ typedef struct SPoint {
SFillInfo
*
taosInitFillInfo
(
int32_t
order
,
TSKEY
skey
,
int32_t
numOfTags
,
int32_t
capacity
,
int32_t
numOfCols
,
SFillInfo
*
taosInitFillInfo
(
int32_t
order
,
TSKEY
skey
,
int32_t
numOfTags
,
int32_t
capacity
,
int32_t
numOfCols
,
int64_t
slidingTime
,
int8_t
slidingUnit
,
int8_t
precision
,
int32_t
fillType
,
int64_t
slidingTime
,
int8_t
slidingUnit
,
int8_t
precision
,
int32_t
fillType
,
SFillColInfo
*
pFillCol
,
void
*
handle
);
SFillColInfo
*
pFillCol
,
void
*
handle
,
int64_t
tz
);
void
taosResetFillInfo
(
SFillInfo
*
pFillInfo
,
TSKEY
startTimestamp
);
void
taosResetFillInfo
(
SFillInfo
*
pFillInfo
,
TSKEY
startTimestamp
);
...
...
src/query/src/qExecutor.c
浏览文件 @
ee5e9a71
...
@@ -4761,7 +4761,7 @@ int32_t doInitQInfo(SQInfo *pQInfo, STSBuf *pTsBuf, void *tsdb, int32_t vgId, bo
...
@@ -4761,7 +4761,7 @@ int32_t doInitQInfo(SQInfo *pQInfo, STSBuf *pTsBuf, void *tsdb, int32_t vgId, bo
int32_t
numOfCols
=
getNumOfFinalResCol
(
pQuery
);
int32_t
numOfCols
=
getNumOfFinalResCol
(
pQuery
);
pRuntimeEnv
->
pFillInfo
=
taosInitFillInfo
(
pQuery
->
order
.
order
,
w
.
skey
,
0
,
(
int32_t
)
pQuery
->
rec
.
capacity
,
numOfCols
,
pRuntimeEnv
->
pFillInfo
=
taosInitFillInfo
(
pQuery
->
order
.
order
,
w
.
skey
,
0
,
(
int32_t
)
pQuery
->
rec
.
capacity
,
numOfCols
,
pQuery
->
interval
.
sliding
,
pQuery
->
interval
.
slidingUnit
,
(
int8_t
)
pQuery
->
precision
,
pQuery
->
interval
.
sliding
,
pQuery
->
interval
.
slidingUnit
,
(
int8_t
)
pQuery
->
precision
,
pQuery
->
fillType
,
pColInfo
,
pQInfo
);
pQuery
->
fillType
,
pColInfo
,
pQInfo
,
pQuery
->
interval
.
tz
);
}
}
setQueryStatus
(
pQuery
,
QUERY_NOT_COMPLETED
);
setQueryStatus
(
pQuery
,
QUERY_NOT_COMPLETED
);
...
@@ -5987,6 +5987,7 @@ static int32_t convertQueryMsg(SQueryTableMsg *pQueryMsg, SArray **pTableIdList,
...
@@ -5987,6 +5987,7 @@ static int32_t convertQueryMsg(SQueryTableMsg *pQueryMsg, SArray **pTableIdList,
pQueryMsg
->
window
.
skey
=
htobe64
(
pQueryMsg
->
window
.
skey
);
pQueryMsg
->
window
.
skey
=
htobe64
(
pQueryMsg
->
window
.
skey
);
pQueryMsg
->
window
.
ekey
=
htobe64
(
pQueryMsg
->
window
.
ekey
);
pQueryMsg
->
window
.
ekey
=
htobe64
(
pQueryMsg
->
window
.
ekey
);
pQueryMsg
->
interval
.
tz
=
htobe64
(
pQueryMsg
->
interval
.
tz
);
pQueryMsg
->
interval
.
interval
=
htobe64
(
pQueryMsg
->
interval
.
interval
);
pQueryMsg
->
interval
.
interval
=
htobe64
(
pQueryMsg
->
interval
.
interval
);
pQueryMsg
->
interval
.
sliding
=
htobe64
(
pQueryMsg
->
interval
.
sliding
);
pQueryMsg
->
interval
.
sliding
=
htobe64
(
pQueryMsg
->
interval
.
sliding
);
pQueryMsg
->
interval
.
offset
=
htobe64
(
pQueryMsg
->
interval
.
offset
);
pQueryMsg
->
interval
.
offset
=
htobe64
(
pQueryMsg
->
interval
.
offset
);
...
...
src/query/src/qFill.c
浏览文件 @
ee5e9a71
...
@@ -323,7 +323,7 @@ static int32_t taosNumOfRemainRows(SFillInfo* pFillInfo) {
...
@@ -323,7 +323,7 @@ static int32_t taosNumOfRemainRows(SFillInfo* pFillInfo) {
SFillInfo
*
taosInitFillInfo
(
int32_t
order
,
TSKEY
skey
,
int32_t
numOfTags
,
int32_t
capacity
,
int32_t
numOfCols
,
SFillInfo
*
taosInitFillInfo
(
int32_t
order
,
TSKEY
skey
,
int32_t
numOfTags
,
int32_t
capacity
,
int32_t
numOfCols
,
int64_t
slidingTime
,
int8_t
slidingUnit
,
int8_t
precision
,
int32_t
fillType
,
int64_t
slidingTime
,
int8_t
slidingUnit
,
int8_t
precision
,
int32_t
fillType
,
SFillColInfo
*
pCol
,
void
*
handle
)
{
SFillColInfo
*
pCol
,
void
*
handle
,
int64_t
tz
)
{
if
(
fillType
==
TSDB_FILL_NONE
)
{
if
(
fillType
==
TSDB_FILL_NONE
)
{
return
NULL
;
return
NULL
;
}
}
...
@@ -345,6 +345,8 @@ SFillInfo* taosInitFillInfo(int32_t order, TSKEY skey, int32_t numOfTags, int32_
...
@@ -345,6 +345,8 @@ SFillInfo* taosInitFillInfo(int32_t order, TSKEY skey, int32_t numOfTags, int32_
pFillInfo
->
interval
.
sliding
=
slidingTime
;
pFillInfo
->
interval
.
sliding
=
slidingTime
;
pFillInfo
->
interval
.
slidingUnit
=
slidingUnit
;
pFillInfo
->
interval
.
slidingUnit
=
slidingUnit
;
pFillInfo
->
interval
.
tz
=
tz
;
pFillInfo
->
pData
=
malloc
(
POINTER_BYTES
*
numOfCols
);
pFillInfo
->
pData
=
malloc
(
POINTER_BYTES
*
numOfCols
);
if
(
numOfTags
>
0
)
{
if
(
numOfTags
>
0
)
{
pFillInfo
->
pTags
=
calloc
(
pFillInfo
->
numOfTags
,
sizeof
(
SFillTagColInfo
));
pFillInfo
->
pTags
=
calloc
(
pFillInfo
->
numOfTags
,
sizeof
(
SFillTagColInfo
));
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录