Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
43701df5
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看板
提交
43701df5
编写于
11月 04, 2020
作者:
P
Ping Xiao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add same test cases with update flag 0
上级
9c289dd7
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
399 addition
and
0 deletion
+399
-0
tests/pytest/update/append_commit_last-0.py
tests/pytest/update/append_commit_last-0.py
+90
-0
tests/pytest/update/merge_commit_last-0.py
tests/pytest/update/merge_commit_last-0.py
+309
-0
未找到文件。
tests/pytest/update/append_commit_last-0.py
0 → 100644
浏览文件 @
43701df5
###################################################################
# Copyright (c) 2016 by TAOS Technologies, Inc.
# All rights reserved.
#
# This file is proprietary and confidential to TAOS Technologies.
# No part of this file may be reproduced, stored, transmitted,
# disclosed or used in any form or by any means other than as
# expressly provided by the written permission from Jianhui Tao
#
###################################################################
# -*- coding: utf-8 -*-
import
sys
import
taos
from
util.log
import
*
from
util.cases
import
*
from
util.sql
import
*
from
util.dnodes
import
*
class
TDTestCase
:
def
init
(
self
,
conn
,
logSql
):
tdLog
.
debug
(
"start to execute %s"
%
__file__
)
tdSql
.
init
(
conn
.
cursor
())
self
.
ts
=
1604298064000
def
restartTaosd
(
self
):
tdDnodes
.
stop
(
1
)
tdDnodes
.
startWithoutSleep
(
1
)
tdSql
.
execute
(
"use db"
)
def
run
(
self
):
tdSql
.
prepare
()
print
(
"==============step1"
)
tdSql
.
execute
(
"create table t1 (ts timestamp, a int)"
)
for
i
in
range
(
10
):
tdSql
.
execute
(
"insert into t1 values(%d, 1)"
%
(
self
.
ts
+
i
))
self
.
restartTaosd
()
tdSql
.
query
(
"select * from t1"
)
tdSql
.
checkRows
(
i
+
1
)
tdSql
.
query
(
"select sum(a) from t1"
)
tdSql
.
checkData
(
0
,
0
,
i
+
1
)
print
(
"==============step2"
)
tdSql
.
execute
(
"create table t2 (ts timestamp, a int)"
)
tdSql
.
execute
(
"insert into t2 values(%d, 1)"
%
self
.
ts
)
self
.
restartTaosd
()
tdSql
.
query
(
"select * from t2"
)
tdSql
.
checkRows
(
1
)
tdSql
.
checkData
(
0
,
1
,
1
)
for
i
in
range
(
1
,
151
):
tdSql
.
execute
(
"insert into t2 values(%d, 1)"
%
(
self
.
ts
+
i
))
self
.
restartTaosd
()
tdSql
.
query
(
"select * from t2"
)
tdSql
.
checkRows
(
151
)
tdSql
.
query
(
"select sum(a) from t2"
)
tdSql
.
checkData
(
0
,
0
,
151
)
print
(
"==============step3"
)
tdSql
.
execute
(
"create table t3 (ts timestamp, a int)"
)
tdSql
.
execute
(
"insert into t3 values(%d, 1)"
%
self
.
ts
)
self
.
restartTaosd
()
tdSql
.
query
(
"select * from t3"
)
tdSql
.
checkRows
(
1
)
tdSql
.
checkData
(
0
,
1
,
1
)
for
i
in
range
(
8
):
for
j
in
range
(
1
,
11
):
tdSql
.
execute
(
"insert into t3 values(%d, 1)"
%
(
self
.
ts
+
i
*
10
+
j
))
self
.
restartTaosd
()
tdSql
.
query
(
"select * from t3"
)
tdSql
.
checkRows
(
81
)
tdSql
.
query
(
"select sum(a) from t3"
)
tdSql
.
checkData
(
0
,
0
,
81
)
def
stop
(
self
):
tdSql
.
close
()
tdLog
.
success
(
"%s successfully executed"
%
__file__
)
tdCases
.
addWindows
(
__file__
,
TDTestCase
())
tdCases
.
addLinux
(
__file__
,
TDTestCase
())
tests/pytest/update/merge_commit_last-0.py
0 → 100644
浏览文件 @
43701df5
###################################################################
# Copyright (c) 2016 by TAOS Technologies, Inc.
# All rights reserved.
#
# This file is proprietary and confidential to TAOS Technologies.
# No part of this file may be reproduced, stored, transmitted,
# disclosed or used in any form or by any means other than as
# expressly provided by the written permission from Jianhui Tao
#
###################################################################
# -*- coding: utf-8 -*-
import
sys
import
taos
from
util.log
import
*
from
util.cases
import
*
from
util.sql
import
*
from
util.dnodes
import
*
class
TDTestCase
:
def
init
(
self
,
conn
,
logSql
):
tdLog
.
debug
(
"start to execute %s"
%
__file__
)
tdSql
.
init
(
conn
.
cursor
())
self
.
ts
=
1603152000000
def
restartTaosd
(
self
):
tdDnodes
.
stop
(
1
)
tdDnodes
.
startWithoutSleep
(
1
)
tdSql
.
execute
(
"use db"
)
def
run
(
self
):
tdSql
.
prepare
()
print
(
"==============step 1: UPDATE THE LAST RECORD REPEATEDLY"
)
tdSql
.
execute
(
"create table t1 (ts timestamp, a int)"
)
for
i
in
range
(
5
):
tdSql
.
execute
(
"insert into t1 values(%d, %d)"
%
(
self
.
ts
,
i
))
self
.
restartTaosd
()
tdSql
.
query
(
"select * from t1"
)
tdSql
.
checkRows
(
1
)
tdSql
.
checkData
(
0
,
1
,
0
)
print
(
"==============step 2: UPDATE THE WHOLE LAST BLOCK"
)
tdSql
.
execute
(
"create table t2 (ts timestamp, a int)"
)
for
i
in
range
(
50
):
tdSql
.
execute
(
"insert into t2 values(%d, 1)"
%
(
self
.
ts
+
i
))
self
.
restartTaosd
()
tdSql
.
query
(
"select * from t2"
)
tdSql
.
checkRows
(
50
)
tdSql
.
query
(
"select sum(a) from t2"
)
tdSql
.
checkData
(
0
,
0
,
50
)
for
i
in
range
(
50
):
tdSql
.
execute
(
"insert into t2 values(%d, 2)"
%
(
self
.
ts
+
i
))
tdSql
.
query
(
"select * from t2"
)
tdSql
.
checkRows
(
50
)
tdSql
.
query
(
"select sum(a) from t2"
)
tdSql
.
checkData
(
0
,
0
,
50
)
self
.
restartTaosd
()
tdSql
.
query
(
"select * from t2"
)
tdSql
.
checkRows
(
50
)
tdSql
.
query
(
"select sum(a) from t2"
)
tdSql
.
checkData
(
0
,
0
,
50
)
print
(
"==============step 3: UPDATE PART OF THE LAST BLOCK"
)
tdSql
.
execute
(
"create table t3 (ts timestamp, a int)"
)
for
i
in
range
(
50
):
tdSql
.
execute
(
"insert into t3 values(%d, 1)"
%
(
self
.
ts
+
i
))
self
.
restartTaosd
()
tdSql
.
query
(
"select * from t3"
)
tdSql
.
checkRows
(
50
)
tdSql
.
query
(
"select sum(a) from t3"
)
tdSql
.
checkData
(
0
,
0
,
50
)
for
i
in
range
(
25
):
tdSql
.
execute
(
"insert into t3 values(%d, 2)"
%
(
self
.
ts
+
i
))
tdSql
.
query
(
"select * from t3"
)
tdSql
.
checkRows
(
50
)
tdSql
.
query
(
"select sum(a) from t3"
)
tdSql
.
checkData
(
0
,
0
,
50
)
self
.
restartTaosd
()
tdSql
.
query
(
"select * from t3"
)
tdSql
.
checkRows
(
50
)
tdSql
.
query
(
"select sum(a) from t3"
)
tdSql
.
checkData
(
0
,
0
,
50
)
print
(
"==============step 4: UPDATE AND INSERT APPEND AT END OF DATA"
)
tdSql
.
execute
(
"create table t4 (ts timestamp, a int)"
)
for
i
in
range
(
50
):
tdSql
.
execute
(
"insert into t4 values(%d, 1)"
%
(
self
.
ts
+
i
))
self
.
restartTaosd
()
tdSql
.
query
(
"select * from t4"
)
tdSql
.
checkRows
(
50
)
tdSql
.
query
(
"select sum(a) from t4"
)
tdSql
.
checkData
(
0
,
0
,
50
)
for
i
in
range
(
25
):
tdSql
.
execute
(
"insert into t4 values(%d, 2)"
%
(
self
.
ts
+
i
))
for
i
in
range
(
50
,
60
):
tdSql
.
execute
(
"insert into t4 values(%d, 2)"
%
(
self
.
ts
+
i
))
tdSql
.
query
(
"select * from t4"
)
tdSql
.
checkRows
(
60
)
tdSql
.
query
(
"select sum(a) from t4"
)
tdSql
.
checkData
(
0
,
0
,
70
)
self
.
restartTaosd
()
tdSql
.
query
(
"select * from t4"
)
tdSql
.
checkRows
(
60
)
tdSql
.
query
(
"select sum(a) from t4"
)
tdSql
.
checkData
(
0
,
0
,
70
)
print
(
"==============step 5: UPDATE AND INSERT PREPEND SOME DATA"
)
tdSql
.
execute
(
"create table t5 (ts timestamp, a int)"
)
for
i
in
range
(
50
):
tdSql
.
execute
(
"insert into t5 values(%d, 1)"
%
(
self
.
ts
+
i
))
self
.
restartTaosd
()
tdSql
.
query
(
"select * from t5"
)
tdSql
.
checkRows
(
50
)
tdSql
.
query
(
"select sum(a) from t5"
)
tdSql
.
checkData
(
0
,
0
,
50
)
for
i
in
range
(
-
10
,
0
):
tdSql
.
execute
(
"insert into t5 values(%d, 2)"
%
(
self
.
ts
+
i
))
for
i
in
range
(
25
):
tdSql
.
execute
(
"insert into t5 values(%d, 2)"
%
(
self
.
ts
+
i
))
tdSql
.
query
(
"select * from t5"
)
tdSql
.
checkRows
(
60
)
tdSql
.
query
(
"select sum(a) from t5"
)
tdSql
.
checkData
(
0
,
0
,
70
)
self
.
restartTaosd
()
tdSql
.
query
(
"select * from t5"
)
tdSql
.
checkRows
(
60
)
tdSql
.
query
(
"select sum(a) from t5"
)
tdSql
.
checkData
(
0
,
0
,
70
)
for
i
in
range
(
-
10
,
0
):
tdSql
.
execute
(
"insert into t5 values(%d, 3)"
%
(
self
.
ts
+
i
))
for
i
in
range
(
25
,
50
):
tdSql
.
execute
(
"insert into t5 values(%d, 3)"
%
(
self
.
ts
+
i
))
tdSql
.
query
(
"select * from t5"
)
tdSql
.
checkRows
(
60
)
tdSql
.
query
(
"select sum(a) from t5"
)
tdSql
.
checkData
(
0
,
0
,
70
)
self
.
restartTaosd
()
tdSql
.
query
(
"select * from t5"
)
tdSql
.
checkRows
(
60
)
tdSql
.
query
(
"select sum(a) from t5"
)
tdSql
.
checkData
(
0
,
0
,
70
)
print
(
"==============step 6: INSERT AHEAD A LOT OF DATA"
)
tdSql
.
execute
(
"create table t6 (ts timestamp, a int)"
)
for
i
in
range
(
50
):
tdSql
.
execute
(
"insert into t6 values(%d, 1)"
%
(
self
.
ts
+
i
))
self
.
restartTaosd
()
tdSql
.
query
(
"select * from t6"
)
tdSql
.
checkRows
(
50
)
tdSql
.
query
(
"select sum(a) from t6"
)
tdSql
.
checkData
(
0
,
0
,
50
)
for
i
in
range
(
-
1000
,
0
):
tdSql
.
execute
(
"insert into t6 values(%d, 2)"
%
(
self
.
ts
+
i
))
tdSql
.
query
(
"select * from t6"
)
tdSql
.
checkRows
(
1050
)
tdSql
.
query
(
"select sum(a) from t6"
)
tdSql
.
checkData
(
0
,
0
,
2050
)
self
.
restartTaosd
()
tdSql
.
query
(
"select * from t6"
)
tdSql
.
checkRows
(
1050
)
tdSql
.
query
(
"select sum(a) from t6"
)
tdSql
.
checkData
(
0
,
0
,
2050
)
print
(
"==============step 7: INSERT AHEAD A LOT AND UPDATE"
)
tdSql
.
execute
(
"create table t7 (ts timestamp, a int)"
)
for
i
in
range
(
50
):
tdSql
.
execute
(
"insert into t7 values(%d, 1)"
%
(
self
.
ts
+
i
))
self
.
restartTaosd
()
tdSql
.
query
(
"select * from t7"
)
tdSql
.
checkRows
(
50
)
tdSql
.
query
(
"select sum(a) from t7"
)
tdSql
.
checkData
(
0
,
0
,
50
)
for
i
in
range
(
-
1000
,
25
):
tdSql
.
execute
(
"insert into t7 values(%d, 2)"
%
(
self
.
ts
+
i
))
tdSql
.
query
(
"select * from t7"
)
tdSql
.
checkRows
(
1050
)
tdSql
.
query
(
"select sum(a) from t7"
)
tdSql
.
checkData
(
0
,
0
,
2050
)
self
.
restartTaosd
()
tdSql
.
query
(
"select * from t7"
)
tdSql
.
checkRows
(
1050
)
tdSql
.
query
(
"select sum(a) from t7"
)
tdSql
.
checkData
(
0
,
0
,
2050
)
print
(
"==============step 8: INSERT AFTER A LOT AND UPDATE"
)
tdSql
.
execute
(
"create table t8 (ts timestamp, a int)"
)
for
i
in
range
(
50
):
tdSql
.
execute
(
"insert into t8 values(%d, 1)"
%
(
self
.
ts
+
i
))
self
.
restartTaosd
()
tdSql
.
query
(
"select * from t8"
)
tdSql
.
checkRows
(
50
)
tdSql
.
query
(
"select sum(a) from t8"
)
tdSql
.
checkData
(
0
,
0
,
50
)
for
i
in
range
(
25
,
6000
):
tdSql
.
execute
(
"insert into t8 values(%d, 2)"
%
(
self
.
ts
+
i
))
tdSql
.
query
(
"select * from t8"
)
tdSql
.
checkRows
(
6000
)
tdSql
.
query
(
"select sum(a) from t8"
)
tdSql
.
checkData
(
0
,
0
,
11950
)
self
.
restartTaosd
()
tdSql
.
query
(
"select * from t8"
)
tdSql
.
checkRows
(
6000
)
tdSql
.
query
(
"select sum(a) from t8"
)
tdSql
.
checkData
(
0
,
0
,
11950
)
print
(
"==============step 9: UPDATE ONLY MIDDLE"
)
tdSql
.
execute
(
"create table t9 (ts timestamp, a int)"
)
for
i
in
range
(
50
):
tdSql
.
execute
(
"insert into t9 values(%d, 1)"
%
(
self
.
ts
+
i
))
self
.
restartTaosd
()
tdSql
.
query
(
"select * from t9"
)
tdSql
.
checkRows
(
50
)
tdSql
.
query
(
"select sum(a) from t9"
)
tdSql
.
checkData
(
0
,
0
,
50
)
for
i
in
range
(
20
,
30
):
tdSql
.
execute
(
"insert into t9 values(%d, 2)"
%
(
self
.
ts
+
i
))
tdSql
.
query
(
"select * from t9"
)
tdSql
.
checkRows
(
50
)
tdSql
.
query
(
"select sum(a) from t9"
)
tdSql
.
checkData
(
0
,
0
,
50
)
self
.
restartTaosd
()
tdSql
.
query
(
"select * from t9"
)
tdSql
.
checkRows
(
50
)
tdSql
.
query
(
"select sum(a) from t9"
)
tdSql
.
checkData
(
0
,
0
,
50
)
print
(
"==============step 10: A LOT OF DATA COVER THE WHOLE BLOCK"
)
tdSql
.
execute
(
"create table t10 (ts timestamp, a int)"
)
for
i
in
range
(
50
):
tdSql
.
execute
(
"insert into t10 values(%d, 1)"
%
(
self
.
ts
+
i
))
self
.
restartTaosd
()
tdSql
.
query
(
"select * from t10"
)
tdSql
.
checkRows
(
50
)
tdSql
.
query
(
"select sum(a) from t10"
)
tdSql
.
checkData
(
0
,
0
,
50
)
for
i
in
range
(
-
4000
,
4000
):
tdSql
.
execute
(
"insert into t10 values(%d, 2)"
%
(
self
.
ts
+
i
))
tdSql
.
query
(
"select * from t10"
)
tdSql
.
checkRows
(
8000
)
tdSql
.
query
(
"select sum(a) from t10"
)
tdSql
.
checkData
(
0
,
0
,
15950
)
self
.
restartTaosd
()
tdSql
.
query
(
"select * from t10"
)
tdSql
.
checkRows
(
8000
)
tdSql
.
query
(
"select sum(a) from t10"
)
tdSql
.
checkData
(
0
,
0
,
15950
)
def
stop
(
self
):
tdSql
.
close
()
tdLog
.
success
(
"%s successfully executed"
%
__file__
)
tdCases
.
addWindows
(
__file__
,
TDTestCase
())
tdCases
.
addLinux
(
__file__
,
TDTestCase
())
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录