Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
e58c470f
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看板
提交
e58c470f
编写于
12月 21, 2020
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'origin/develop' into feature/sim
上级
d162c417
f252cd68
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
35 addition
and
108 deletion
+35
-108
src/sync/src/syncMain.c
src/sync/src/syncMain.c
+3
-1
tests/pytest/fulltest.sh
tests/pytest/fulltest.sh
+1
-1
tests/pytest/functions/function_twa.py
tests/pytest/functions/function_twa.py
+10
-52
tests/pytest/functions/function_twa_restart.py
tests/pytest/functions/function_twa_restart.py
+17
-54
tests/pytest/functions/function_twa_test2.py
tests/pytest/functions/function_twa_test2.py
+4
-0
未找到文件。
src/sync/src/syncMain.c
浏览文件 @
e58c470f
...
...
@@ -1280,8 +1280,10 @@ static int32_t syncForwardToPeerImpl(SSyncNode *pNode, void *data, void *mhandle
}
}
if
(
pNode
->
replica
!=
1
)
{
return
TSDB_CODE_SYN_INVALID_VERSION
;
}
}
// always update version
sTrace
(
"vgId:%d, update version, replica:%d role:%s qtype:%s hver:%"
PRIu64
,
pNode
->
vgId
,
pNode
->
replica
,
...
...
tests/pytest/fulltest.sh
浏览文件 @
e58c470f
...
...
@@ -215,7 +215,7 @@ python3 ./test.py -f functions/function_spread.py -r 1
python3 ./test.py
-f
functions/function_stddev.py
-r
1
python3 ./test.py
-f
functions/function_sum.py
-r
1
python3 ./test.py
-f
functions/function_top.py
-r
1
#
python3 ./test.py -f functions/function_twa.py -r 1
python3 ./test.py
-f
functions/function_twa.py
-r
1
python3 ./test.py
-f
functions/function_twa_test2.py
python3 queryCount.py
python3 ./test.py
-f
query/queryGroupbyWithInterval.py
...
...
tests/pytest/functions/function_twa.py
浏览文件 @
e58c470f
...
...
@@ -47,22 +47,16 @@ class TDTestCase:
tdSql
.
error
(
"select twa(ts) from test1"
)
tdSql
.
error
(
"select twa(col1) from test"
)
tdSql
.
error
(
"select twa(col1) from test1"
)
tdSql
.
error
(
"select twa(col2) from test"
)
tdSql
.
error
(
"select twa(col2) from test1"
)
tdSql
.
error
(
"select twa(col3) from test"
)
tdSql
.
error
(
"select twa(col3) from test1"
)
tdSql
.
error
(
"select twa(col4) from test"
)
tdSql
.
error
(
"select twa(col4) from test1"
)
tdSql
.
error
(
"select twa(col5) from test"
)
tdSql
.
error
(
"select twa(col5) from test1"
)
tdSql
.
error
(
"select twa(col6) from test"
)
tdSql
.
error
(
"select twa(col6) from test1"
)
tdSql
.
error
(
"select twa(col7) from test"
)
tdSql
.
error
(
"select twa(col7) from test1"
)
...
...
@@ -73,58 +67,22 @@ class TDTestCase:
tdSql
.
error
(
"select twa(col9) from test"
)
tdSql
.
error
(
"select twa(col9) from test1"
)
tdSql
.
error
(
"select twa(col1) from test where ts > %d"
%
self
.
ts
)
tdSql
.
error
(
"select twa(col1) from test1 where ts > %d"
%
self
.
ts
)
tdSql
.
error
(
"select twa(col2) from test where ts > %d"
%
self
.
ts
)
tdSql
.
error
(
"select twa(col2) from test1 where ts > %d"
%
self
.
ts
)
tdSql
.
error
(
"select twa(col3) from test where ts > %d"
%
self
.
ts
)
tdSql
.
error
(
"select twa(col3) from test1 where ts > %d"
%
self
.
ts
)
tdSql
.
error
(
"select twa(col4) from test where ts > %d"
%
self
.
ts
)
tdSql
.
error
(
"select twa(col4) from test1 where ts > %d"
%
self
.
ts
)
tdSql
.
error
(
"select twa(col5) from test where ts > %d"
%
self
.
ts
)
tdSql
.
error
(
"select twa(col5) from test1 where ts > %d"
%
self
.
ts
)
tdSql
.
error
(
"select twa(col6) from test where ts > %d"
%
self
.
ts
)
tdSql
.
error
(
"select twa(col6) from test1 where ts > %d"
%
self
.
ts
)
tdSql
.
error
(
"select twa(col1) from test where ts < %d"
%
(
self
.
ts
+
self
.
rowNum
))
tdSql
.
error
(
"select twa(col1) from test1 where ts < %d"
%
(
self
.
ts
+
self
.
rowNum
))
tdSql
.
error
(
"select twa(col2) from test where ts < %d"
%
(
self
.
ts
+
self
.
rowNum
))
tdSql
.
error
(
"select twa(col2) from test1 where ts < %d"
%
(
self
.
ts
+
self
.
rowNum
))
tdSql
.
error
(
"select twa(col3) from test where ts < %d"
%
(
self
.
ts
+
self
.
rowNum
))
tdSql
.
error
(
"select twa(col3) from test1 where ts < %d"
%
(
self
.
ts
+
self
.
rowNum
))
tdSql
.
error
(
"select twa(col4) from test where ts < %d"
%
(
self
.
ts
+
self
.
rowNum
))
tdSql
.
error
(
"select twa(col4) from test1 where ts < %d"
%
(
self
.
ts
+
self
.
rowNum
))
tdSql
.
error
(
"select twa(col5) from test where ts < %d"
%
(
self
.
ts
+
self
.
rowNum
))
tdSql
.
error
(
"select twa(col5) from test1 where ts < %d"
%
(
self
.
ts
+
self
.
rowNum
))
tdSql
.
error
(
"select twa(col6) from test where ts < %d"
%
(
self
.
ts
+
self
.
rowNum
))
tdSql
.
error
(
"select twa(col6) from test1 where ts < %d"
%
(
self
.
ts
+
self
.
rowNum
))
tdSql
.
query
(
"select twa(col1) from test where ts > %d and ts < %d"
%
(
self
.
ts
,
self
.
ts
+
self
.
rowNum
))
tdSql
.
error
(
"select twa(col1) from test where ts > %d and ts < %d"
%
(
self
.
ts
,
self
.
ts
+
self
.
rowNum
))
tdSql
.
query
(
"select twa(col1) from test1 where ts > %d and ts < %d"
%
(
self
.
ts
,
self
.
ts
+
self
.
rowNum
))
tdSql
.
query
(
"select twa(col2) from test where ts > %d and ts < %d"
%
(
self
.
ts
,
self
.
ts
+
self
.
rowNum
))
tdSql
.
error
(
"select twa(col2) from test where ts > %d and ts < %d"
%
(
self
.
ts
,
self
.
ts
+
self
.
rowNum
))
tdSql
.
query
(
"select twa(col2) from test1 where ts > %d and ts < %d"
%
(
self
.
ts
,
self
.
ts
+
self
.
rowNum
))
tdSql
.
query
(
"select twa(col3) from test where ts > %d and ts < %d"
%
(
self
.
ts
,
self
.
ts
+
self
.
rowNum
))
tdSql
.
error
(
"select twa(col3) from test where ts > %d and ts < %d"
%
(
self
.
ts
,
self
.
ts
+
self
.
rowNum
))
tdSql
.
query
(
"select twa(col3) from test1 where ts > %d and ts < %d"
%
(
self
.
ts
,
self
.
ts
+
self
.
rowNum
))
tdSql
.
query
(
"select twa(col4) from test where ts > %d and ts < %d"
%
(
self
.
ts
,
self
.
ts
+
self
.
rowNum
))
tdSql
.
error
(
"select twa(col4) from test where ts > %d and ts < %d"
%
(
self
.
ts
,
self
.
ts
+
self
.
rowNum
))
tdSql
.
query
(
"select twa(col4) from test1 where ts > %d and ts < %d"
%
(
self
.
ts
,
self
.
ts
+
self
.
rowNum
))
tdSql
.
query
(
"select twa(col5) from test where ts > %d and ts < %d"
%
(
self
.
ts
,
self
.
ts
+
self
.
rowNum
))
tdSql
.
error
(
"select twa(col5) from test where ts > %d and ts < %d"
%
(
self
.
ts
,
self
.
ts
+
self
.
rowNum
))
tdSql
.
query
(
"select twa(col5) from test1 where ts > %d and ts < %d"
%
(
self
.
ts
,
self
.
ts
+
self
.
rowNum
))
tdSql
.
query
(
"select twa(col6) from test where ts > %d and ts < %d"
%
(
self
.
ts
,
self
.
ts
+
self
.
rowNum
))
tdSql
.
error
(
"select twa(col6) from test where ts > %d and ts < %d"
%
(
self
.
ts
,
self
.
ts
+
self
.
rowNum
))
tdSql
.
query
(
"select twa(col6) from test1 where ts > %d and ts < %d"
%
(
self
.
ts
,
self
.
ts
+
self
.
rowNum
))
def
stop
(
self
):
...
...
tests/pytest/functions/function_twa_restart.py
浏览文件 @
e58c470f
...
...
@@ -28,12 +28,17 @@ class TDTestCase:
self
.
ts
=
1537146000000
def
run
(
self
):
tdSql
.
execute
(
"use db"
)
tdSql
.
prepare
(
)
intData
=
[]
floatData
=
[]
tdSql
.
execute
(
'''create table test(ts timestamp, col1 tinyint, col2 smallint, col3 int, col4 bigint, col5 float, col6 double,
col7 bool, col8 binary(20), col9 nchar(20)) tags(loc nchar(20))'''
)
tdSql
.
execute
(
"create table test1 using test tags('beijing')"
)
for
i
in
range
(
self
.
rowNum
):
tdSql
.
execute
(
"insert into test1 values(%d, %d, %d, %d, %d, %f, %f, %d, 'taosdata%d', '涛思数据%d')"
%
(
self
.
ts
+
i
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
0.1
,
i
+
0.1
,
i
%
2
,
i
+
1
,
i
+
1
))
intData
.
append
(
i
+
1
)
floatData
.
append
(
i
+
0.1
)
...
...
@@ -42,22 +47,16 @@ class TDTestCase:
tdSql
.
error
(
"select twa(ts) from test1"
)
tdSql
.
error
(
"select twa(col1) from test"
)
tdSql
.
error
(
"select twa(col1) from test1"
)
tdSql
.
error
(
"select twa(col2) from test"
)
tdSql
.
error
(
"select twa(col2) from test1"
)
tdSql
.
error
(
"select twa(col3) from test"
)
tdSql
.
error
(
"select twa(col3) from test1"
)
tdSql
.
error
(
"select twa(col4) from test"
)
tdSql
.
error
(
"select twa(col4) from test1"
)
tdSql
.
error
(
"select twa(col5) from test"
)
tdSql
.
error
(
"select twa(col5) from test1"
)
tdSql
.
error
(
"select twa(col6) from test"
)
tdSql
.
error
(
"select twa(col6) from test1"
)
tdSql
.
error
(
"select twa(col7) from test"
)
tdSql
.
error
(
"select twa(col7) from test1"
)
...
...
@@ -68,58 +67,22 @@ class TDTestCase:
tdSql
.
error
(
"select twa(col9) from test"
)
tdSql
.
error
(
"select twa(col9) from test1"
)
tdSql
.
error
(
"select twa(col1) from test where ts > %d"
%
self
.
ts
)
tdSql
.
error
(
"select twa(col1) from test1 where ts > %d"
%
self
.
ts
)
tdSql
.
error
(
"select twa(col2) from test where ts > %d"
%
self
.
ts
)
tdSql
.
error
(
"select twa(col2) from test1 where ts > %d"
%
self
.
ts
)
tdSql
.
error
(
"select twa(col3) from test where ts > %d"
%
self
.
ts
)
tdSql
.
error
(
"select twa(col3) from test1 where ts > %d"
%
self
.
ts
)
tdSql
.
error
(
"select twa(col4) from test where ts > %d"
%
self
.
ts
)
tdSql
.
error
(
"select twa(col4) from test1 where ts > %d"
%
self
.
ts
)
tdSql
.
error
(
"select twa(col5) from test where ts > %d"
%
self
.
ts
)
tdSql
.
error
(
"select twa(col5) from test1 where ts > %d"
%
self
.
ts
)
tdSql
.
error
(
"select twa(col6) from test where ts > %d"
%
self
.
ts
)
tdSql
.
error
(
"select twa(col6) from test1 where ts > %d"
%
self
.
ts
)
tdSql
.
error
(
"select twa(col1) from test where ts < %d"
%
(
self
.
ts
+
self
.
rowNum
))
tdSql
.
error
(
"select twa(col1) from test1 where ts < %d"
%
(
self
.
ts
+
self
.
rowNum
))
tdSql
.
error
(
"select twa(col2) from test where ts < %d"
%
(
self
.
ts
+
self
.
rowNum
))
tdSql
.
error
(
"select twa(col2) from test1 where ts < %d"
%
(
self
.
ts
+
self
.
rowNum
))
tdSql
.
error
(
"select twa(col3) from test where ts < %d"
%
(
self
.
ts
+
self
.
rowNum
))
tdSql
.
error
(
"select twa(col3) from test1 where ts < %d"
%
(
self
.
ts
+
self
.
rowNum
))
tdSql
.
error
(
"select twa(col4) from test where ts < %d"
%
(
self
.
ts
+
self
.
rowNum
))
tdSql
.
error
(
"select twa(col4) from test1 where ts < %d"
%
(
self
.
ts
+
self
.
rowNum
))
tdSql
.
error
(
"select twa(col5) from test where ts < %d"
%
(
self
.
ts
+
self
.
rowNum
))
tdSql
.
error
(
"select twa(col5) from test1 where ts < %d"
%
(
self
.
ts
+
self
.
rowNum
))
tdSql
.
error
(
"select twa(col6) from test where ts < %d"
%
(
self
.
ts
+
self
.
rowNum
))
tdSql
.
error
(
"select twa(col6) from test1 where ts < %d"
%
(
self
.
ts
+
self
.
rowNum
))
tdSql
.
query
(
"select twa(col1) from test where ts > %d and ts < %d"
%
(
self
.
ts
,
self
.
ts
+
self
.
rowNum
))
tdSql
.
error
(
"select twa(col1) from test where ts > %d and ts < %d"
%
(
self
.
ts
,
self
.
ts
+
self
.
rowNum
))
tdSql
.
query
(
"select twa(col1) from test1 where ts > %d and ts < %d"
%
(
self
.
ts
,
self
.
ts
+
self
.
rowNum
))
tdSql
.
query
(
"select twa(col2) from test where ts > %d and ts < %d"
%
(
self
.
ts
,
self
.
ts
+
self
.
rowNum
))
tdSql
.
error
(
"select twa(col2) from test where ts > %d and ts < %d"
%
(
self
.
ts
,
self
.
ts
+
self
.
rowNum
))
tdSql
.
query
(
"select twa(col2) from test1 where ts > %d and ts < %d"
%
(
self
.
ts
,
self
.
ts
+
self
.
rowNum
))
tdSql
.
query
(
"select twa(col3) from test where ts > %d and ts < %d"
%
(
self
.
ts
,
self
.
ts
+
self
.
rowNum
))
tdSql
.
error
(
"select twa(col3) from test where ts > %d and ts < %d"
%
(
self
.
ts
,
self
.
ts
+
self
.
rowNum
))
tdSql
.
query
(
"select twa(col3) from test1 where ts > %d and ts < %d"
%
(
self
.
ts
,
self
.
ts
+
self
.
rowNum
))
tdSql
.
query
(
"select twa(col4) from test where ts > %d and ts < %d"
%
(
self
.
ts
,
self
.
ts
+
self
.
rowNum
))
tdSql
.
error
(
"select twa(col4) from test where ts > %d and ts < %d"
%
(
self
.
ts
,
self
.
ts
+
self
.
rowNum
))
tdSql
.
query
(
"select twa(col4) from test1 where ts > %d and ts < %d"
%
(
self
.
ts
,
self
.
ts
+
self
.
rowNum
))
tdSql
.
query
(
"select twa(col5) from test where ts > %d and ts < %d"
%
(
self
.
ts
,
self
.
ts
+
self
.
rowNum
))
tdSql
.
error
(
"select twa(col5) from test where ts > %d and ts < %d"
%
(
self
.
ts
,
self
.
ts
+
self
.
rowNum
))
tdSql
.
query
(
"select twa(col5) from test1 where ts > %d and ts < %d"
%
(
self
.
ts
,
self
.
ts
+
self
.
rowNum
))
tdSql
.
query
(
"select twa(col6) from test where ts > %d and ts < %d"
%
(
self
.
ts
,
self
.
ts
+
self
.
rowNum
))
tdSql
.
error
(
"select twa(col6) from test where ts > %d and ts < %d"
%
(
self
.
ts
,
self
.
ts
+
self
.
rowNum
))
tdSql
.
query
(
"select twa(col6) from test1 where ts > %d and ts < %d"
%
(
self
.
ts
,
self
.
ts
+
self
.
rowNum
))
def
stop
(
self
):
...
...
tests/pytest/functions/function_twa_test2.py
浏览文件 @
e58c470f
...
...
@@ -39,6 +39,10 @@ class TDTestCase:
tdSql
.
checkRows
(
1
)
tdSql
.
checkData
(
0
,
0
,
5.5
)
tdSql
.
query
(
"select twa(c) from t1"
)
tdSql
.
checkRows
(
1
)
tdSql
.
checkData
(
0
,
0
,
5.5
)
tdSql
.
query
(
"select twa(c) from t1 where ts >= '2018-09-17 09:00:00.000' and ts <= '2018-09-17 09:01:30.000' interval(10s)"
)
tdSql
.
checkRows
(
10
)
tdSql
.
checkData
(
0
,
1
,
1.49995
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录