Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
19883fde
T
TDengine
项目概览
taosdata
/
TDengine
12 个月 前同步成功
通知
1180
Star
22014
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
19883fde
编写于
3月 24, 2023
作者:
B
Benguang Zhao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat: alter database before creating topic in tests
上级
ffc3b7b2
变更
101
隐藏空白更改
内联
并排
Showing
101 changed file
with
271 addition
and
92 deletion
+271
-92
docs/examples/c/tmq_example.c
docs/examples/c/tmq_example.c
+1
-1
docs/examples/csharp/optsJSON/Program.cs
docs/examples/csharp/optsJSON/Program.cs
+1
-1
docs/examples/go/sub/main.go
docs/examples/go/sub/main.go
+1
-1
docs/examples/java/src/main/java/com/taos/example/SubscribeDemo.java
...es/java/src/main/java/com/taos/example/SubscribeDemo.java
+1
-1
docs/examples/java/src/main/java/com/taos/example/WebsocketSubscribeDemo.java
...rc/main/java/com/taos/example/WebsocketSubscribeDemo.java
+1
-1
docs/examples/python/conn_websocket_pandas.py
docs/examples/python/conn_websocket_pandas.py
+1
-1
docs/examples/python/connect_websocket_examples.py
docs/examples/python/connect_websocket_examples.py
+1
-1
docs/examples/python/kafka_example_common.py
docs/examples/python/kafka_example_common.py
+1
-1
docs/examples/python/tmq_example.py
docs/examples/python/tmq_example.py
+1
-1
tests/docs-examples-test/python.sh
tests/docs-examples-test/python.sh
+1
-1
tests/script/tsim/tmq/basic1.sim
tests/script/tsim/tmq/basic1.sim
+12
-0
tests/script/tsim/tmq/basic1Of2Cons.sim
tests/script/tsim/tmq/basic1Of2Cons.sim
+12
-0
tests/script/tsim/tmq/basic2.sim
tests/script/tsim/tmq/basic2.sim
+9
-0
tests/script/tsim/tmq/basic2Of2Cons.sim
tests/script/tsim/tmq/basic2Of2Cons.sim
+9
-0
tests/script/tsim/tmq/basic2Of2ConsOverlap.sim
tests/script/tsim/tmq/basic2Of2ConsOverlap.sim
+9
-0
tests/script/tsim/tmq/basic3.sim
tests/script/tsim/tmq/basic3.sim
+12
-0
tests/script/tsim/tmq/basic3Of2Cons.sim
tests/script/tsim/tmq/basic3Of2Cons.sim
+12
-0
tests/script/tsim/tmq/basic4.sim
tests/script/tsim/tmq/basic4.sim
+9
-0
tests/script/tsim/tmq/basic4Of2Cons.sim
tests/script/tsim/tmq/basic4Of2Cons.sim
+9
-0
tests/script/tsim/tmq/snapshot.sim
tests/script/tsim/tmq/snapshot.sim
+12
-0
tests/script/tsim/tmq/snapshot1.sim
tests/script/tsim/tmq/snapshot1.sim
+9
-0
tests/script/tsim/tmq/topic.sim
tests/script/tsim/tmq/topic.sim
+2
-0
tests/script/tsim/user/privilege_db.sim
tests/script/tsim/user/privilege_db.sim
+3
-3
tests/script/tsim/user/privilege_topic.sim
tests/script/tsim/user/privilege_topic.sim
+3
-3
tests/system-test/0-others/backquote_check.py
tests/system-test/0-others/backquote_check.py
+4
-4
tests/system-test/0-others/compatibility.py
tests/system-test/0-others/compatibility.py
+1
-0
tests/system-test/0-others/performance_schema.py
tests/system-test/0-others/performance_schema.py
+4
-4
tests/system-test/0-others/taosdShell.py
tests/system-test/0-others/taosdShell.py
+2
-2
tests/system-test/0-others/testRoll.py
tests/system-test/0-others/testRoll.py
+3
-3
tests/system-test/0-others/user_manage.py
tests/system-test/0-others/user_manage.py
+1
-0
tests/system-test/0-others/walFileIdex.py
tests/system-test/0-others/walFileIdex.py
+1
-1
tests/system-test/1-insert/drop.py
tests/system-test/1-insert/drop.py
+4
-4
tests/system-test/7-tmq/basic5.py
tests/system-test/7-tmq/basic5.py
+2
-1
tests/system-test/7-tmq/create_wrong_topic.py
tests/system-test/7-tmq/create_wrong_topic.py
+2
-1
tests/system-test/7-tmq/dataFromTsdbNWal-multiCtb.py
tests/system-test/7-tmq/dataFromTsdbNWal-multiCtb.py
+1
-0
tests/system-test/7-tmq/dataFromTsdbNWal.py
tests/system-test/7-tmq/dataFromTsdbNWal.py
+1
-0
tests/system-test/7-tmq/db.py
tests/system-test/7-tmq/db.py
+1
-1
tests/system-test/7-tmq/dropDbR3ConflictTransaction.py
tests/system-test/7-tmq/dropDbR3ConflictTransaction.py
+1
-0
tests/system-test/7-tmq/schema.py
tests/system-test/7-tmq/schema.py
+2
-2
tests/system-test/7-tmq/stbFilter.py
tests/system-test/7-tmq/stbFilter.py
+1
-0
tests/system-test/7-tmq/stbTagFilter-1ctb.py
tests/system-test/7-tmq/stbTagFilter-1ctb.py
+1
-0
tests/system-test/7-tmq/stbTagFilter-multiCtb.py
tests/system-test/7-tmq/stbTagFilter-multiCtb.py
+1
-0
tests/system-test/7-tmq/subscribeDb.py
tests/system-test/7-tmq/subscribeDb.py
+6
-6
tests/system-test/7-tmq/subscribeDb0.py
tests/system-test/7-tmq/subscribeDb0.py
+4
-4
tests/system-test/7-tmq/subscribeDb1.py
tests/system-test/7-tmq/subscribeDb1.py
+7
-7
tests/system-test/7-tmq/subscribeDb2.py
tests/system-test/7-tmq/subscribeDb2.py
+4
-4
tests/system-test/7-tmq/subscribeDb3.py
tests/system-test/7-tmq/subscribeDb3.py
+4
-4
tests/system-test/7-tmq/subscribeDb4.py
tests/system-test/7-tmq/subscribeDb4.py
+1
-0
tests/system-test/7-tmq/subscribeStb.py
tests/system-test/7-tmq/subscribeStb.py
+2
-2
tests/system-test/7-tmq/subscribeStb0.py
tests/system-test/7-tmq/subscribeStb0.py
+2
-2
tests/system-test/7-tmq/subscribeStb1.py
tests/system-test/7-tmq/subscribeStb1.py
+2
-2
tests/system-test/7-tmq/subscribeStb2.py
tests/system-test/7-tmq/subscribeStb2.py
+2
-2
tests/system-test/7-tmq/subscribeStb3.py
tests/system-test/7-tmq/subscribeStb3.py
+2
-2
tests/system-test/7-tmq/subscribeStb4.py
tests/system-test/7-tmq/subscribeStb4.py
+2
-2
tests/system-test/7-tmq/tmq3mnodeSwitch.py
tests/system-test/7-tmq/tmq3mnodeSwitch.py
+1
-0
tests/system-test/7-tmq/tmqAlterSchema.py
tests/system-test/7-tmq/tmqAlterSchema.py
+2
-0
tests/system-test/7-tmq/tmqAutoCreateTbl.py
tests/system-test/7-tmq/tmqAutoCreateTbl.py
+1
-0
tests/system-test/7-tmq/tmqCheckData.py
tests/system-test/7-tmq/tmqCheckData.py
+1
-0
tests/system-test/7-tmq/tmqCheckData1.py
tests/system-test/7-tmq/tmqCheckData1.py
+1
-0
tests/system-test/7-tmq/tmqConsFromTsdb-1ctb-funcNFilter.py
tests/system-test/7-tmq/tmqConsFromTsdb-1ctb-funcNFilter.py
+1
-0
tests/system-test/7-tmq/tmqConsFromTsdb-1ctb.py
tests/system-test/7-tmq/tmqConsFromTsdb-1ctb.py
+1
-0
tests/system-test/7-tmq/tmqConsFromTsdb-mutilVg-mutilCtb-funcNFilter.py
...est/7-tmq/tmqConsFromTsdb-mutilVg-mutilCtb-funcNFilter.py
+1
-0
tests/system-test/7-tmq/tmqConsFromTsdb-mutilVg-mutilCtb.py
tests/system-test/7-tmq/tmqConsFromTsdb-mutilVg-mutilCtb.py
+1
-0
tests/system-test/7-tmq/tmqConsFromTsdb-mutilVg.py
tests/system-test/7-tmq/tmqConsFromTsdb-mutilVg.py
+1
-0
tests/system-test/7-tmq/tmqConsFromTsdb.py
tests/system-test/7-tmq/tmqConsFromTsdb.py
+1
-0
tests/system-test/7-tmq/tmqConsFromTsdb1-1ctb-funcNFilter.py
tests/system-test/7-tmq/tmqConsFromTsdb1-1ctb-funcNFilter.py
+1
-0
tests/system-test/7-tmq/tmqConsFromTsdb1-1ctb.py
tests/system-test/7-tmq/tmqConsFromTsdb1-1ctb.py
+1
-0
tests/system-test/7-tmq/tmqConsFromTsdb1-mutilVg-mutilCtb-funcNFilter.py
...st/7-tmq/tmqConsFromTsdb1-mutilVg-mutilCtb-funcNFilter.py
+1
-0
tests/system-test/7-tmq/tmqConsFromTsdb1-mutilVg-mutilCtb.py
tests/system-test/7-tmq/tmqConsFromTsdb1-mutilVg-mutilCtb.py
+1
-0
tests/system-test/7-tmq/tmqConsFromTsdb1-mutilVg.py
tests/system-test/7-tmq/tmqConsFromTsdb1-mutilVg.py
+1
-0
tests/system-test/7-tmq/tmqConsFromTsdb1.py
tests/system-test/7-tmq/tmqConsFromTsdb1.py
+1
-0
tests/system-test/7-tmq/tmqConsumerGroup.py
tests/system-test/7-tmq/tmqConsumerGroup.py
+1
-0
tests/system-test/7-tmq/tmqDelete-1ctb.py
tests/system-test/7-tmq/tmqDelete-1ctb.py
+1
-0
tests/system-test/7-tmq/tmqDelete-multiCtb.py
tests/system-test/7-tmq/tmqDelete-multiCtb.py
+1
-0
tests/system-test/7-tmq/tmqDnode.py
tests/system-test/7-tmq/tmqDnode.py
+1
-1
tests/system-test/7-tmq/tmqDnodeRestart.py
tests/system-test/7-tmq/tmqDnodeRestart.py
+2
-0
tests/system-test/7-tmq/tmqDnodeRestart1.py
tests/system-test/7-tmq/tmqDnodeRestart1.py
+1
-0
tests/system-test/7-tmq/tmqDropNtb-snapshot0.py
tests/system-test/7-tmq/tmqDropNtb-snapshot0.py
+2
-0
tests/system-test/7-tmq/tmqDropNtb-snapshot1.py
tests/system-test/7-tmq/tmqDropNtb-snapshot1.py
+2
-0
tests/system-test/7-tmq/tmqDropStb.py
tests/system-test/7-tmq/tmqDropStb.py
+1
-0
tests/system-test/7-tmq/tmqDropStbCtb.py
tests/system-test/7-tmq/tmqDropStbCtb.py
+1
-0
tests/system-test/7-tmq/tmqError.py
tests/system-test/7-tmq/tmqError.py
+1
-1
tests/system-test/7-tmq/tmqModule.py
tests/system-test/7-tmq/tmqModule.py
+1
-1
tests/system-test/7-tmq/tmqShow.py
tests/system-test/7-tmq/tmqShow.py
+1
-0
tests/system-test/7-tmq/tmqSubscribeStb-r3.py
tests/system-test/7-tmq/tmqSubscribeStb-r3.py
+1
-0
tests/system-test/7-tmq/tmqUdf-multCtb-snapshot0.py
tests/system-test/7-tmq/tmqUdf-multCtb-snapshot0.py
+3
-0
tests/system-test/7-tmq/tmqUdf-multCtb-snapshot1.py
tests/system-test/7-tmq/tmqUdf-multCtb-snapshot1.py
+3
-0
tests/system-test/7-tmq/tmqUdf.py
tests/system-test/7-tmq/tmqUdf.py
+3
-0
tests/system-test/7-tmq/tmqUpdate-1ctb.py
tests/system-test/7-tmq/tmqUpdate-1ctb.py
+1
-0
tests/system-test/7-tmq/tmqUpdate-multiCtb-snapshot0.py
tests/system-test/7-tmq/tmqUpdate-multiCtb-snapshot0.py
+1
-0
tests/system-test/7-tmq/tmqUpdate-multiCtb-snapshot1.py
tests/system-test/7-tmq/tmqUpdate-multiCtb-snapshot1.py
+1
-0
tests/system-test/7-tmq/tmqUpdate-multiCtb.py
tests/system-test/7-tmq/tmqUpdate-multiCtb.py
+1
-0
tests/system-test/7-tmq/tmqUpdateWithConsume.py
tests/system-test/7-tmq/tmqUpdateWithConsume.py
+1
-0
tests/system-test/99-TDcase/TD-15517.py
tests/system-test/99-TDcase/TD-15517.py
+1
-1
tests/system-test/99-TDcase/TD-15554.py
tests/system-test/99-TDcase/TD-15554.py
+1
-1
tests/system-test/99-TDcase/TD-15557.py
tests/system-test/99-TDcase/TD-15557.py
+4
-4
tests/system-test/99-TDcase/TD-15563.py
tests/system-test/99-TDcase/TD-15563.py
+5
-5
tests/system-test/99-TDcase/TD-16025.py
tests/system-test/99-TDcase/TD-16025.py
+2
-2
tests/system-test/99-TDcase/TD-16821.py
tests/system-test/99-TDcase/TD-16821.py
+1
-0
tests/system-test/99-TDcase/TD-17255.py
tests/system-test/99-TDcase/TD-17255.py
+4
-0
tests/system-test/99-TDcase/TD-17699.py
tests/system-test/99-TDcase/TD-17699.py
+1
-0
未找到文件。
docs/examples/c/tmq_example.c
浏览文件 @
19883fde
...
...
@@ -70,7 +70,7 @@ static int32_t init_env() {
taos_free_result
(
pRes
);
// create database
pRes
=
taos_query
(
pConn
,
"create database tmqdb"
);
pRes
=
taos_query
(
pConn
,
"create database tmqdb
wal_retention_period 3600
"
);
if
(
taos_errno
(
pRes
)
!=
0
)
{
printf
(
"error in create tmqdb, reason:%s
\n
"
,
taos_errstr
(
pRes
));
return
-
1
;
...
...
docs/examples/csharp/optsJSON/Program.cs
浏览文件 @
19883fde
...
...
@@ -54,7 +54,7 @@ namespace TDengineExample
static
void
PrepareDatabase
(
IntPtr
conn
)
{
IntPtr
res
=
TDengine
.
Query
(
conn
,
"CREATE DATABASE test"
);
IntPtr
res
=
TDengine
.
Query
(
conn
,
"CREATE DATABASE test
WAL_RETENTION_PERIOD 3600
"
);
if
(
TDengine
.
ErrorNo
(
res
)
!=
0
)
{
throw
new
Exception
(
"failed to create database, reason: "
+
TDengine
.
Error
(
res
));
...
...
docs/examples/go/sub/main.go
浏览文件 @
19883fde
...
...
@@ -15,7 +15,7 @@ func main() {
panic
(
err
)
}
defer
db
.
Close
()
_
,
err
=
db
.
Exec
(
"create database if not exists example_tmq"
)
_
,
err
=
db
.
Exec
(
"create database if not exists example_tmq
wal_retention_period 3600
"
)
if
err
!=
nil
{
panic
(
err
)
}
...
...
docs/examples/java/src/main/java/com/taos/example/SubscribeDemo.java
浏览文件 @
19883fde
...
...
@@ -35,7 +35,7 @@ public class SubscribeDemo {
try
(
Statement
statement
=
connection
.
createStatement
())
{
statement
.
executeUpdate
(
"drop topic if exists "
+
TOPIC
);
statement
.
executeUpdate
(
"drop database if exists "
+
DB_NAME
);
statement
.
executeUpdate
(
"create database "
+
DB_NAME
);
statement
.
executeUpdate
(
"create database "
+
DB_NAME
+
" wal_retention_period 3600"
);
statement
.
executeUpdate
(
"use "
+
DB_NAME
);
statement
.
executeUpdate
(
"CREATE TABLE `meters` (`ts` TIMESTAMP, `current` FLOAT, `voltage` INT) TAGS (`groupid` INT, `location` BINARY(24))"
);
...
...
docs/examples/java/src/main/java/com/taos/example/WebsocketSubscribeDemo.java
浏览文件 @
19883fde
...
...
@@ -35,7 +35,7 @@ public class WebsocketSubscribeDemo {
Statement
statement
=
connection
.
createStatement
())
{
statement
.
executeUpdate
(
"drop topic if exists "
+
TOPIC
);
statement
.
executeUpdate
(
"drop database if exists "
+
DB_NAME
);
statement
.
executeUpdate
(
"create database "
+
DB_NAME
);
statement
.
executeUpdate
(
"create database "
+
DB_NAME
+
" wal_retention_period 3600"
);
statement
.
executeUpdate
(
"use "
+
DB_NAME
);
statement
.
executeUpdate
(
"CREATE TABLE `meters` (`ts` TIMESTAMP, `current` FLOAT, `voltage` INT) TAGS (`groupid` INT, `location` BINARY(24))"
);
...
...
docs/examples/python/conn_websocket_pandas.py
浏览文件 @
19883fde
...
...
@@ -4,7 +4,7 @@ import taos
taos_conn
=
taos
.
connect
()
taos_conn
.
execute
(
'drop database if exists power'
)
taos_conn
.
execute
(
'create database if not exists power'
)
taos_conn
.
execute
(
'create database if not exists power
wal_retention_period 3600
'
)
taos_conn
.
execute
(
"use power"
)
taos_conn
.
execute
(
"CREATE STABLE power.meters (ts TIMESTAMP, current FLOAT, voltage INT, phase FLOAT) TAGS (location BINARY(64), groupId INT)"
)
...
...
docs/examples/python/connect_websocket_examples.py
浏览文件 @
19883fde
...
...
@@ -6,7 +6,7 @@ conn = taosws.connect("taosws://root:taosdata@localhost:6041")
# ANCHOR: basic
conn
.
execute
(
"drop database if exists connwspy"
)
conn
.
execute
(
"create database if not exists connwspy"
)
conn
.
execute
(
"create database if not exists connwspy
wal_retention_period 3600
"
)
conn
.
execute
(
"use connwspy"
)
conn
.
execute
(
"create table if not exists stb (ts timestamp, c1 int) tags (t1 int)"
)
conn
.
execute
(
"create table if not exists tb1 using stb tags (1)"
)
...
...
docs/examples/python/kafka_example_common.py
浏览文件 @
19883fde
...
...
@@ -5,7 +5,7 @@ LOCATIONS = ['California.SanFrancisco', 'California.LosAngles', 'California.SanD
'California.PaloAlto'
,
'California.Campbell'
,
'California.MountainView'
,
'California.Sunnyvale'
,
'California.SantaClara'
,
'California.Cupertino'
]
CREATE_DATABASE_SQL
=
'create database if not exists {} keep 365 duration 10 buffer 16 wal_level 1'
CREATE_DATABASE_SQL
=
'create database if not exists {} keep 365 duration 10 buffer 16 wal_level 1
wal_retention_period 3600
'
USE_DATABASE_SQL
=
'use {}'
DROP_TABLE_SQL
=
'drop table if exists meters'
DROP_DATABASE_SQL
=
'drop database if exists {}'
...
...
docs/examples/python/tmq_example.py
浏览文件 @
19883fde
...
...
@@ -6,7 +6,7 @@ def init_tmq_env(db, topic):
conn
=
taos
.
connect
()
conn
.
execute
(
"drop topic if exists {}"
.
format
(
topic
))
conn
.
execute
(
"drop database if exists {}"
.
format
(
db
))
conn
.
execute
(
"create database if not exists {}"
.
format
(
db
))
conn
.
execute
(
"create database if not exists {}
wal_retention_period 3600
"
.
format
(
db
))
conn
.
select_db
(
db
)
conn
.
execute
(
"create stable if not exists stb1 (ts timestamp, c1 int, c2 float, c3 varchar(16)) tags(t1 int, t3 varchar(16))"
)
...
...
tests/docs-examples-test/python.sh
浏览文件 @
19883fde
...
...
@@ -52,7 +52,7 @@ python3 conn_rest_pandas.py
taos
-s
"drop database if exists power"
# 11
taos
-s
"create database if not exists test"
taos
-s
"create database if not exists test
wal_retention_period 3600
"
python3 connect_native_reference.py
# 12
...
...
tests/script/tsim/tmq/basic1.sim
浏览文件 @
19883fde
...
...
@@ -34,6 +34,9 @@ $showRow = 0
sql connect
sql use $dbName
print == alter database
sql alter database $dbName wal_retention_period 3600
print == create topics from super table
sql create topic topic_stb_column as select ts, c3 from stb
sql create topic topic_stb_all as select ts, c1, c2, c3 from stb
...
...
@@ -83,6 +86,9 @@ sql create database $cdbName vgroups 1
sleep 500
sql use $cdbName
print == alter database
sql alter database $cdbName wal_retention_period 3600
print == create consume info table and consume result table
sql create table consumeinfo (ts timestamp, consumerid int, topiclist binary(1024), keylist binary(1024), expectmsgcnt bigint, ifcheckdata int, ifmanualcommit int)
sql create table consumeresult (ts timestamp, consumerid int, consummsgcnt bigint, consumrowcnt bigint, checkresult int)
...
...
@@ -155,6 +161,9 @@ sql create database $cdbName vgroups 1
sleep 500
sql use $cdbName
print == alter database
sql alter database $cdbName wal_retention_period 3600
print == create consume info table and consume result table
sql create table consumeinfo (ts timestamp, consumerid int, topiclist binary(1024), keylist binary(1024), expectmsgcnt bigint, ifcheckdata int, ifmanualcommit int)
sql create table consumeresult (ts timestamp, consumerid int, consummsgcnt bigint, consumrowcnt bigint, checkresult int)
...
...
@@ -226,6 +235,9 @@ sql create database $cdbName vgroups 1
sleep 500
sql use $cdbName
print == alter database
sql alter database $cdbName wal_retention_period 3600
print == create consume info table and consume result table
sql create table consumeinfo (ts timestamp, consumerid int, topiclist binary(1024), keylist binary(1024), expectmsgcnt bigint, ifcheckdata int, ifmanualcommit int)
sql create table consumeresult (ts timestamp, consumerid int, consummsgcnt bigint, consumrowcnt bigint, checkresult int)
...
...
tests/script/tsim/tmq/basic1Of2Cons.sim
浏览文件 @
19883fde
...
...
@@ -34,6 +34,9 @@ $showRow = 0
sql connect
sql use $dbName
print == alter database
sql alter database $dbName wal_retention_period 3600
print == create topics from super table
sql create topic topic_stb_column as select ts, c3 from stb
sql create topic topic_stb_all as select ts, c1, c2, c3 from stb
...
...
@@ -83,6 +86,9 @@ sql create database $cdbName vgroups 1
sleep 500
sql use $cdbName
print == alter database
sql alter database $cdbName wal_retention_period 3600
print == create consume info table and consume result table for stb
sql create table consumeinfo (ts timestamp, consumerid int, topiclist binary(1024), keylist binary(1024), expectmsgcnt bigint, ifcheckdata int, ifmanualcommit int)
sql create table consumeresult (ts timestamp, consumerid int, consummsgcnt bigint, consumrowcnt bigint, checkresult int)
...
...
@@ -186,6 +192,9 @@ sql create database $cdbName vgroups 1
sleep 500
sql use $cdbName
print == alter database
sql alter database $cdbName wal_retention_period 3600
print == create consume info table and consume result table for ctb
sql create table consumeinfo (ts timestamp, consumerid int, topiclist binary(1024), keylist binary(1024), expectmsgcnt bigint, ifcheckdata int, ifmanualcommit int)
sql create table consumeresult (ts timestamp, consumerid int, consummsgcnt bigint, consumrowcnt bigint, checkresult int)
...
...
@@ -288,6 +297,9 @@ sql create database $cdbName vgroups 1
sleep 500
sql use $cdbName
print == alter database
sql alter database $cdbName wal_retention_period 3600
print == create consume info table and consume result table for ntb
sql create table consumeinfo (ts timestamp, consumerid int, topiclist binary(1024), keylist binary(1024), expectmsgcnt bigint, ifcheckdata int, ifmanualcommit int)
sql create table consumeresult (ts timestamp, consumerid int, consummsgcnt bigint, consumrowcnt bigint, checkresult int)
...
...
tests/script/tsim/tmq/basic2.sim
浏览文件 @
19883fde
...
...
@@ -34,6 +34,9 @@ $showRow = 0
sql connect
sql use $dbName
print == alter database
sql alter database $dbName wal_retention_period 3600
print == create topics from super table
sql create topic topic_stb_column as select ts, c3 from stb
sql create topic topic_stb_all as select ts, c1, c2, c3 from stb
...
...
@@ -118,6 +121,9 @@ sql create database $cdbName vgroups 1
sleep 500
sql use $cdbName
print == alter database
sql alter database $cdbName wal_retention_period 3600
print == create consume info table and consume result table
sql create table consumeinfo (ts timestamp, consumerid int, topiclist binary(1024), keylist binary(1024), expectmsgcnt bigint, ifcheckdata int, ifmanualcommit int)
sql create table consumeresult (ts timestamp, consumerid int, consummsgcnt bigint, consumrowcnt bigint, checkresult int)
...
...
@@ -175,6 +181,9 @@ sql create database $cdbName vgroups 1
sleep 500
sql use $cdbName
print == alter database
sql alter database $cdbName wal_retention_period 3600
print == create consume info table and consume result table
sql create table consumeinfo (ts timestamp, consumerid int, topiclist binary(1024), keylist binary(1024), expectmsgcnt bigint, ifcheckdata int, ifmanualcommit int)
sql create table consumeresult (ts timestamp, consumerid int, consummsgcnt bigint, consumrowcnt bigint, checkresult int)
...
...
tests/script/tsim/tmq/basic2Of2Cons.sim
浏览文件 @
19883fde
...
...
@@ -34,6 +34,9 @@ $showRow = 0
sql connect
sql use $dbName
print == alter database
sql alter database $dbName wal_retention_period 3600
print == create topics from super table
sql create topic topic_stb_column as select ts, c3 from stb
sql create topic topic_stb_all as select ts, c1, c2, c3 from stb
...
...
@@ -147,6 +150,9 @@ sql create database $cdbName vgroups 1
sleep 500
sql use $cdbName
print == alter database
sql alter database $cdbName wal_retention_period 3600
print == create consume info table and consume result table for ctb
sql create table consumeinfo (ts timestamp, consumerid int, topiclist binary(1024), keylist binary(1024), expectmsgcnt bigint, ifcheckdata int, ifmanualcommit int)
sql create table consumeresult (ts timestamp, consumerid int, consummsgcnt bigint, consumrowcnt bigint, checkresult int)
...
...
@@ -234,6 +240,9 @@ sql create database $cdbName vgroups 1
sleep 500
sql use $cdbName
print == alter database
sql alter database $cdbName wal_retention_period 3600
print == create consume info table and consume result table for ntb
sql create table consumeinfo (ts timestamp, consumerid int, topiclist binary(1024), keylist binary(1024), expectmsgcnt bigint, ifcheckdata int, ifmanualcommit int)
sql create table consumeresult (ts timestamp, consumerid int, consummsgcnt bigint, consumrowcnt bigint, checkresult int)
...
...
tests/script/tsim/tmq/basic2Of2ConsOverlap.sim
浏览文件 @
19883fde
...
...
@@ -34,6 +34,9 @@ $showRow = 0
sql connect
sql use $dbName
print == alter database
sql alter database $dbName wal_retention_period 3600
print == create topics from super table
sql create topic topic_stb_column as select ts, c3 from stb
sql create topic topic_stb_all as select ts, c1, c2, c3 from stb
...
...
@@ -168,6 +171,9 @@ sql create database $cdbName vgroups 1
sleep 500
sql use $cdbName
print == alter database
sql alter database $cdbName wal_retention_period 3600
print == create consume info table and consume result table for ctb
sql create table consumeinfo (ts timestamp, consumerid int, topiclist binary(1024), keylist binary(1024), expectmsgcnt bigint, ifcheckdata int, ifmanualcommit int)
sql create table consumeresult (ts timestamp, consumerid int, consummsgcnt bigint, consumrowcnt bigint, checkresult int)
...
...
@@ -259,6 +265,9 @@ sql create database $cdbName vgroups 1
sleep 500
sql use $cdbName
print == alter database
sql alter database $cdbName wal_retention_period 3600
print == create consume info table and consume result table for ntb
sql create table consumeinfo (ts timestamp, consumerid int, topiclist binary(1024), keylist binary(1024), expectmsgcnt bigint, ifcheckdata int, ifmanualcommit int)
sql create table consumeresult (ts timestamp, consumerid int, consummsgcnt bigint, consumrowcnt bigint, checkresult int)
...
...
tests/script/tsim/tmq/basic3.sim
浏览文件 @
19883fde
...
...
@@ -34,6 +34,9 @@ $showRow = 0
sql connect
sql use $dbName
print == alter database
sql alter database $dbName wal_retention_period 3600
print == create topics from super table
sql create topic topic_stb_column as select ts, c3 from stb
sql create topic topic_stb_all as select ts, c1, c2, c3 from stb
...
...
@@ -83,6 +86,9 @@ sql create database $cdbName vgroups 1
sleep 500
sql use $cdbName
print == alter database
sql alter database $cdbName wal_retention_period 3600
print == create consume info table and consume result table
sql create table consumeinfo (ts timestamp, consumerid int, topiclist binary(1024), keylist binary(1024), expectmsgcnt bigint, ifcheckdata int, ifmanualcommit int)
sql create table consumeresult (ts timestamp, consumerid int, consummsgcnt bigint, consumrowcnt bigint, checkresult int)
...
...
@@ -154,6 +160,9 @@ sql create database $cdbName vgroups 1
sleep 500
sql use $cdbName
print == alter database
sql alter database $cdbName wal_retention_period 3600
print == create consume info table and consume result table
sql create table consumeinfo (ts timestamp, consumerid int, topiclist binary(1024), keylist binary(1024), expectmsgcnt bigint, ifcheckdata int, ifmanualcommit int)
sql create table consumeresult (ts timestamp, consumerid int, consummsgcnt bigint, consumrowcnt bigint, checkresult int)
...
...
@@ -225,6 +234,9 @@ sql create database $cdbName vgroups 1
sleep 500
sql use $cdbName
print == alter database
sql alter database $cdbName wal_retention_period 3600
print == create consume info table and consume result table
sql create table consumeinfo (ts timestamp, consumerid int, topiclist binary(1024), keylist binary(1024), expectmsgcnt bigint, ifcheckdata int, ifmanualcommit int)
sql create table consumeresult (ts timestamp, consumerid int, consummsgcnt bigint, consumrowcnt bigint, checkresult int)
...
...
tests/script/tsim/tmq/basic3Of2Cons.sim
浏览文件 @
19883fde
...
...
@@ -34,6 +34,9 @@ $showRow = 0
sql connect
sql use $dbName
print == alter database
sql alter database $dbName wal_retention_period 3600
print == create topics from super table
sql create topic topic_stb_column as select ts, c3 from stb
sql create topic topic_stb_all as select ts, c1, c2, c3 from stb
...
...
@@ -82,6 +85,9 @@ sql create database $cdbName vgroups 1
sleep 500
sql use $cdbName
print == alter database
sql alter database $cdbName wal_retention_period 3600
print == create consume info table and consume result table
sql create table consumeinfo (ts timestamp, consumerid int, topiclist binary(1024), keylist binary(1024), expectmsgcnt bigint, ifcheckdata int, ifmanualcommit int)
sql create table consumeresult (ts timestamp, consumerid int, consummsgcnt bigint, consumrowcnt bigint, checkresult int)
...
...
@@ -197,6 +203,9 @@ sql create database $cdbName vgroups 1
sleep 500
sql use $cdbName
print == alter database
sql alter database $cdbName wal_retention_period 3600
print == create consume info table and consume result table
sql create table consumeinfo (ts timestamp, consumerid int, topiclist binary(1024), keylist binary(1024), expectmsgcnt bigint, ifcheckdata int, ifmanualcommit int)
sql create table consumeresult (ts timestamp, consumerid int, consummsgcnt bigint, consumrowcnt bigint, checkresult int)
...
...
@@ -299,6 +308,9 @@ sql create database $cdbName vgroups 1
sleep 500
sql use $cdbName
print == alter database
sql alter database $cdbName wal_retention_period 3600
print == create consume info table and consume result table
sql create table consumeinfo (ts timestamp, consumerid int, topiclist binary(1024), keylist binary(1024), expectmsgcnt bigint, ifcheckdata int, ifmanualcommit int)
sql create table consumeresult (ts timestamp, consumerid int, consummsgcnt bigint, consumrowcnt bigint, checkresult int)
...
...
tests/script/tsim/tmq/basic4.sim
浏览文件 @
19883fde
...
...
@@ -34,6 +34,9 @@ $showRow = 0
sql connect
sql use $dbName
print == alter database
sql alter database $dbName wal_retention_period 3600
print == create topics from super table
sql create topic topic_stb_column as select ts, c3 from stb
sql create topic topic_stb_all as select ts, c1, c2, c3 from stb
...
...
@@ -115,6 +118,9 @@ sql create database $cdbName vgroups 1
sleep 500
sql use $cdbName
print == alter database
sql alter database $cdbName wal_retention_period 3600
print == create consume info table and consume result table
sql create table consumeinfo (ts timestamp, consumerid int, topiclist binary(1024), keylist binary(1024), expectmsgcnt bigint, ifcheckdata int, ifmanualcommit int)
sql create table consumeresult (ts timestamp, consumerid int, consummsgcnt bigint, consumrowcnt bigint, checkresult int)
...
...
@@ -172,6 +178,9 @@ sql create database $cdbName vgroups 1
sleep 500
sql use $cdbName
print == alter database
sql alter database $cdbName wal_retention_period 3600
print == create consume info table and consume result table
sql create table consumeinfo (ts timestamp, consumerid int, topiclist binary(1024), keylist binary(1024), expectmsgcnt bigint, ifcheckdata int, ifmanualcommit int)
sql create table consumeresult (ts timestamp, consumerid int, consummsgcnt bigint, consumrowcnt bigint, checkresult int)
...
...
tests/script/tsim/tmq/basic4Of2Cons.sim
浏览文件 @
19883fde
...
...
@@ -34,6 +34,9 @@ $showRow = 0
sql connect
sql use $dbName
print == alter database
sql alter database $dbName wal_retention_period 3600
print == create topics from super table
sql create topic topic_stb_column as select ts, c3 from stb
sql create topic topic_stb_all as select ts, c1, c2, c3 from stb
...
...
@@ -156,6 +159,9 @@ sql create database $cdbName vgroups 1
sleep 500
sql use $cdbName
print == alter database
sql alter database $cdbName wal_retention_period 3600
print == create consume info table and consume result table
sql create table consumeinfo (ts timestamp, consumerid int, topiclist binary(1024), keylist binary(1024), expectmsgcnt bigint, ifcheckdata int, ifmanualcommit int)
sql create table consumeresult (ts timestamp, consumerid int, consummsgcnt bigint, consumrowcnt bigint, checkresult int)
...
...
@@ -244,6 +250,9 @@ sql create database $cdbName vgroups 1
sleep 500
sql use $cdbName
print == alter database
sql alter database $cdbName wal_retention_period 3600
print == create consume info table and consume result table
sql create table consumeinfo (ts timestamp, consumerid int, topiclist binary(1024), keylist binary(1024), expectmsgcnt bigint, ifcheckdata int, ifmanualcommit int)
sql create table consumeresult (ts timestamp, consumerid int, consummsgcnt bigint, consumrowcnt bigint, checkresult int)
...
...
tests/script/tsim/tmq/snapshot.sim
浏览文件 @
19883fde
...
...
@@ -34,6 +34,9 @@ $showRow = 0
sql connect
sql use $dbName
print == alter database
sql alter database $dbName wal_retention_period 3600
print == create topics from super table
sql create topic topic_stb_column as select ts, c3 from stb
sql create topic topic_stb_all as select ts, c1, c2, c3 from stb
...
...
@@ -83,6 +86,9 @@ sql create database $cdbName vgroups 1
sleep 500
sql use $cdbName
print == alter database
sql alter database $cdbName wal_retention_period 3600
print == create consume info table and consume result table
sql create table consumeinfo (ts timestamp, consumerid int, topiclist binary(1024), keylist binary(1024), expectmsgcnt bigint, ifcheckdata int, ifmanualcommit int)
sql create table consumeresult (ts timestamp, consumerid int, consummsgcnt bigint, consumrowcnt bigint, checkresult int)
...
...
@@ -152,6 +158,9 @@ sql create database $cdbName vgroups 1
sleep 500
sql use $cdbName
print == alter database
sql alter database $cdbName wal_retention_period 3600
print == create consume info table and consume result table
sql create table consumeinfo (ts timestamp, consumerid int, topiclist binary(1024), keylist binary(1024), expectmsgcnt bigint, ifcheckdata int, ifmanualcommit int)
sql create table consumeresult (ts timestamp, consumerid int, consummsgcnt bigint, consumrowcnt bigint, checkresult int)
...
...
@@ -223,6 +232,9 @@ sql create database $cdbName vgroups 1
sleep 500
sql use $cdbName
print == alter database
sql alter database $cdbName wal_retention_period 3600
print == create consume info table and consume result table
sql create table consumeinfo (ts timestamp, consumerid int, topiclist binary(1024), keylist binary(1024), expectmsgcnt bigint, ifcheckdata int, ifmanualcommit int)
sql create table consumeresult (ts timestamp, consumerid int, consummsgcnt bigint, consumrowcnt bigint, checkresult int)
...
...
tests/script/tsim/tmq/snapshot1.sim
浏览文件 @
19883fde
...
...
@@ -34,6 +34,9 @@ $showRow = 0
sql connect
sql use $dbName
print == alter database
sql alter database $dbName wal_retention_period 3600
print == create topics from super table
sql create topic topic_stb_column as select ts, c3 from stb
sql create topic topic_stb_all as select ts, c1, c2, c3 from stb
...
...
@@ -147,6 +150,9 @@ sql create database $cdbName vgroups 1
sleep 500
sql use $cdbName
print == alter database
sql alter database $cdbName wal_retention_period 3600
print == create consume info table and consume result table for ctb
sql create table consumeinfo (ts timestamp, consumerid int, topiclist binary(1024), keylist binary(1024), expectmsgcnt bigint, ifcheckdata int, ifmanualcommit int)
sql create table consumeresult (ts timestamp, consumerid int, consummsgcnt bigint, consumrowcnt bigint, checkresult int)
...
...
@@ -224,6 +230,9 @@ sql create database $cdbName vgroups 1
sleep 500
sql use $cdbName
print == alter database
sql alter database $cdbName wal_retention_period 3600
print == create consume info table and consume result table for ntb
sql create table consumeinfo (ts timestamp, consumerid int, topiclist binary(1024), keylist binary(1024), expectmsgcnt bigint, ifcheckdata int, ifmanualcommit int)
sql create table consumeresult (ts timestamp, consumerid int, consummsgcnt bigint, consumrowcnt bigint, checkresult int)
...
...
tests/script/tsim/tmq/topic.sim
浏览文件 @
19883fde
...
...
@@ -39,6 +39,8 @@ endi
sql use $dbName
print == alter database
sql alter database $dbName wal_retention_period 3600
print == create super table
sql create table $stbPrefix (ts timestamp, c1 int, c2 float, c3 binary(16)) tags (t1 int)
...
...
tests/script/tsim/user/privilege_db.sim
浏览文件 @
19883fde
...
...
@@ -4,13 +4,13 @@ system sh/exec.sh -n dnode1 -s start
sql connect
print =============== create db
sql create database d1 vgroups 1;
sql create database d1 vgroups 1
wal_retention_period 3600
;
sql use d1
sql create table d1_stb (ts timestamp, i int) tags (j int)
sql create topic d1_topic_1 as select ts, i from d1_stb
sql create database d2 vgroups 1;
sql create database d3 vgroups 1;
sql create database d2 vgroups 1
wal_retention_period 3600
;
sql create database d3 vgroups 1
wal_retention_period 3600
;
sql select * from information_schema.ins_databases
if $rows != 5 then
return -1
...
...
tests/script/tsim/user/privilege_topic.sim
浏览文件 @
19883fde
...
...
@@ -4,9 +4,9 @@ system sh/exec.sh -n dnode1 -s start
sql connect
print =============== create db
sql create database root_d1 vgroups 1;
sql create database root_d2 vgroups 1;
sql create database root_d3 vgroups 1;
sql create database root_d1 vgroups 1
wal_retention_period 3600
;
sql create database root_d2 vgroups 1
wal_retention_period 3600
;
sql create database root_d3 vgroups 1
wal_retention_period 3600
;
sql show user privileges
if $rows != 1 then
...
...
tests/system-test/0-others/backquote_check.py
浏览文件 @
19883fde
...
...
@@ -29,7 +29,7 @@ class TDTestCase:
self
.
streamname
=
'stm'
self
.
streamtb
=
'stm_stb'
def
topic_name_check
(
self
):
tdSql
.
execute
(
f
'create database if not exists
{
self
.
dbname
}
'
)
tdSql
.
execute
(
f
'create database if not exists
{
self
.
dbname
}
wal_retention_period 3600
'
)
tdSql
.
execute
(
f
'use
{
self
.
dbname
}
'
)
tdSql
.
execute
(
f
'create stable
{
self
.
stbname
}
(ts timestamp,c0 int) tags(t0 int)'
)
for
name
in
[
self
.
dbname
,
self
.
stbname
]:
...
...
@@ -56,12 +56,12 @@ class TDTestCase:
tdSql
.
execute
(
f
'drop topic `
{
name
}
`'
)
def
db_name_check
(
self
):
tdSql
.
execute
(
f
'create database if not exists `
{
self
.
dbname
}
`'
)
tdSql
.
execute
(
f
'create database if not exists `
{
self
.
dbname
}
`
wal_retention_period 3600
'
)
tdSql
.
execute
(
f
'use `
{
self
.
dbname
}
`'
)
tdSql
.
execute
(
f
'drop database
{
self
.
dbname
}
'
)
def
stream_name_check
(
self
):
tdSql
.
execute
(
f
'create database if not exists
{
self
.
dbname
}
'
)
tdSql
.
execute
(
f
'create database if not exists
{
self
.
dbname
}
wal_retention_period 3600
'
)
tdSql
.
execute
(
f
'use
{
self
.
dbname
}
'
)
tdSql
.
execute
(
f
'create stable
{
self
.
stbname
}
(ts timestamp,c0 int) tags(t0 int)'
)
tdSql
.
execute
(
f
'create stream `
{
self
.
streamname
}
` into `
{
self
.
streamtb
}
` as select count(*) from
{
self
.
stbname
}
interval(10s);'
)
...
...
@@ -84,4 +84,4 @@ class TDTestCase:
tdLog
.
success
(
"%s successfully executed"
%
__file__
)
tdCases
.
addWindows
(
__file__
,
TDTestCase
())
tdCases
.
addLinux
(
__file__
,
TDTestCase
())
\ No newline at end of file
tdCases
.
addLinux
(
__file__
,
TDTestCase
())
tests/system-test/0-others/compatibility.py
浏览文件 @
19883fde
...
...
@@ -181,6 +181,7 @@ class TDTestCase:
tdsql
.
execute
(
"drop database if exists db"
)
tdsql
.
execute
(
"create database db"
)
tdsql
.
execute
(
"use db"
)
tdsql
.
execute
(
"alter database db wal_retention_period 3600"
)
tdsql
.
execute
(
"create stable db.stb1 (ts timestamp, c1 int) tags (t1 int);"
)
tdsql
.
execute
(
"insert into db.ct1 using db.stb1 TAGS(1) values(now(),11);"
)
tdsql
.
error
(
" insert into `db.ct2` using db.stb1 TAGS(9) values(now(),11);"
)
...
...
tests/system-test/0-others/performance_schema.py
浏览文件 @
19883fde
...
...
@@ -75,7 +75,7 @@ class TDTestCase:
def
prepare_data
(
self
):
tdSql
.
execute
(
f
"create database if not exists
{
self
.
dbname
}
vgroups 2"
)
#1 query
tdSql
.
execute
(
f
'use
{
self
.
dbname
}
'
)
#1 query
tdsql
.
execute
(
f
"alter database
{
self
.
dbname
}
wal_retention_period 3600"
)
tdSql
.
execute
(
self
.
setsql
.
set_create_stable_sql
(
self
.
stbname
,
self
.
column_dict
,
self
.
tag_dict
))
#1 query
for
i
in
range
(
self
.
tbnum
):
#self.tbnum query
...
...
@@ -92,12 +92,12 @@ class TDTestCase:
def
run
(
self
):
tdSqlTran
=
TDSql
()
tdSqlTran
.
init
(
self
.
obj
.
conn
.
cursor
())
tdSqlTran
.
execute
(
f
"create database if not exists %s vgroups 20"
%
(
self
.
obj
.
transTestDBName
))
tdSqlTran
.
execute
(
f
"create database if not exists %s vgroups 20
wal_retention_period 3600
"
%
(
self
.
obj
.
transTestDBName
))
tdSqlTran
.
execute
(
f
"DROP DATABASE %s"
%
(
self
.
obj
.
transTestDBName
))
def
init_tmq_env
(
self
,
db
,
topic
):
self
.
conn
.
execute
(
"drop topic if exists {}"
.
format
(
topic
))
self
.
conn
.
execute
(
"create database if not exists {}"
.
format
(
db
))
self
.
conn
.
execute
(
"create database if not exists {}
wal_retention_period 3600
"
.
format
(
db
))
self
.
conn
.
select_db
(
db
)
self
.
conn
.
execute
(
"create stable if not exists stb_sub (ts timestamp, c1 int, c2 float, c3 varchar(16)) tags(t1 int, t3 varchar(16))"
)
...
...
@@ -211,4 +211,4 @@ class TDTestCase:
tdLog
.
success
(
"%s successfully executed"
%
__file__
)
tdCases
.
addWindows
(
__file__
,
TDTestCase
())
tdCases
.
addLinux
(
__file__
,
TDTestCase
())
\ No newline at end of file
tdCases
.
addLinux
(
__file__
,
TDTestCase
())
tests/system-test/0-others/taosdShell.py
浏览文件 @
19883fde
...
...
@@ -129,7 +129,7 @@ class TDTestCase:
# database\stb\tb\chiild-tb\rows\topics
tdSql
.
execute
(
"create user testpy pass 'testpy'"
)
tdSql
.
execute
(
"drop database if exists db0;"
)
tdSql
.
execute
(
"create database db0;"
)
tdSql
.
execute
(
"create database db0
wal_retention_period 3600
;"
)
tdSql
.
execute
(
"use db0;"
)
tdSql
.
execute
(
"create table if not exists db0.stb (ts timestamp, c1 int, c2 float, c3 double) tags (t1 int unsigned);"
)
tdSql
.
execute
(
"create table db0.ct1 using db0.stb tags(1000);"
)
...
...
@@ -145,7 +145,7 @@ class TDTestCase:
#stream
tdSql
.
execute
(
"drop database if exists source_db;"
)
tdSql
.
query
(
"create database source_db vgroups 3;"
)
tdSql
.
query
(
"create database source_db vgroups 3
wal_retention_period 3600
;"
)
tdSql
.
query
(
"use source_db"
)
tdSql
.
query
(
"create table if not exists source_db.stb (ts timestamp, k int) tags (a int);"
)
tdSql
.
query
(
"create table source_db.ct1 using source_db.stb tags(1000);create table source_db.ct2 using source_db.stb tags(2000);create table source_db.ct3 using source_db.stb tags(3000);"
)
...
...
tests/system-test/0-others/testRoll.py
浏览文件 @
19883fde
...
...
@@ -13,7 +13,7 @@ def init_tmq_env(db, topic):
conn
.
execute
(
"drop topic if exists {}"
.
format
(
topic
))
conn
.
execute
(
"drop database if exists {}"
.
format
(
db
))
conn
.
execute
(
"create database if not exists {} replica 1 "
.
format
(
db
))
conn
.
execute
(
"create database if not exists {} replica 1
wal_retention_period 3600
"
.
format
(
db
))
conn
.
select_db
(
db
)
conn
.
execute
(
"create stable if not exists stb1 (ts timestamp, c1 int, c2 float, c3 varchar(16)) tags(t1 int, t3 varchar(16))"
)
...
...
@@ -37,7 +37,7 @@ def init_tmq_rest_env(db, topic):
conn
.
execute
(
"drop topic if exists {}"
.
format
(
topic
))
conn
.
execute
(
"drop database if exists {}"
.
format
(
db
))
conn
.
execute
(
"create database if not exists {} replica 3 "
.
format
(
db
))
conn
.
execute
(
"create database if not exists {} replica 3
wal_retention_period 3600
"
.
format
(
db
))
conn
.
select_db
(
db
)
conn
.
execute
(
"create stable if not exists stb1 (ts timestamp, c1 int, c2 float, c3 varchar(16)) tags(t1 int, t3 varchar(16))"
)
...
...
@@ -80,4 +80,4 @@ if __name__ == '__main__':
val
=
res
.
value
()
for
block
in
val
:
print
(
block
.
fetchall
())
\ No newline at end of file
print
(
block
.
fetchall
())
tests/system-test/0-others/user_manage.py
浏览文件 @
19883fde
...
...
@@ -115,6 +115,7 @@ class TDTestCase:
jiacy0_read_conn
=
taos
.
connect
(
user
=
'jiacy0_read'
,
password
=
'123'
)
jiacy0_write_conn
=
taos
.
connect
(
user
=
'jiacy0_write'
,
password
=
'123'
)
jiacy0_none_conn
=
taos
.
connect
(
user
=
'jiacy0_none'
,
password
=
'123'
)
tdSql
.
execute
(
'alter database db wal_retention_period 3600'
)
tdSql
.
execute
(
'create topic root_db as select * from db.stb'
)
for
user
in
[
jiacy1_all_conn
,
jiacy1_read_conn
,
jiacy0_all_conn
,
jiacy0_read_conn
]:
user
.
execute
(
f
'create topic db_jiacy as select * from db.stb'
)
...
...
tests/system-test/0-others/walFileIdex.py
浏览文件 @
19883fde
...
...
@@ -58,7 +58,7 @@ class TDTestCase:
#stream
tdSql
.
execute
(
"drop database if exists source_db;"
)
tdSql
.
query
(
"create database source_db vgroups 3;"
)
tdSql
.
query
(
"create database source_db vgroups 3
wal_retention_period 3600
;"
)
tdSql
.
query
(
"use source_db"
)
tdSql
.
query
(
"create table if not exists source_db.stb (ts timestamp, k int) tags (a int);"
)
tdSql
.
query
(
"create table source_db.ct1 using source_db.stb tags(1000);create table source_db.ct2 using source_db.stb tags(2000);create table source_db.ct3 using source_db.stb tags(3000);"
)
...
...
tests/system-test/1-insert/drop.py
浏览文件 @
19883fde
...
...
@@ -54,7 +54,7 @@ class TDTestCase:
insert_list
=
[]
self
.
setsql
.
insert_values
(
column_dict
,
i
,
insert_sql
,
insert_list
,
self
.
ts
)
def
drop_ntb_check
(
self
):
tdSql
.
execute
(
f
'create database if not exists
{
self
.
dbname
}
replica
{
self
.
replicaVar
}
'
)
tdSql
.
execute
(
f
'create database if not exists
{
self
.
dbname
}
replica
{
self
.
replicaVar
}
wal_retention_period 3600
'
)
tdSql
.
execute
(
f
'use
{
self
.
dbname
}
'
)
tdSql
.
execute
(
self
.
setsql
.
set_create_normaltable_sql
(
self
.
ntbname
,
self
.
column_dict
))
self
.
insert_data
(
self
.
column_dict
,
self
.
ntbname
,
self
.
rowNum
)
...
...
@@ -80,7 +80,7 @@ class TDTestCase:
tag_values
=
[
f
'1'
]
tdSql
.
execute
(
f
"create database if not exists
{
self
.
dbname
}
replica
{
self
.
replicaVar
}
"
)
tdSql
.
execute
(
f
"create database if not exists
{
self
.
dbname
}
replica
{
self
.
replicaVar
}
wal_retention_period 3600
"
)
tdSql
.
execute
(
f
'use
{
self
.
dbname
}
'
)
tdSql
.
execute
(
self
.
setsql
.
set_create_stable_sql
(
stbname
,
self
.
column_dict
,
tag_dict
))
for
i
in
range
(
self
.
tbnum
):
...
...
@@ -116,7 +116,7 @@ class TDTestCase:
tdSql
.
checkRows
(
self
.
tbnum
)
tdSql
.
execute
(
f
'drop database
{
self
.
dbname
}
'
)
def
drop_topic_check
(
self
):
tdSql
.
execute
(
f
'create database
{
self
.
dbname
}
replica
{
self
.
replicaVar
}
'
)
tdSql
.
execute
(
f
'create database
{
self
.
dbname
}
replica
{
self
.
replicaVar
}
wal_retention_period 3600
'
)
tdSql
.
execute
(
f
'use
{
self
.
dbname
}
'
)
stbname
=
tdCom
.
getLongName
(
5
,
"letters"
)
topic_name
=
tdCom
.
getLongName
(
5
,
"letters"
)
...
...
@@ -132,7 +132,7 @@ class TDTestCase:
tdSql
.
execute
(
f
'drop database
{
self
.
dbname
}
'
)
def
drop_stream_check
(
self
):
tdSql
.
execute
(
f
'create database
{
self
.
dbname
}
replica 1'
)
tdSql
.
execute
(
f
'create database
{
self
.
dbname
}
replica 1
wal_retention_period 3600
'
)
tdSql
.
execute
(
f
'use
{
self
.
dbname
}
'
)
stbname
=
tdCom
.
getLongName
(
5
,
"letters"
)
stream_name
=
tdCom
.
getLongName
(
5
,
"letters"
)
...
...
tests/system-test/7-tmq/basic5.py
浏览文件 @
19883fde
...
...
@@ -57,7 +57,7 @@ class TDTestCase:
return
cur
def
create_tables
(
self
,
tsql
,
dbName
,
vgroups
,
stbName
,
ctbNum
,
rowsPerTbl
):
tsql
.
execute
(
"create database if not exists %s vgroups %d"
%
(
dbName
,
vgroups
))
tsql
.
execute
(
"create database if not exists %s vgroups %d
wal_retention_period 3600
"
%
(
dbName
,
vgroups
))
tsql
.
execute
(
"use %s"
%
dbName
)
tsql
.
execute
(
"create table if not exists %s (ts timestamp, c1 bigint, c2 binary(16)) tags(t1 int)"
%
stbName
)
pre_create
=
"create table"
...
...
@@ -149,6 +149,7 @@ class TDTestCase:
topicFromStb
=
'topic_stb_column'
topicFromCtb
=
'topic_ctb_column'
tdSql
.
execute
(
"alter database %s wal_retention_period 3600"
%
(
parameterDict
[
'dbName'
]))
tdSql
.
execute
(
"create topic %s as select ts, c1, c2 from %s.%s"
%
(
topicFromStb
,
parameterDict
[
'dbName'
],
parameterDict
[
'stbName'
]))
tdSql
.
execute
(
"create topic %s as select ts, c1, c2 from %s.%s_0"
%
(
topicFromCtb
,
parameterDict
[
'dbName'
],
parameterDict
[
'stbName'
]))
...
...
tests/system-test/7-tmq/create_wrong_topic.py
浏览文件 @
19883fde
...
...
@@ -44,6 +44,7 @@ class TDTestCase:
def
wrong_topic
(
self
):
tdSql
.
prepare
()
tdSql
.
execute
(
'use db'
)
tdSql
.
execute
(
'alter database db wal_retention_period 3600'
)
stbname
=
f
'db.
{
tdCom
.
getLongName
(
5
,
"letters"
)
}
'
tag_dict
=
{
't0'
:
'int'
...
...
@@ -75,4 +76,4 @@ class TDTestCase:
tdLog
.
success
(
f
"
{
__file__
}
successfully executed"
)
tdCases
.
addLinux
(
__file__
,
TDTestCase
())
tdCases
.
addWindows
(
__file__
,
TDTestCase
())
\ No newline at end of file
tdCases
.
addWindows
(
__file__
,
TDTestCase
())
tests/system-test/7-tmq/dataFromTsdbNWal-multiCtb.py
浏览文件 @
19883fde
...
...
@@ -67,6 +67,7 @@ class TDTestCase:
tdLog
.
info
(
"flush db to let data falls into the disk"
)
tdSql
.
query
(
"flush database %s"
%
(
paraDict
[
'dbName'
]))
tdSql
.
execute
(
"alter database %s wal_retention_period 3600"
%
(
paraDict
[
'dbName'
]))
return
def
tmqCase1
(
self
):
...
...
tests/system-test/7-tmq/dataFromTsdbNWal.py
浏览文件 @
19883fde
...
...
@@ -67,6 +67,7 @@ class TDTestCase:
tdLog
.
info
(
"flush db to let data falls into the disk"
)
tdSql
.
query
(
"flush database %s"
%
(
paraDict
[
'dbName'
]))
tdSql
.
execute
(
"alter database %s wal_retention_period 3600"
%
(
paraDict
[
'dbName'
]))
return
def
tmqCase1
(
self
):
...
...
tests/system-test/7-tmq/db.py
浏览文件 @
19883fde
...
...
@@ -60,7 +60,7 @@ class TDTestCase:
def
initConsumerTable
(
self
,
cdbName
=
'cdb'
):
tdLog
.
info
(
"create consume database, and consume info table, and consume result table"
)
tdSql
.
query
(
"drop database if exists %s "
%
(
cdbName
))
tdSql
.
query
(
"create database %s vgroups 1"
%
(
cdbName
))
tdSql
.
query
(
"create database %s vgroups 1
wal_retention_period 3600
"
%
(
cdbName
))
tdSql
.
query
(
"drop table if exists %s.consumeinfo "
%
(
cdbName
))
tdSql
.
query
(
"drop table if exists %s.consumeresult "
%
(
cdbName
))
...
...
tests/system-test/7-tmq/dropDbR3ConflictTransaction.py
浏览文件 @
19883fde
...
...
@@ -134,6 +134,7 @@ class TDTestCase:
paraDict
[
'ctbNum'
]
=
self
.
ctbNum
paraDict
[
'rowsPerTbl'
]
=
self
.
rowsPerTbl
tdSql
.
execute
(
"alter database dbt wal_retention_period 3600"
)
tdLog
.
info
(
"create topics from stb1"
)
topicFromStb1
=
'topic_stb1'
queryString
=
"select ts, c1, c2 from %s.%s where t4 == 'beijing' or t4 == 'changsha' "
%
(
paraDict
[
'dbName'
],
paraDict
[
'stbName'
])
...
...
tests/system-test/7-tmq/schema.py
浏览文件 @
19883fde
...
...
@@ -60,7 +60,7 @@ class TDTestCase:
def
initConsumerTable
(
self
,
cdbName
=
'cdb'
):
tdLog
.
info
(
"create consume database, and consume info table, and consume result table"
)
tdSql
.
query
(
"drop database if exists %s "
%
(
cdbName
))
tdSql
.
query
(
"create database %s vgroups 1"
%
(
cdbName
))
tdSql
.
query
(
"create database %s vgroups 1
wal_retention_period 3600
"
%
(
cdbName
))
tdSql
.
query
(
"drop table if exists %s.consumeinfo "
%
(
cdbName
))
tdSql
.
query
(
"drop table if exists %s.consumeresult "
%
(
cdbName
))
...
...
@@ -115,7 +115,7 @@ class TDTestCase:
if
dropFlag
==
1
:
tsql
.
execute
(
"drop database if exists %s"
%
(
dbName
))
tsql
.
execute
(
"create database if not exists %s vgroups %d replica %d"
%
(
dbName
,
vgroups
,
replica
))
tsql
.
execute
(
"create database if not exists %s vgroups %d replica %d
wal_retention_period 3600
"
%
(
dbName
,
vgroups
,
replica
))
tdLog
.
debug
(
"complete to create database %s"
%
(
dbName
))
return
...
...
tests/system-test/7-tmq/stbFilter.py
浏览文件 @
19883fde
...
...
@@ -45,6 +45,7 @@ class TDTestCase:
tmqCom
.
initConsumerTable
()
tmqCom
.
create_database
(
tsql
=
tdSql
,
dbName
=
paraDict
[
"dbName"
],
dropFlag
=
paraDict
[
"dropFlag"
],
vgroups
=
paraDict
[
'vgroups'
],
replica
=
paraDict
[
'replica'
])
tdSql
.
execute
(
"alter database %s wal_retention_period 3600"
%
(
paraDict
[
"dbName"
]))
tdLog
.
info
(
"create stb"
)
tmqCom
.
create_stable
(
tdSql
,
dbName
=
paraDict
[
"dbName"
],
stbName
=
paraDict
[
"stbName"
])
tdLog
.
info
(
"create ctb"
)
...
...
tests/system-test/7-tmq/stbTagFilter-1ctb.py
浏览文件 @
19883fde
...
...
@@ -106,6 +106,7 @@ class TDTestCase:
# ctbNum=paraDict["ctbNum"],rowsPerTbl=paraDict["rowsPerTbl"],batchNum=paraDict["batchNum"],
# startTs=paraDict["startTs"],ctbStartIdx=paraDict['ctbStartIdx'])
tdSql
.
execute
(
"alter database dbt wal_retention_period 3600"
)
tdLog
.
info
(
"create topics from stb1"
)
topicFromStb1
=
'topic_UpperCase_stb1'
# queryString = "select ts, c1, c2 from %s.%s where t4 == 'shanghai' or t4 == 'changsha'"%(paraDict['dbName'], paraDict['stbName'])
...
...
tests/system-test/7-tmq/stbTagFilter-multiCtb.py
浏览文件 @
19883fde
...
...
@@ -54,6 +54,7 @@ class TDTestCase:
tmqCom
.
initConsumerTable
()
tdCom
.
create_database
(
tdSql
,
paraDict
[
"dbName"
],
paraDict
[
"dropFlag"
],
vgroups
=
paraDict
[
"vgroups"
],
replica
=
1
)
tdSql
.
execute
(
"alter database %s wal_retention_period 3600"
%
(
paraDict
[
'dbName'
]))
tdLog
.
info
(
"create stb"
)
tmqCom
.
create_stable
(
tdSql
,
dbName
=
paraDict
[
"dbName"
],
stbName
=
paraDict
[
"stbName"
])
tdLog
.
info
(
"create ctb"
)
...
...
tests/system-test/7-tmq/subscribeDb.py
浏览文件 @
19883fde
...
...
@@ -52,7 +52,7 @@ class TDTestCase:
def
initConsumerTable
(
self
,
cdbName
=
'cdb'
):
tdLog
.
info
(
"create consume database, and consume info table, and consume result table"
)
tdSql
.
query
(
"create database if not exists %s vgroups 1"
%
(
cdbName
))
tdSql
.
query
(
"create database if not exists %s vgroups 1
wal_retention_period 3600
"
%
(
cdbName
))
tdSql
.
query
(
"drop table if exists %s.consumeinfo "
%
(
cdbName
))
tdSql
.
query
(
"drop table if exists %s.consumeresult "
%
(
cdbName
))
...
...
@@ -99,7 +99,7 @@ class TDTestCase:
os
.
system
(
shellCmd
)
def
create_tables
(
self
,
tsql
,
dbName
,
vgroups
,
stbName
,
ctbNum
):
tsql
.
execute
(
"create database if not exists %s vgroups %d"
%
(
dbName
,
vgroups
))
tsql
.
execute
(
"create database if not exists %s vgroups %d
wal_retention_period 3600
"
%
(
dbName
,
vgroups
))
tsql
.
execute
(
"use %s"
%
dbName
)
tsql
.
execute
(
"create table if not exists %s (ts timestamp, c1 bigint, c2 binary(16)) tags(t1 int)"
%
stbName
)
pre_create
=
"create table"
...
...
@@ -180,7 +180,7 @@ class TDTestCase:
self
.
initConsumerTable
()
tdSql
.
execute
(
"create database if not exists %s vgroups %d replica %d"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'vgroups'
],
parameterDict
[
'replica'
]))
tdSql
.
execute
(
"create database if not exists %s vgroups %d replica %d
wal_retention_period 3600
"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'vgroups'
],
parameterDict
[
'replica'
]))
prepareEnvThread
=
threading
.
Thread
(
target
=
self
.
prepareEnv
,
kwargs
=
parameterDict
)
prepareEnvThread
.
start
()
...
...
@@ -278,7 +278,7 @@ class TDTestCase:
self
.
initConsumerTable
()
tdSql
.
execute
(
"create database if not exists %s vgroups %d replica %d"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'vgroups'
],
parameterDict
[
'replica'
]))
tdSql
.
execute
(
"create database if not exists %s vgroups %d replica %d
wal_retention_period 3600
"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'vgroups'
],
parameterDict
[
'replica'
]))
prepareEnvThread
=
threading
.
Thread
(
target
=
self
.
prepareEnv
,
kwargs
=
parameterDict
)
prepareEnvThread
.
start
()
...
...
@@ -345,7 +345,7 @@ class TDTestCase:
self
.
initConsumerTable
()
tdSql
.
execute
(
"create database if not exists %s vgroups %d"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'vgroups'
]))
tdSql
.
execute
(
"create database if not exists %s vgroups %d
wal_retention_period 3600
"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'vgroups'
]))
tdSql
.
execute
(
"create table if not exists %s.%s (ts timestamp, c1 bigint, c2 binary(16)) tags(t1 int)"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'stbName'
]))
tdLog
.
info
(
"create topics from db"
)
...
...
@@ -415,7 +415,7 @@ class TDTestCase:
self
.
initConsumerTable
()
tdSql
.
execute
(
"create database if not exists %s vgroups %d replica %d"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'vgroups'
],
parameterDict
[
'replica'
]))
tdSql
.
execute
(
"create database if not exists %s vgroups %d replica %d
wal_retention_period 3600
"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'vgroups'
],
parameterDict
[
'replica'
]))
prepareEnvThread
=
threading
.
Thread
(
target
=
self
.
prepareEnv
,
kwargs
=
parameterDict
)
prepareEnvThread
.
start
()
...
...
tests/system-test/7-tmq/subscribeDb0.py
浏览文件 @
19883fde
...
...
@@ -52,7 +52,7 @@ class TDTestCase:
def
initConsumerTable
(
self
,
cdbName
=
'cdb'
):
tdLog
.
info
(
"create consume database, and consume info table, and consume result table"
)
tdSql
.
query
(
"create database if not exists %s vgroups 1"
%
(
cdbName
))
tdSql
.
query
(
"create database if not exists %s vgroups 1
wal_retention_period 3600
"
%
(
cdbName
))
tdSql
.
query
(
"drop table if exists %s.consumeinfo "
%
(
cdbName
))
tdSql
.
query
(
"drop table if exists %s.consumeresult "
%
(
cdbName
))
...
...
@@ -99,7 +99,7 @@ class TDTestCase:
os
.
system
(
shellCmd
)
def
create_tables
(
self
,
tsql
,
dbName
,
vgroups
,
stbName
,
ctbNum
):
tsql
.
execute
(
"create database if not exists %s vgroups %d"
%
(
dbName
,
vgroups
))
tsql
.
execute
(
"create database if not exists %s vgroups %d
wal_retention_period 3600
"
%
(
dbName
,
vgroups
))
tsql
.
execute
(
"use %s"
%
dbName
)
tsql
.
execute
(
"create table if not exists %s (ts timestamp, c1 bigint, c2 binary(16)) tags(t1 int)"
%
stbName
)
pre_create
=
"create table"
...
...
@@ -180,7 +180,7 @@ class TDTestCase:
self
.
initConsumerTable
()
tdSql
.
execute
(
"create database if not exists %s vgroups %d replica %d"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'vgroups'
],
parameterDict
[
'replica'
]))
tdSql
.
execute
(
"create database if not exists %s vgroups %d replica %d
wal_retention_period 3600
"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'vgroups'
],
parameterDict
[
'replica'
]))
prepareEnvThread
=
threading
.
Thread
(
target
=
self
.
prepareEnv
,
kwargs
=
parameterDict
)
prepareEnvThread
.
start
()
...
...
@@ -262,7 +262,7 @@ class TDTestCase:
self
.
initConsumerTable
()
tdSql
.
execute
(
"create database if not exists %s vgroups %d replica %d"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'vgroups'
],
parameterDict
[
'replica'
]))
tdSql
.
execute
(
"create database if not exists %s vgroups %d replica %d
wal_retention_period 3600
"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'vgroups'
],
parameterDict
[
'replica'
]))
prepareEnvThread
=
threading
.
Thread
(
target
=
self
.
prepareEnv
,
kwargs
=
parameterDict
)
prepareEnvThread
.
start
()
...
...
tests/system-test/7-tmq/subscribeDb1.py
浏览文件 @
19883fde
...
...
@@ -52,7 +52,7 @@ class TDTestCase:
def
initConsumerTable
(
self
,
cdbName
=
'cdb'
):
tdLog
.
info
(
"create consume database, and consume info table, and consume result table"
)
tdSql
.
query
(
"create database if not exists %s vgroups 1"
%
(
cdbName
))
tdSql
.
query
(
"create database if not exists %s vgroups 1
wal_retention_period 3600
"
%
(
cdbName
))
tdSql
.
query
(
"drop table if exists %s.consumeinfo "
%
(
cdbName
))
tdSql
.
query
(
"drop table if exists %s.consumeresult "
%
(
cdbName
))
...
...
@@ -99,7 +99,7 @@ class TDTestCase:
os
.
system
(
shellCmd
)
def
create_tables
(
self
,
tsql
,
dbName
,
vgroups
,
stbName
,
ctbNum
):
tsql
.
execute
(
"create database if not exists %s vgroups %d"
%
(
dbName
,
vgroups
))
tsql
.
execute
(
"create database if not exists %s vgroups %d
wal_retention_period 3600
"
%
(
dbName
,
vgroups
))
tsql
.
execute
(
"use %s"
%
dbName
)
tsql
.
execute
(
"create table if not exists %s (ts timestamp, c1 bigint, c2 binary(16)) tags(t1 int)"
%
stbName
)
pre_create
=
"create table"
...
...
@@ -179,8 +179,8 @@ class TDTestCase:
parameterDict
[
'cfg'
]
=
cfgPath
self
.
initConsumerTable
()
tdLog
.
info
(
"create database if not exists %s vgroups %d replica %d"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'vgroups'
],
parameterDict
[
'replica'
]))
tdSql
.
execute
(
"create database if not exists %s vgroups %d replica %d"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'vgroups'
],
parameterDict
[
'replica'
]))
tdLog
.
info
(
"create database if not exists %s vgroups %d replica %d
wal_retention_period 3600
"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'vgroups'
],
parameterDict
[
'replica'
]))
tdSql
.
execute
(
"create database if not exists %s vgroups %d replica %d
wal_retention_period 3600
"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'vgroups'
],
parameterDict
[
'replica'
]))
prepareEnvThread
=
threading
.
Thread
(
target
=
self
.
prepareEnv
,
kwargs
=
parameterDict
)
prepareEnvThread
.
start
()
...
...
@@ -196,7 +196,7 @@ class TDTestCase:
'startTs'
:
1640966400000
}
# 2022-01-01 00:00:00.000
parameterDict
[
'cfg'
]
=
cfgPath
tdSql
.
execute
(
"create database if not exists %s vgroups %d replica %d"
%
(
parameterDict2
[
'dbName'
],
parameterDict2
[
'vgroups'
],
parameterDict2
[
'replica'
]))
tdSql
.
execute
(
"create database if not exists %s vgroups %d replica %d
wal_retention_period 3600
"
%
(
parameterDict2
[
'dbName'
],
parameterDict2
[
'vgroups'
],
parameterDict2
[
'replica'
]))
prepareEnvThread2
=
threading
.
Thread
(
target
=
self
.
prepareEnv
,
kwargs
=
parameterDict2
)
prepareEnvThread2
.
start
()
...
...
@@ -267,7 +267,7 @@ class TDTestCase:
self
.
initConsumerTable
()
tdSql
.
execute
(
"create database if not exists %s vgroups %d replica %d"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'vgroups'
],
parameterDict
[
'replica'
]))
tdSql
.
execute
(
"create database if not exists %s vgroups %d replica %d
wal_retention_period 3600
"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'vgroups'
],
parameterDict
[
'replica'
]))
prepareEnvThread
=
threading
.
Thread
(
target
=
self
.
prepareEnv
,
kwargs
=
parameterDict
)
prepareEnvThread
.
start
()
...
...
@@ -283,7 +283,7 @@ class TDTestCase:
'startTs'
:
1640966400000
}
# 2022-01-01 00:00:00.000
parameterDict
[
'cfg'
]
=
cfgPath
tdSql
.
execute
(
"create database if not exists %s vgroups %d replica %d"
%
(
parameterDict2
[
'dbName'
],
parameterDict2
[
'vgroups'
],
parameterDict2
[
'replica'
]))
tdSql
.
execute
(
"create database if not exists %s vgroups %d replica %d
wal_retention_period 3600
"
%
(
parameterDict2
[
'dbName'
],
parameterDict2
[
'vgroups'
],
parameterDict2
[
'replica'
]))
prepareEnvThread2
=
threading
.
Thread
(
target
=
self
.
prepareEnv
,
kwargs
=
parameterDict2
)
prepareEnvThread2
.
start
()
...
...
tests/system-test/7-tmq/subscribeDb2.py
浏览文件 @
19883fde
...
...
@@ -53,7 +53,7 @@ class TDTestCase:
def
initConsumerTable
(
self
,
cdbName
=
'cdb'
):
tdLog
.
info
(
"create consume database, and consume info table, and consume result table"
)
tdSql
.
query
(
"create database if not exists %s vgroups 1"
%
(
cdbName
))
tdSql
.
query
(
"create database if not exists %s vgroups 1
wal_retention_period 3600
"
%
(
cdbName
))
tdSql
.
query
(
"drop table if exists %s.consumeinfo "
%
(
cdbName
))
tdSql
.
query
(
"drop table if exists %s.consumeresult "
%
(
cdbName
))
...
...
@@ -100,7 +100,7 @@ class TDTestCase:
os
.
system
(
shellCmd
)
def
create_tables
(
self
,
tsql
,
dbName
,
vgroups
,
stbName
,
ctbNum
,
rowsPerTbl
):
tsql
.
execute
(
"create database if not exists %s vgroups %d"
%
(
dbName
,
vgroups
))
tsql
.
execute
(
"create database if not exists %s vgroups %d
wal_retention_period 3600
"
%
(
dbName
,
vgroups
))
tsql
.
execute
(
"use %s"
%
dbName
)
tsql
.
execute
(
"create table if not exists %s (ts timestamp, c1 bigint, c2 binary(16)) tags(t1 int)"
%
stbName
)
pre_create
=
"create table"
...
...
@@ -185,7 +185,7 @@ class TDTestCase:
self
.
initConsumerTable
()
tdSql
.
execute
(
"create database if not exists %s vgroups %d"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'vgroups'
]))
tdSql
.
execute
(
"create database if not exists %s vgroups %d
wal_retention_period 3600
"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'vgroups'
]))
prepareEnvThread
=
threading
.
Thread
(
target
=
self
.
prepareEnv
,
kwargs
=
parameterDict
)
prepareEnvThread
.
start
()
...
...
@@ -263,7 +263,7 @@ class TDTestCase:
self
.
initConsumerTable
()
tdSql
.
execute
(
"create database if not exists %s vgroups %d"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'vgroups'
]))
tdSql
.
execute
(
"create database if not exists %s vgroups %d
wal_retention_period 3600
"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'vgroups'
]))
prepareEnvThread
=
threading
.
Thread
(
target
=
self
.
prepareEnv
,
kwargs
=
parameterDict
)
prepareEnvThread
.
start
()
...
...
tests/system-test/7-tmq/subscribeDb3.py
浏览文件 @
19883fde
...
...
@@ -52,7 +52,7 @@ class TDTestCase:
def
initConsumerTable
(
self
,
cdbName
=
'cdb'
):
tdLog
.
info
(
"create consume database, and consume info table, and consume result table"
)
tdSql
.
query
(
"create database if not exists %s vgroups 1"
%
(
cdbName
))
tdSql
.
query
(
"create database if not exists %s vgroups 1
wal_retention_period 3600
"
%
(
cdbName
))
tdSql
.
query
(
"drop table if exists %s.consumeinfo "
%
(
cdbName
))
tdSql
.
query
(
"drop table if exists %s.consumeresult "
%
(
cdbName
))
tdSql
.
query
(
"drop table if exists %s.notifyinfo "
%
(
cdbName
))
...
...
@@ -122,7 +122,7 @@ class TDTestCase:
os
.
system
(
shellCmd
)
def
create_tables
(
self
,
tsql
,
dbName
,
vgroups
,
stbName
,
ctbNum
,
rowsPerTbl
):
tsql
.
execute
(
"create database if not exists %s vgroups %d"
%
(
dbName
,
vgroups
))
tsql
.
execute
(
"create database if not exists %s vgroups %d
wal_retention_period 3600
"
%
(
dbName
,
vgroups
))
tsql
.
execute
(
"use %s"
%
dbName
)
tsql
.
execute
(
"create table if not exists %s (ts timestamp, c1 bigint, c2 binary(16)) tags(t1 int)"
%
stbName
)
pre_create
=
"create table"
...
...
@@ -203,7 +203,7 @@ class TDTestCase:
self
.
initConsumerTable
()
tdSql
.
execute
(
"create database if not exists %s vgroups %d"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'vgroups'
]))
tdSql
.
execute
(
"create database if not exists %s vgroups %d
wal_retention_period 3600
"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'vgroups'
]))
prepareEnvThread
=
threading
.
Thread
(
target
=
self
.
prepareEnv
,
kwargs
=
parameterDict
)
prepareEnvThread
.
start
()
...
...
@@ -280,7 +280,7 @@ class TDTestCase:
self
.
initConsumerTable
()
tdSql
.
execute
(
"create database if not exists %s vgroups %d"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'vgroups'
]))
tdSql
.
execute
(
"create database if not exists %s vgroups %d
wal_retention_period 3600
"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'vgroups'
]))
prepareEnvThread
=
threading
.
Thread
(
target
=
self
.
prepareEnv
,
kwargs
=
parameterDict
)
prepareEnvThread
.
start
()
...
...
tests/system-test/7-tmq/subscribeDb4.py
浏览文件 @
19883fde
...
...
@@ -65,6 +65,7 @@ class TDTestCase:
tmqCom
.
initConsumerTable
(
self
.
cdbName
)
tdCom
.
create_database
(
tdSql
,
self
.
paraDict
[
"dbName"
],
self
.
paraDict
[
"dropFlag"
])
tdSql
.
execute
(
"alter database %s wal_retention_period 3600"
%
(
self
.
paraDict
[
'dbName'
]))
self
.
paraDict
[
"stbName"
]
=
'stb1'
tdCom
.
create_stable
(
tdSql
,
dbname
=
self
.
paraDict
[
"dbName"
],
stbname
=
self
.
paraDict
[
"stbName"
],
column_elm_list
=
self
.
paraDict
[
"colSchema"
],
tag_elm_list
=
self
.
paraDict
[
"tagSchema"
],
count
=
1
,
default_stbname_prefix
=
self
.
paraDict
[
"stbName"
])
...
...
tests/system-test/7-tmq/subscribeStb.py
浏览文件 @
19883fde
...
...
@@ -59,7 +59,7 @@ class TDTestCase:
def
initConsumerTable
(
self
,
cdbName
=
'cdb'
):
tdLog
.
info
(
"create consume database, and consume info table, and consume result table"
)
tdSql
.
query
(
"create database if not exists %s vgroups 1"
%
(
cdbName
))
tdSql
.
query
(
"create database if not exists %s vgroups 1
wal_retention_period 3600
"
%
(
cdbName
))
tdSql
.
query
(
"drop table if exists %s.consumeinfo "
%
(
cdbName
))
tdSql
.
query
(
"drop table if exists %s.consumeresult "
%
(
cdbName
))
...
...
@@ -114,7 +114,7 @@ class TDTestCase:
if
dropFlag
==
1
:
tsql
.
execute
(
"drop database if exists %s"
%
(
dbName
))
tsql
.
execute
(
"create database if not exists %s vgroups %d replica %d"
%
(
dbName
,
vgroups
,
replica
))
tsql
.
execute
(
"create database if not exists %s vgroups %d replica %d
wal_retention_period 3600
"
%
(
dbName
,
vgroups
,
replica
))
tdLog
.
debug
(
"complete to create database %s"
%
(
dbName
))
return
...
...
tests/system-test/7-tmq/subscribeStb0.py
浏览文件 @
19883fde
...
...
@@ -59,7 +59,7 @@ class TDTestCase:
def
initConsumerTable
(
self
,
cdbName
=
'cdb'
):
tdLog
.
info
(
"create consume database, and consume info table, and consume result table"
)
tdSql
.
query
(
"create database if not exists %s vgroups 1"
%
(
cdbName
))
tdSql
.
query
(
"create database if not exists %s vgroups 1
wal_retention_period 3600
"
%
(
cdbName
))
tdSql
.
query
(
"drop table if exists %s.consumeinfo "
%
(
cdbName
))
tdSql
.
query
(
"drop table if exists %s.consumeresult "
%
(
cdbName
))
...
...
@@ -114,7 +114,7 @@ class TDTestCase:
if
dropFlag
==
1
:
tsql
.
execute
(
"drop database if exists %s"
%
(
dbName
))
tsql
.
execute
(
"create database if not exists %s vgroups %d replica %d"
%
(
dbName
,
vgroups
,
replica
))
tsql
.
execute
(
"create database if not exists %s vgroups %d replica %d
wal_retention_period 3600
"
%
(
dbName
,
vgroups
,
replica
))
tdLog
.
debug
(
"complete to create database %s"
%
(
dbName
))
return
...
...
tests/system-test/7-tmq/subscribeStb1.py
浏览文件 @
19883fde
...
...
@@ -59,7 +59,7 @@ class TDTestCase:
def
initConsumerTable
(
self
,
cdbName
=
'cdb'
):
tdLog
.
info
(
"create consume database, and consume info table, and consume result table"
)
tdSql
.
query
(
"create database if not exists %s vgroups 1"
%
(
cdbName
))
tdSql
.
query
(
"create database if not exists %s vgroups 1
wal_retention_period 3600
"
%
(
cdbName
))
tdSql
.
query
(
"drop table if exists %s.consumeinfo "
%
(
cdbName
))
tdSql
.
query
(
"drop table if exists %s.consumeresult "
%
(
cdbName
))
...
...
@@ -114,7 +114,7 @@ class TDTestCase:
if
dropFlag
==
1
:
tsql
.
execute
(
"drop database if exists %s"
%
(
dbName
))
tsql
.
execute
(
"create database if not exists %s vgroups %d replica %d"
%
(
dbName
,
vgroups
,
replica
))
tsql
.
execute
(
"create database if not exists %s vgroups %d replica %d
wal_retention_period 3600
"
%
(
dbName
,
vgroups
,
replica
))
tdLog
.
debug
(
"complete to create database %s"
%
(
dbName
))
return
...
...
tests/system-test/7-tmq/subscribeStb2.py
浏览文件 @
19883fde
...
...
@@ -59,7 +59,7 @@ class TDTestCase:
def
initConsumerTable
(
self
,
cdbName
=
'cdb'
):
tdLog
.
info
(
"create consume database, and consume info table, and consume result table"
)
tdSql
.
query
(
"create database if not exists %s vgroups 1"
%
(
cdbName
))
tdSql
.
query
(
"create database if not exists %s vgroups 1
wal_retention_period 3600
"
%
(
cdbName
))
tdSql
.
query
(
"drop table if exists %s.consumeinfo "
%
(
cdbName
))
tdSql
.
query
(
"drop table if exists %s.consumeresult "
%
(
cdbName
))
...
...
@@ -114,7 +114,7 @@ class TDTestCase:
if
dropFlag
==
1
:
tsql
.
execute
(
"drop database if exists %s"
%
(
dbName
))
tsql
.
execute
(
"create database if not exists %s vgroups %d replica %d"
%
(
dbName
,
vgroups
,
replica
))
tsql
.
execute
(
"create database if not exists %s vgroups %d replica %d
wal_retention_period 3600
"
%
(
dbName
,
vgroups
,
replica
))
tdLog
.
debug
(
"complete to create database %s"
%
(
dbName
))
return
...
...
tests/system-test/7-tmq/subscribeStb3.py
浏览文件 @
19883fde
...
...
@@ -59,7 +59,7 @@ class TDTestCase:
def
initConsumerTable
(
self
,
cdbName
=
'cdb'
):
tdLog
.
info
(
"create consume database, and consume info table, and consume result table"
)
tdSql
.
query
(
"create database if not exists %s vgroups 1"
%
(
cdbName
))
tdSql
.
query
(
"create database if not exists %s vgroups 1
wal_retention_period 3600
"
%
(
cdbName
))
tdSql
.
query
(
"drop table if exists %s.consumeinfo "
%
(
cdbName
))
tdSql
.
query
(
"drop table if exists %s.consumeresult "
%
(
cdbName
))
...
...
@@ -114,7 +114,7 @@ class TDTestCase:
if
dropFlag
==
1
:
tsql
.
execute
(
"drop database if exists %s"
%
(
dbName
))
tsql
.
execute
(
"create database if not exists %s vgroups %d replica %d"
%
(
dbName
,
vgroups
,
replica
))
tsql
.
execute
(
"create database if not exists %s vgroups %d replica %d
wal_retention_period 3600
"
%
(
dbName
,
vgroups
,
replica
))
tdLog
.
debug
(
"complete to create database %s"
%
(
dbName
))
return
...
...
tests/system-test/7-tmq/subscribeStb4.py
浏览文件 @
19883fde
...
...
@@ -59,7 +59,7 @@ class TDTestCase:
def
initConsumerTable
(
self
,
cdbName
=
'cdb'
):
tdLog
.
info
(
"create consume database, and consume info table, and consume result table"
)
tdSql
.
query
(
"create database if not exists %s vgroups 1"
%
(
cdbName
))
tdSql
.
query
(
"create database if not exists %s vgroups 1
wal_retention_period 3600
"
%
(
cdbName
))
tdSql
.
query
(
"drop table if exists %s.consumeinfo "
%
(
cdbName
))
tdSql
.
query
(
"drop table if exists %s.consumeresult "
%
(
cdbName
))
...
...
@@ -114,7 +114,7 @@ class TDTestCase:
if
dropFlag
==
1
:
tsql
.
execute
(
"drop database if exists %s"
%
(
dbName
))
tsql
.
execute
(
"create database if not exists %s vgroups %d replica %d"
%
(
dbName
,
vgroups
,
replica
))
tsql
.
execute
(
"create database if not exists %s vgroups %d replica %d
wal_retention_period 3600
"
%
(
dbName
,
vgroups
,
replica
))
tdLog
.
debug
(
"complete to create database %s"
%
(
dbName
))
return
...
...
tests/system-test/7-tmq/tmq3mnodeSwitch.py
浏览文件 @
19883fde
...
...
@@ -200,6 +200,7 @@ class TDTestCase:
tdLog
.
info
(
"async insert data"
)
pThread
=
tmqCom
.
asyncInsertData
(
paraDict
)
tdSql
.
execute
(
"alter database %s wal_retention_period 3600"
%
(
paraDict
[
'dbName'
]))
tdLog
.
info
(
"create topics from stb with filter"
)
# queryString = "select ts, log(c1), ceil(pow(c1,3)) from %s.%s where c1 %% 7 == 0" %(paraDict['dbName'], paraDict['stbName'])
...
...
tests/system-test/7-tmq/tmqAlterSchema.py
浏览文件 @
19883fde
...
...
@@ -65,6 +65,7 @@ class TDTestCase:
queryStringList
=
[]
tmqCom
.
initConsumerTable
()
tdCom
.
create_database
(
tdSql
,
paraDict
[
"dbName"
],
paraDict
[
"dropFlag"
],
vgroups
=
4
,
replica
=
1
)
tdSql
.
execute
(
"alter database %s wal_retention_period 3600"
%
(
paraDict
[
'dbName'
]))
tdLog
.
info
(
"create stb"
)
tdCom
.
create_stable
(
tdSql
,
dbname
=
paraDict
[
"dbName"
],
stbname
=
paraDict
[
"stbName"
],
column_elm_list
=
paraDict
[
'colSchema'
],
tag_elm_list
=
paraDict
[
'tagSchema'
])
tdLog
.
info
(
"create ctb"
)
...
...
@@ -175,6 +176,7 @@ class TDTestCase:
queryStringList
=
[]
tmqCom
.
initConsumerTable
()
tdCom
.
create_database
(
tdSql
,
paraDict
[
"dbName"
],
paraDict
[
"dropFlag"
],
vgroups
=
4
,
replica
=
1
)
tdSql
.
execute
(
"alter database %s wal_retention_period 3600"
%
(
paraDict
[
'dbName'
]))
tdLog
.
info
(
"create stb"
)
tdCom
.
create_stable
(
tdSql
,
dbname
=
paraDict
[
"dbName"
],
stbname
=
paraDict
[
"stbName"
],
column_elm_list
=
paraDict
[
'colSchema'
],
tag_elm_list
=
paraDict
[
'tagSchema'
])
tdLog
.
info
(
"create ntb"
)
...
...
tests/system-test/7-tmq/tmqAutoCreateTbl.py
浏览文件 @
19883fde
...
...
@@ -54,6 +54,7 @@ class TDTestCase:
tmqCom
.
initConsumerTable
()
tdCom
.
create_database
(
tdSql
,
paraDict
[
"dbName"
],
paraDict
[
"dropFlag"
],
vgroups
=
paraDict
[
"vgroups"
],
replica
=
1
,
wal_retention_size
=-
1
,
wal_retention_period
=-
1
)
tdSql
.
execute
(
"alter database %s wal_retention_period 3600"
%
(
paraDict
[
'dbName'
]))
tdLog
.
info
(
"create stb"
)
tmqCom
.
create_stable
(
tdSql
,
dbName
=
paraDict
[
"dbName"
],
stbName
=
paraDict
[
"stbName"
])
# tdLog.info("create ctb")
...
...
tests/system-test/7-tmq/tmqCheckData.py
浏览文件 @
19883fde
...
...
@@ -80,6 +80,7 @@ class TDTestCase:
tdLog
.
info
(
"insert data"
)
tmqCom
.
insert_data
(
tdSql
,
paraDict
[
"dbName"
],
paraDict
[
"ctbPrefix"
],
paraDict
[
"ctbNum"
],
paraDict
[
"rowsPerTbl"
],
paraDict
[
"batchNum"
],
paraDict
[
"startTs"
])
tdSql
.
execute
(
"alter database %s wal_retention_period 3600"
%
(
paraDict
[
'dbName'
]))
tdLog
.
info
(
"create topics from stb with filter"
)
queryString
=
"select ts, log(c1), ceil(pow(c1,3)) from %s.%s where c1 %% 7 == 0"
%
(
paraDict
[
'dbName'
],
paraDict
[
'stbName'
])
sqlString
=
"create topic %s as %s"
%
(
topicNameList
[
0
],
queryString
)
...
...
tests/system-test/7-tmq/tmqCheckData1.py
浏览文件 @
19883fde
...
...
@@ -73,6 +73,7 @@ class TDTestCase:
expectRowsList
=
[]
tmqCom
.
initConsumerTable
()
tdCom
.
create_database
(
tdSql
,
paraDict
[
"dbName"
],
paraDict
[
"dropFlag"
],
vgroups
=
4
,
replica
=
1
)
tdSql
.
execute
(
"alter database %s wal_retention_period 3600"
%
(
paraDict
[
'dbName'
]))
tdLog
.
info
(
"create stb"
)
tdCom
.
create_stable
(
tdSql
,
dbname
=
paraDict
[
"dbName"
],
stbname
=
paraDict
[
"stbName"
],
column_elm_list
=
paraDict
[
'colSchema'
],
tag_elm_list
=
paraDict
[
'tagSchema'
])
tdLog
.
info
(
"create ctb"
)
...
...
tests/system-test/7-tmq/tmqConsFromTsdb-1ctb-funcNFilter.py
浏览文件 @
19883fde
...
...
@@ -54,6 +54,7 @@ class TDTestCase:
tmqCom
.
initConsumerTable
()
tdCom
.
create_database
(
tdSql
,
paraDict
[
"dbName"
],
paraDict
[
"dropFlag"
],
vgroups
=
paraDict
[
"vgroups"
],
replica
=
1
)
tdSql
.
execute
(
"alter database %s wal_retention_period 3600"
%
(
paraDict
[
'dbName'
]))
tdLog
.
info
(
"create stb"
)
tmqCom
.
create_stable
(
tdSql
,
dbName
=
paraDict
[
"dbName"
],
stbName
=
paraDict
[
"stbName"
])
tdLog
.
info
(
"create ctb"
)
...
...
tests/system-test/7-tmq/tmqConsFromTsdb-1ctb.py
浏览文件 @
19883fde
...
...
@@ -54,6 +54,7 @@ class TDTestCase:
tmqCom
.
initConsumerTable
()
tdCom
.
create_database
(
tdSql
,
paraDict
[
"dbName"
],
paraDict
[
"dropFlag"
],
vgroups
=
paraDict
[
"vgroups"
],
replica
=
1
)
tdSql
.
execute
(
"alter database %s wal_retention_period 3600"
%
(
paraDict
[
'dbName'
]))
tdLog
.
info
(
"create stb"
)
tmqCom
.
create_stable
(
tdSql
,
dbName
=
paraDict
[
"dbName"
],
stbName
=
paraDict
[
"stbName"
])
tdLog
.
info
(
"create ctb"
)
...
...
tests/system-test/7-tmq/tmqConsFromTsdb-mutilVg-mutilCtb-funcNFilter.py
浏览文件 @
19883fde
...
...
@@ -54,6 +54,7 @@ class TDTestCase:
tmqCom
.
initConsumerTable
()
tdCom
.
create_database
(
tdSql
,
paraDict
[
"dbName"
],
paraDict
[
"dropFlag"
],
vgroups
=
paraDict
[
"vgroups"
],
replica
=
1
)
tdSql
.
execute
(
"alter database %s wal_retention_period 3600"
%
(
paraDict
[
'dbName'
]))
tdLog
.
info
(
"create stb"
)
tmqCom
.
create_stable
(
tdSql
,
dbName
=
paraDict
[
"dbName"
],
stbName
=
paraDict
[
"stbName"
])
tdLog
.
info
(
"create ctb"
)
...
...
tests/system-test/7-tmq/tmqConsFromTsdb-mutilVg-mutilCtb.py
浏览文件 @
19883fde
...
...
@@ -54,6 +54,7 @@ class TDTestCase:
tmqCom
.
initConsumerTable
()
tdCom
.
create_database
(
tdSql
,
paraDict
[
"dbName"
],
paraDict
[
"dropFlag"
],
vgroups
=
paraDict
[
"vgroups"
],
replica
=
1
)
tdSql
.
execute
(
"alter database %s wal_retention_period 3600"
%
(
paraDict
[
'dbName'
]))
tdLog
.
info
(
"create stb"
)
tmqCom
.
create_stable
(
tdSql
,
dbName
=
paraDict
[
"dbName"
],
stbName
=
paraDict
[
"stbName"
])
tdLog
.
info
(
"create ctb"
)
...
...
tests/system-test/7-tmq/tmqConsFromTsdb-mutilVg.py
浏览文件 @
19883fde
...
...
@@ -54,6 +54,7 @@ class TDTestCase:
tmqCom
.
initConsumerTable
()
tdCom
.
create_database
(
tdSql
,
paraDict
[
"dbName"
],
paraDict
[
"dropFlag"
],
vgroups
=
paraDict
[
"vgroups"
],
replica
=
1
)
tdSql
.
execute
(
"alter database %s wal_retention_period 3600"
%
(
paraDict
[
'dbName'
]))
tdLog
.
info
(
"create stb"
)
tmqCom
.
create_stable
(
tdSql
,
dbName
=
paraDict
[
"dbName"
],
stbName
=
paraDict
[
"stbName"
])
tdLog
.
info
(
"create ctb"
)
...
...
tests/system-test/7-tmq/tmqConsFromTsdb.py
浏览文件 @
19883fde
...
...
@@ -54,6 +54,7 @@ class TDTestCase:
tmqCom
.
initConsumerTable
()
tdCom
.
create_database
(
tdSql
,
paraDict
[
"dbName"
],
paraDict
[
"dropFlag"
],
vgroups
=
paraDict
[
"vgroups"
],
replica
=
self
.
replicaVar
)
tdSql
.
execute
(
"alter database %s wal_retention_period 3600"
%
(
paraDict
[
'dbName'
]))
tdLog
.
info
(
"create stb"
)
tmqCom
.
create_stable
(
tdSql
,
dbName
=
paraDict
[
"dbName"
],
stbName
=
paraDict
[
"stbName"
])
tdLog
.
info
(
"create ctb"
)
...
...
tests/system-test/7-tmq/tmqConsFromTsdb1-1ctb-funcNFilter.py
浏览文件 @
19883fde
...
...
@@ -54,6 +54,7 @@ class TDTestCase:
tmqCom
.
initConsumerTable
()
tdCom
.
create_database
(
tdSql
,
paraDict
[
"dbName"
],
paraDict
[
"dropFlag"
],
vgroups
=
paraDict
[
"vgroups"
],
replica
=
1
)
tdSql
.
execute
(
"alter database %s wal_retention_period 3600"
%
(
paraDict
[
'dbName'
]))
tdLog
.
info
(
"create stb"
)
tmqCom
.
create_stable
(
tdSql
,
dbName
=
paraDict
[
"dbName"
],
stbName
=
paraDict
[
"stbName"
])
tdLog
.
info
(
"create ctb"
)
...
...
tests/system-test/7-tmq/tmqConsFromTsdb1-1ctb.py
浏览文件 @
19883fde
...
...
@@ -54,6 +54,7 @@ class TDTestCase:
tmqCom
.
initConsumerTable
()
tdCom
.
create_database
(
tdSql
,
paraDict
[
"dbName"
],
paraDict
[
"dropFlag"
],
vgroups
=
paraDict
[
"vgroups"
],
replica
=
1
)
tdSql
.
execute
(
"alter database %s wal_retention_period 3600"
%
(
paraDict
[
'dbName'
]))
tdLog
.
info
(
"create stb"
)
tmqCom
.
create_stable
(
tdSql
,
dbName
=
paraDict
[
"dbName"
],
stbName
=
paraDict
[
"stbName"
])
tdLog
.
info
(
"create ctb"
)
...
...
tests/system-test/7-tmq/tmqConsFromTsdb1-mutilVg-mutilCtb-funcNFilter.py
浏览文件 @
19883fde
...
...
@@ -54,6 +54,7 @@ class TDTestCase:
tmqCom
.
initConsumerTable
()
tdCom
.
create_database
(
tdSql
,
paraDict
[
"dbName"
],
paraDict
[
"dropFlag"
],
vgroups
=
paraDict
[
"vgroups"
],
replica
=
1
)
tdSql
.
execute
(
"alter database %s wal_retention_period 3600"
%
(
paraDict
[
'dbName'
]))
tdLog
.
info
(
"create stb"
)
tmqCom
.
create_stable
(
tdSql
,
dbName
=
paraDict
[
"dbName"
],
stbName
=
paraDict
[
"stbName"
])
tdLog
.
info
(
"create ctb"
)
...
...
tests/system-test/7-tmq/tmqConsFromTsdb1-mutilVg-mutilCtb.py
浏览文件 @
19883fde
...
...
@@ -54,6 +54,7 @@ class TDTestCase:
tmqCom
.
initConsumerTable
()
tdCom
.
create_database
(
tdSql
,
paraDict
[
"dbName"
],
paraDict
[
"dropFlag"
],
vgroups
=
paraDict
[
"vgroups"
],
replica
=
1
)
tdSql
.
execute
(
"alter database %s wal_retention_period 3600"
%
(
paraDict
[
'dbName'
]))
tdLog
.
info
(
"create stb"
)
tmqCom
.
create_stable
(
tdSql
,
dbName
=
paraDict
[
"dbName"
],
stbName
=
paraDict
[
"stbName"
])
tdLog
.
info
(
"create ctb"
)
...
...
tests/system-test/7-tmq/tmqConsFromTsdb1-mutilVg.py
浏览文件 @
19883fde
...
...
@@ -54,6 +54,7 @@ class TDTestCase:
tmqCom
.
initConsumerTable
()
tdCom
.
create_database
(
tdSql
,
paraDict
[
"dbName"
],
paraDict
[
"dropFlag"
],
vgroups
=
paraDict
[
"vgroups"
],
replica
=
1
)
tdSql
.
execute
(
"alter database %s wal_retention_period 3600"
%
(
paraDict
[
'dbName'
]))
tdLog
.
info
(
"create stb"
)
tmqCom
.
create_stable
(
tdSql
,
dbName
=
paraDict
[
"dbName"
],
stbName
=
paraDict
[
"stbName"
])
tdLog
.
info
(
"create ctb"
)
...
...
tests/system-test/7-tmq/tmqConsFromTsdb1.py
浏览文件 @
19883fde
...
...
@@ -54,6 +54,7 @@ class TDTestCase:
tmqCom
.
initConsumerTable
()
tdCom
.
create_database
(
tdSql
,
paraDict
[
"dbName"
],
paraDict
[
"dropFlag"
],
vgroups
=
paraDict
[
"vgroups"
],
replica
=
self
.
replicaVar
)
tdSql
.
execute
(
"alter database %s wal_retention_period 3600"
%
(
paraDict
[
'dbName'
]))
tdLog
.
info
(
"create stb"
)
tmqCom
.
create_stable
(
tdSql
,
dbName
=
paraDict
[
"dbName"
],
stbName
=
paraDict
[
"stbName"
])
tdLog
.
info
(
"create ctb"
)
...
...
tests/system-test/7-tmq/tmqConsumerGroup.py
浏览文件 @
19883fde
...
...
@@ -73,6 +73,7 @@ class TDTestCase:
expectRowsList
=
[]
tmqCom
.
initConsumerTable
()
tdCom
.
create_database
(
tdSql
,
paraDict
[
"dbName"
],
paraDict
[
"dropFlag"
],
vgroups
=
4
,
replica
=
1
)
tdSql
.
execute
(
"alter database %s wal_retention_period 3600"
%
(
paraDict
[
'dbName'
]))
tdLog
.
info
(
"create stb"
)
tdCom
.
create_stable
(
tdSql
,
dbname
=
paraDict
[
"dbName"
],
stbname
=
paraDict
[
"stbName"
],
column_elm_list
=
paraDict
[
'colSchema'
],
tag_elm_list
=
paraDict
[
'tagSchema'
])
tdLog
.
info
(
"create ctb"
)
...
...
tests/system-test/7-tmq/tmqDelete-1ctb.py
浏览文件 @
19883fde
...
...
@@ -54,6 +54,7 @@ class TDTestCase:
tmqCom
.
initConsumerTable
()
tdCom
.
create_database
(
tdSql
,
paraDict
[
"dbName"
],
paraDict
[
"dropFlag"
],
vgroups
=
paraDict
[
"vgroups"
],
replica
=
1
,
wal_retention_size
=-
1
,
wal_retention_period
=-
1
)
tdSql
.
execute
(
"alter database %s wal_retention_period 3600"
%
(
paraDict
[
'dbName'
]))
tdLog
.
info
(
"create stb"
)
tmqCom
.
create_stable
(
tdSql
,
dbName
=
paraDict
[
"dbName"
],
stbName
=
paraDict
[
"stbName"
])
tdLog
.
info
(
"create ctb"
)
...
...
tests/system-test/7-tmq/tmqDelete-multiCtb.py
浏览文件 @
19883fde
...
...
@@ -54,6 +54,7 @@ class TDTestCase:
tmqCom
.
initConsumerTable
()
tdCom
.
create_database
(
tdSql
,
paraDict
[
"dbName"
],
paraDict
[
"dropFlag"
],
vgroups
=
paraDict
[
"vgroups"
],
replica
=
self
.
replicaVar
,
wal_retention_size
=-
1
,
wal_retention_period
=-
1
)
tdSql
.
execute
(
"alter database %s wal_retention_period 3600"
%
(
paraDict
[
'dbName'
]))
tdLog
.
info
(
"create stb"
)
tmqCom
.
create_stable
(
tdSql
,
dbName
=
paraDict
[
"dbName"
],
stbName
=
paraDict
[
"stbName"
])
tdLog
.
info
(
"create ctb"
)
...
...
tests/system-test/7-tmq/tmqDnode.py
浏览文件 @
19883fde
...
...
@@ -110,7 +110,7 @@ class TDTestCase:
if
dropFlag
==
1
:
tsql
.
execute
(
"drop database if exists %s"
%
(
dbName
))
tsql
.
execute
(
"create database if not exists %s vgroups %d replica %d"
%
(
dbName
,
vgroups
,
replica
))
tsql
.
execute
(
"create database if not exists %s vgroups %d replica %d
wal_retention_period 3600
"
%
(
dbName
,
vgroups
,
replica
))
tdLog
.
debug
(
"complete to create database %s"
%
(
dbName
))
return
...
...
tests/system-test/7-tmq/tmqDnodeRestart.py
浏览文件 @
19883fde
...
...
@@ -55,6 +55,7 @@ class TDTestCase:
tmqCom
.
initConsumerTable
()
tdCom
.
create_database
(
tdSql
,
paraDict
[
"dbName"
],
paraDict
[
"dropFlag"
],
vgroups
=
paraDict
[
"vgroups"
],
replica
=
1
,
wal_retention_size
=-
1
,
wal_retention_period
=-
1
)
tdSql
.
execute
(
"alter database %s wal_retention_period 3600"
%
(
paraDict
[
'dbName'
]))
tdLog
.
info
(
"create stb"
)
tmqCom
.
create_stable
(
tdSql
,
dbName
=
paraDict
[
"dbName"
],
stbName
=
paraDict
[
"stbName"
])
tdLog
.
info
(
"create ctb"
)
...
...
@@ -186,6 +187,7 @@ class TDTestCase:
tmqCom
.
initConsumerTable
()
# tdCom.create_database(tdSql, paraDict["dbName"],paraDict["dropFlag"], vgroups=paraDict["vgroups"],replica=1)
# tdSql.execute("alter database %s wal_retention_period 3600" % (paraDict['dbName']))
# tdLog.info("create stb")
# tmqCom.create_stable(tdSql, dbName=paraDict["dbName"],stbName=paraDict["stbName"])
# tdLog.info("create ctb")
...
...
tests/system-test/7-tmq/tmqDnodeRestart1.py
浏览文件 @
19883fde
...
...
@@ -54,6 +54,7 @@ class TDTestCase:
tmqCom
.
initConsumerTable
()
tdCom
.
create_database
(
tdSql
,
paraDict
[
"dbName"
],
paraDict
[
"dropFlag"
],
vgroups
=
paraDict
[
"vgroups"
],
replica
=
1
,
wal_retention_size
=-
1
,
wal_retention_period
=-
1
)
tdSql
.
execute
(
"alter database %s wal_retention_period 3600"
%
(
paraDict
[
'dbName'
]))
tdLog
.
info
(
"create stb"
)
tmqCom
.
create_stable
(
tdSql
,
dbName
=
paraDict
[
"dbName"
],
stbName
=
paraDict
[
"stbName"
])
tdLog
.
info
(
"create ctb"
)
...
...
tests/system-test/7-tmq/tmqDropNtb-snapshot0.py
浏览文件 @
19883fde
...
...
@@ -57,6 +57,7 @@ class TDTestCase:
tmqCom
.
initConsumerTable
()
tdLog
.
info
(
"start create database...."
)
tdCom
.
create_database
(
tdSql
,
paraDict
[
"dbName"
],
paraDict
[
"dropFlag"
],
vgroups
=
paraDict
[
"vgroups"
],
replica
=
1
)
tdSql
.
execute
(
"alter database %s wal_retention_period 3600"
%
(
paraDict
[
'dbName'
]))
tdLog
.
info
(
"start create normal tables...."
)
tmqCom
.
create_ntable
(
tsql
=
tdSql
,
dbname
=
paraDict
[
"dbName"
],
tbname_prefix
=
paraDict
[
"ctbPrefix"
],
tbname_index_start_num
=
1
,
column_elm_list
=
paraDict
[
"colSchema"
],
colPrefix
=
'c'
,
tblNum
=
paraDict
[
"ctbNum"
])
tdLog
.
info
(
"start insert data into normal tables...."
)
...
...
@@ -143,6 +144,7 @@ class TDTestCase:
tmqCom
.
initConsumerTable
()
tdLog
.
info
(
"start create database...."
)
tdCom
.
create_database
(
tdSql
,
paraDict
[
"dbName"
],
paraDict
[
"dropFlag"
],
vgroups
=
paraDict
[
"vgroups"
],
replica
=
1
)
tdSql
.
execute
(
"alter database %s wal_retention_period 3600"
%
(
paraDict
[
'dbName'
]))
tdLog
.
info
(
"start create normal tables...."
)
tmqCom
.
create_ntable
(
tsql
=
tdSql
,
dbname
=
paraDict
[
"dbName"
],
tbname_prefix
=
paraDict
[
"ctbPrefix"
],
tbname_index_start_num
=
1
,
column_elm_list
=
paraDict
[
"colSchema"
],
colPrefix
=
'c'
,
tblNum
=
paraDict
[
"ctbNum"
])
tdLog
.
info
(
"start insert data into normal tables...."
)
...
...
tests/system-test/7-tmq/tmqDropNtb-snapshot1.py
浏览文件 @
19883fde
...
...
@@ -57,6 +57,7 @@ class TDTestCase:
tmqCom
.
initConsumerTable
()
tdLog
.
info
(
"start create database...."
)
tdCom
.
create_database
(
tdSql
,
paraDict
[
"dbName"
],
paraDict
[
"dropFlag"
],
vgroups
=
paraDict
[
"vgroups"
],
replica
=
1
)
tdSql
.
execute
(
"alter database %s wal_retention_period 3600"
%
(
paraDict
[
'dbName'
]))
tdLog
.
info
(
"start create normal tables...."
)
tmqCom
.
create_ntable
(
tsql
=
tdSql
,
dbname
=
paraDict
[
"dbName"
],
tbname_prefix
=
paraDict
[
"ctbPrefix"
],
tbname_index_start_num
=
1
,
column_elm_list
=
paraDict
[
"colSchema"
],
colPrefix
=
'c'
,
tblNum
=
paraDict
[
"ctbNum"
])
tdLog
.
info
(
"start insert data into normal tables...."
)
...
...
@@ -143,6 +144,7 @@ class TDTestCase:
tmqCom
.
initConsumerTable
()
tdLog
.
info
(
"start create database...."
)
tdCom
.
create_database
(
tdSql
,
paraDict
[
"dbName"
],
paraDict
[
"dropFlag"
],
vgroups
=
paraDict
[
"vgroups"
],
replica
=
1
)
tdSql
.
execute
(
"alter database %s wal_retention_period 3600"
%
(
paraDict
[
'dbName'
]))
tdLog
.
info
(
"start create normal tables...."
)
tmqCom
.
create_ntable
(
tsql
=
tdSql
,
dbname
=
paraDict
[
"dbName"
],
tbname_prefix
=
paraDict
[
"ctbPrefix"
],
tbname_index_start_num
=
1
,
column_elm_list
=
paraDict
[
"colSchema"
],
colPrefix
=
'c'
,
tblNum
=
paraDict
[
"ctbNum"
])
tdLog
.
info
(
"start insert data into normal tables...."
)
...
...
tests/system-test/7-tmq/tmqDropStb.py
浏览文件 @
19883fde
...
...
@@ -64,6 +64,7 @@ class TDTestCase:
tmqCom
.
initConsumerTable
(
self
.
cdbName
)
tdCom
.
create_database
(
tdSql
,
self
.
paraDict
[
"dbName"
],
self
.
paraDict
[
"dropFlag"
])
tdSql
.
execute
(
"alter database %s wal_retention_period 3600"
%
(
self
.
paraDict
[
'dbName'
]))
self
.
paraDict
[
"stbName"
]
=
'stb1'
tdCom
.
create_stable
(
tdSql
,
dbname
=
self
.
paraDict
[
"dbName"
],
stbname
=
self
.
paraDict
[
"stbName"
],
column_elm_list
=
self
.
paraDict
[
"colSchema"
],
tag_elm_list
=
self
.
paraDict
[
"tagSchema"
],
count
=
1
,
default_stbname_prefix
=
self
.
paraDict
[
"stbName"
])
...
...
tests/system-test/7-tmq/tmqDropStbCtb.py
浏览文件 @
19883fde
...
...
@@ -54,6 +54,7 @@ class TDTestCase:
# tmqCom.initConsumerTable()
tdCom
.
create_database
(
tdSql
,
paraDict
[
"dbName"
],
paraDict
[
"dropFlag"
],
vgroups
=
paraDict
[
"vgroups"
],
replica
=
1
)
tdSql
.
execute
(
"alter database %s wal_retention_period 3600"
%
(
paraDict
[
'dbName'
]))
tdLog
.
info
(
"create stb"
)
tmqCom
.
create_stable
(
tdSql
,
dbName
=
paraDict
[
"dbName"
],
stbName
=
paraDict
[
"stbName"
])
tdLog
.
info
(
"create ctb"
)
...
...
tests/system-test/7-tmq/tmqError.py
浏览文件 @
19883fde
...
...
@@ -116,7 +116,7 @@ class TDTestCase:
if
dropFlag
==
1
:
tsql
.
execute
(
"drop database if exists %s"
%
(
dbName
))
tsql
.
execute
(
"create database if not exists %s vgroups %d replica %d"
%
(
dbName
,
vgroups
,
replica
))
tsql
.
execute
(
"create database if not exists %s vgroups %d replica %d
wal_retention_period 3600
"
%
(
dbName
,
vgroups
,
replica
))
tdLog
.
debug
(
"complete to create database %s"
%
(
dbName
))
return
...
...
tests/system-test/7-tmq/tmqModule.py
浏览文件 @
19883fde
...
...
@@ -110,7 +110,7 @@ class TDTestCase:
if
dropFlag
==
1
:
tsql
.
execute
(
"drop database if exists %s"
%
(
dbName
))
tsql
.
execute
(
"create database if not exists %s vgroups %d replica %d"
%
(
dbName
,
vgroups
,
replica
))
tsql
.
execute
(
"create database if not exists %s vgroups %d replica %d
wal_retention_period 3600
"
%
(
dbName
,
vgroups
,
replica
))
tdLog
.
debug
(
"complete to create database %s"
%
(
dbName
))
return
...
...
tests/system-test/7-tmq/tmqShow.py
浏览文件 @
19883fde
...
...
@@ -51,6 +51,7 @@ class TDTestCase:
consumerIdList
=
[
0
,
1
,
2
,
3
]
tmqCom
.
initConsumerTable
()
tdCom
.
create_database
(
tdSql
,
paraDict
[
"dbName"
],
paraDict
[
"dropFlag"
],
vgroups
=
paraDict
[
'vgroups'
],
replica
=
1
)
tdSql
.
execute
(
"alter database %s wal_retention_period 3600"
%
(
paraDict
[
'dbName'
]))
tdLog
.
info
(
"create stb"
)
tdCom
.
create_stable
(
tdSql
,
dbname
=
paraDict
[
"dbName"
],
stbname
=
paraDict
[
"stbName"
],
column_elm_list
=
paraDict
[
'colSchema'
],
tag_elm_list
=
paraDict
[
'tagSchema'
])
tdLog
.
info
(
"create ctb"
)
...
...
tests/system-test/7-tmq/tmqSubscribeStb-r3.py
浏览文件 @
19883fde
...
...
@@ -94,6 +94,7 @@ class TDTestCase:
tmqCom
.
initConsumerTable
()
tdCom
.
create_database
(
tdSql
,
paraDict
[
"dbName"
],
paraDict
[
"dropFlag"
],
vgroups
=
paraDict
[
"vgroups"
],
replica
=
self
.
replica
)
tdSql
.
execute
(
"alter database %s wal_retention_period 3600"
%
(
paraDict
[
'dbName'
]))
tdLog
.
info
(
"create stb"
)
tmqCom
.
create_stable
(
tdSql
,
dbName
=
paraDict
[
"dbName"
],
stbName
=
paraDict
[
"stbName"
])
tdLog
.
info
(
"create ctb"
)
...
...
tests/system-test/7-tmq/tmqUdf-multCtb-snapshot0.py
浏览文件 @
19883fde
...
...
@@ -116,6 +116,7 @@ class TDTestCase:
tmqCom
.
initConsumerTable
()
tdCom
.
create_database
(
tdSql
,
paraDict
[
"dbName"
],
paraDict
[
"dropFlag"
],
vgroups
=
paraDict
[
"vgroups"
],
replica
=
1
)
tdSql
.
execute
(
"alter database %s wal_retention_period 3600"
%
(
paraDict
[
'dbName'
]))
tdLog
.
info
(
"create stb"
)
tmqCom
.
create_stable
(
tdSql
,
dbName
=
paraDict
[
"dbName"
],
stbName
=
paraDict
[
"stbName"
])
tdLog
.
info
(
"create ctb"
)
...
...
@@ -163,6 +164,7 @@ class TDTestCase:
expectRowsList
=
[]
tmqCom
.
initConsumerTable
()
# tdCom.create_database(tdSql, paraDict["dbName"],paraDict["dropFlag"], vgroups=4,replica=1)
# tdSql.execute("alter database %s wal_retention_period 3600" % (paraDict['dbName']))
# tdLog.info("create stb")
# tdCom.create_stable(tdSql, dbname=paraDict["dbName"],stbname=paraDict["stbName"], column_elm_list=paraDict['colSchema'], tag_elm_list=paraDict['tagSchema'])
# tdLog.info("create ctb")
...
...
@@ -265,6 +267,7 @@ class TDTestCase:
expectRowsList
=
[]
tmqCom
.
initConsumerTable
()
# tdCom.create_database(tdSql, paraDict["dbName"],paraDict["dropFlag"], vgroups=4,replica=1)
# tdSql.execute("alter database %s wal_retention_period 3600" % (paraDict['dbName']))
# tdLog.info("create stb")
# tdCom.create_stable(tdSql, dbname=paraDict["dbName"],stbname=paraDict["stbName"], column_elm_list=paraDict['colSchema'], tag_elm_list=paraDict['tagSchema'])
# tdLog.info("create ctb")
...
...
tests/system-test/7-tmq/tmqUdf-multCtb-snapshot1.py
浏览文件 @
19883fde
...
...
@@ -116,6 +116,7 @@ class TDTestCase:
tmqCom
.
initConsumerTable
()
tdCom
.
create_database
(
tdSql
,
paraDict
[
"dbName"
],
paraDict
[
"dropFlag"
],
vgroups
=
paraDict
[
"vgroups"
],
replica
=
1
)
tdSql
.
execute
(
"alter database %s wal_retention_period 3600"
%
(
paraDict
[
'dbName'
]))
tdLog
.
info
(
"create stb"
)
tmqCom
.
create_stable
(
tdSql
,
dbName
=
paraDict
[
"dbName"
],
stbName
=
paraDict
[
"stbName"
])
tdLog
.
info
(
"create ctb"
)
...
...
@@ -163,6 +164,7 @@ class TDTestCase:
expectRowsList
=
[]
tmqCom
.
initConsumerTable
()
# tdCom.create_database(tdSql, paraDict["dbName"],paraDict["dropFlag"], vgroups=4,replica=1)
# tdSql.execute("alter database %s wal_retention_period 3600" % (paraDict['dbName']))
# tdLog.info("create stb")
# tdCom.create_stable(tdSql, dbname=paraDict["dbName"],stbname=paraDict["stbName"], column_elm_list=paraDict['colSchema'], tag_elm_list=paraDict['tagSchema'])
# tdLog.info("create ctb")
...
...
@@ -265,6 +267,7 @@ class TDTestCase:
expectRowsList
=
[]
tmqCom
.
initConsumerTable
()
# tdCom.create_database(tdSql, paraDict["dbName"],paraDict["dropFlag"], vgroups=4,replica=1)
# tdSql.execute("alter database %s wal_retention_period 3600" % (paraDict['dbName']))
# tdLog.info("create stb")
# tdCom.create_stable(tdSql, dbname=paraDict["dbName"],stbname=paraDict["stbName"], column_elm_list=paraDict['colSchema'], tag_elm_list=paraDict['tagSchema'])
# tdLog.info("create ctb")
...
...
tests/system-test/7-tmq/tmqUdf.py
浏览文件 @
19883fde
...
...
@@ -116,6 +116,7 @@ class TDTestCase:
tmqCom
.
initConsumerTable
()
tdCom
.
create_database
(
tdSql
,
paraDict
[
"dbName"
],
paraDict
[
"dropFlag"
],
vgroups
=
paraDict
[
"vgroups"
],
replica
=
1
)
tdSql
.
execute
(
"alter database %s wal_retention_period 3600"
%
(
paraDict
[
'dbName'
]))
tdLog
.
info
(
"create stb"
)
tmqCom
.
create_stable
(
tdSql
,
dbName
=
paraDict
[
"dbName"
],
stbName
=
paraDict
[
"stbName"
])
tdLog
.
info
(
"create ctb"
)
...
...
@@ -163,6 +164,7 @@ class TDTestCase:
expectRowsList
=
[]
tmqCom
.
initConsumerTable
()
# tdCom.create_database(tdSql, paraDict["dbName"],paraDict["dropFlag"], vgroups=4,replica=1)
# tdSql.execute("alter database %s wal_retention_period 3600" % (paraDict['dbName']))
# tdLog.info("create stb")
# tdCom.create_stable(tdSql, dbname=paraDict["dbName"],stbname=paraDict["stbName"], column_elm_list=paraDict['colSchema'], tag_elm_list=paraDict['tagSchema'])
# tdLog.info("create ctb")
...
...
@@ -266,6 +268,7 @@ class TDTestCase:
expectRowsList
=
[]
tmqCom
.
initConsumerTable
()
# tdCom.create_database(tdSql, paraDict["dbName"],paraDict["dropFlag"], vgroups=4,replica=1)
# tdSql.execute("alter database %s wal_retention_period 3600" % (paraDict['dbName']))
# tdLog.info("create stb")
# tdCom.create_stable(tdSql, dbname=paraDict["dbName"],stbname=paraDict["stbName"], column_elm_list=paraDict['colSchema'], tag_elm_list=paraDict['tagSchema'])
# tdLog.info("create ctb")
...
...
tests/system-test/7-tmq/tmqUpdate-1ctb.py
浏览文件 @
19883fde
...
...
@@ -54,6 +54,7 @@ class TDTestCase:
tmqCom
.
initConsumerTable
()
tdCom
.
create_database
(
tdSql
,
paraDict
[
"dbName"
],
paraDict
[
"dropFlag"
],
vgroups
=
paraDict
[
"vgroups"
],
replica
=
1
)
tdSql
.
execute
(
"alter database %s wal_retention_period 3600"
%
(
paraDict
[
'dbName'
]))
tdLog
.
info
(
"create stb"
)
tmqCom
.
create_stable
(
tdSql
,
dbName
=
paraDict
[
"dbName"
],
stbName
=
paraDict
[
"stbName"
])
tdLog
.
info
(
"create ctb"
)
...
...
tests/system-test/7-tmq/tmqUpdate-multiCtb-snapshot0.py
浏览文件 @
19883fde
...
...
@@ -55,6 +55,7 @@ class TDTestCase:
tmqCom
.
initConsumerTable
()
tdCom
.
create_database
(
tdSql
,
paraDict
[
"dbName"
],
paraDict
[
"dropFlag"
],
vgroups
=
paraDict
[
"vgroups"
],
replica
=
1
)
tdSql
.
execute
(
"alter database %s wal_retention_period 3600"
%
(
paraDict
[
'dbName'
]))
tdLog
.
info
(
"create stb"
)
tmqCom
.
create_stable
(
tdSql
,
dbName
=
paraDict
[
"dbName"
],
stbName
=
paraDict
[
"stbName"
])
tdLog
.
info
(
"create ctb"
)
...
...
tests/system-test/7-tmq/tmqUpdate-multiCtb-snapshot1.py
浏览文件 @
19883fde
...
...
@@ -55,6 +55,7 @@ class TDTestCase:
tmqCom
.
initConsumerTable
()
tdCom
.
create_database
(
tdSql
,
paraDict
[
"dbName"
],
paraDict
[
"dropFlag"
],
vgroups
=
paraDict
[
"vgroups"
],
replica
=
1
)
tdSql
.
execute
(
"alter database %s wal_retention_period 3600"
%
(
paraDict
[
'dbName'
]))
tdLog
.
info
(
"create stb"
)
tmqCom
.
create_stable
(
tdSql
,
dbName
=
paraDict
[
"dbName"
],
stbName
=
paraDict
[
"stbName"
])
tdLog
.
info
(
"create ctb"
)
...
...
tests/system-test/7-tmq/tmqUpdate-multiCtb.py
浏览文件 @
19883fde
...
...
@@ -55,6 +55,7 @@ class TDTestCase:
tmqCom
.
initConsumerTable
()
tdCom
.
create_database
(
tdSql
,
paraDict
[
"dbName"
],
paraDict
[
"dropFlag"
],
vgroups
=
paraDict
[
"vgroups"
],
replica
=
1
)
tdSql
.
execute
(
"alter database %s wal_retention_period 3600"
%
(
paraDict
[
'dbName'
]))
tdLog
.
info
(
"create stb"
)
tmqCom
.
create_stable
(
tdSql
,
dbName
=
paraDict
[
"dbName"
],
stbName
=
paraDict
[
"stbName"
])
tdLog
.
info
(
"create ctb"
)
...
...
tests/system-test/7-tmq/tmqUpdateWithConsume.py
浏览文件 @
19883fde
...
...
@@ -54,6 +54,7 @@ class TDTestCase:
tmqCom
.
initConsumerTable
()
tdCom
.
create_database
(
tdSql
,
paraDict
[
"dbName"
],
paraDict
[
"dropFlag"
],
vgroups
=
paraDict
[
"vgroups"
],
replica
=
self
.
replicaVar
,
wal_retention_size
=-
1
,
wal_retention_period
=-
1
)
tdSql
.
execute
(
"alter database %s wal_retention_period 3600"
%
(
paraDict
[
'dbName'
]))
tdLog
.
info
(
"create stb"
)
tmqCom
.
create_stable
(
tdSql
,
dbName
=
paraDict
[
"dbName"
],
stbName
=
paraDict
[
"stbName"
])
tdLog
.
info
(
"create ctb"
)
...
...
tests/system-test/99-TDcase/TD-15517.py
浏览文件 @
19883fde
...
...
@@ -51,7 +51,7 @@ class TDTestCase:
return
cur
def
create_tables
(
self
,
tsql
,
dbName
,
vgroups
,
stbName
,
ctbNum
,
rowsPerTbl
):
tsql
.
execute
(
"create database if not exists %s vgroups %d"
%
(
dbName
,
vgroups
))
tsql
.
execute
(
"create database if not exists %s vgroups %d
wal_retention_period 3600
"
%
(
dbName
,
vgroups
))
tsql
.
execute
(
"use %s"
%
dbName
)
tsql
.
execute
(
"create table %s (ts timestamp, c1 bigint, c2 binary(16)) tags(t1 int)"
%
stbName
)
pre_create
=
"create table"
...
...
tests/system-test/99-TDcase/TD-15554.py
浏览文件 @
19883fde
...
...
@@ -50,7 +50,7 @@ class TDTestCase:
return
cur
def
create_tables
(
self
,
tsql
,
dbName
,
vgroups
,
stbName
,
ctbNum
,
rowsPerTbl
):
tsql
.
execute
(
"create database if not exists %s vgroups %d"
%
(
dbName
,
vgroups
))
tsql
.
execute
(
"create database if not exists %s vgroups %d
wal_retention_period 3600
"
%
(
dbName
,
vgroups
))
tsql
.
execute
(
"use %s"
%
dbName
)
tsql
.
execute
(
"create table if not exists %s (ts timestamp, c1 bigint, c2 binary(16)) tags(t1 int)"
%
stbName
)
pre_create
=
"create table"
...
...
tests/system-test/99-TDcase/TD-15557.py
浏览文件 @
19883fde
...
...
@@ -64,7 +64,7 @@ class TDTestCase:
os
.
system
(
shellCmd
)
def
create_tables
(
self
,
tsql
,
dbName
,
vgroups
,
stbName
,
ctbNum
,
rowsPerTbl
):
tsql
.
execute
(
"create database if not exists %s vgroups %d"
%
(
dbName
,
vgroups
))
tsql
.
execute
(
"create database if not exists %s vgroups %d
wal_retention_period 3600
"
%
(
dbName
,
vgroups
))
tsql
.
execute
(
"use %s"
%
dbName
)
tsql
.
execute
(
"create table if not exists %s (ts timestamp, c1 bigint, c2 binary(16)) tags(t1 int)"
%
stbName
)
pre_create
=
"create table"
...
...
@@ -141,7 +141,7 @@ class TDTestCase:
'startTs'
:
1640966400000
}
# 2022-01-01 00:00:00.000
parameterDict
[
'cfg'
]
=
cfgPath
tdSql
.
execute
(
"create database if not exists %s vgroups %d"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'vgroups'
]))
tdSql
.
execute
(
"create database if not exists %s vgroups %d
wal_retention_period 3600
"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'vgroups'
]))
prepareEnvThread
=
threading
.
Thread
(
target
=
self
.
prepareEnv
,
kwargs
=
parameterDict
)
prepareEnvThread
.
start
()
...
...
@@ -214,7 +214,7 @@ class TDTestCase:
'startTs'
:
1640966400000
}
# 2022-01-01 00:00:00.000
parameterDict
[
'cfg'
]
=
cfgPath
tdSql
.
execute
(
"create database if not exists %s vgroups %d"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'vgroups'
]))
tdSql
.
execute
(
"create database if not exists %s vgroups %d
wal_retention_period 3600
"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'vgroups'
]))
prepareEnvThread
=
threading
.
Thread
(
target
=
self
.
prepareEnv
,
kwargs
=
parameterDict
)
prepareEnvThread
.
start
()
...
...
@@ -298,7 +298,7 @@ class TDTestCase:
'startTs'
:
1640966400000
}
# 2022-01-01 00:00:00.000
parameterDict
[
'cfg'
]
=
cfgPath
tdSql
.
execute
(
"create database if not exists %s vgroups %d"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'vgroups'
]))
tdSql
.
execute
(
"create database if not exists %s vgroups %d
wal_retention_period 3600
"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'vgroups'
]))
prepareEnvThread
=
threading
.
Thread
(
target
=
self
.
prepareEnv
,
kwargs
=
parameterDict
)
prepareEnvThread
.
start
()
...
...
tests/system-test/99-TDcase/TD-15563.py
浏览文件 @
19883fde
...
...
@@ -52,7 +52,7 @@ class TDTestCase:
def
initConsumerTable
(
self
,
cdbName
=
'cdb'
):
tdLog
.
info
(
"create consume database, and consume info table, and consume result table"
)
tdSql
.
query
(
"create database if not exists %s vgroups 1"
%
(
cdbName
))
tdSql
.
query
(
"create database if not exists %s vgroups 1
wal_retention_period 3600
"
%
(
cdbName
))
tdSql
.
query
(
"drop table if exists %s.consumeinfo "
%
(
cdbName
))
tdSql
.
query
(
"drop table if exists %s.consumeresult "
%
(
cdbName
))
...
...
@@ -95,7 +95,7 @@ class TDTestCase:
os
.
system
(
shellCmd
)
def
create_tables
(
self
,
tsql
,
dbName
,
vgroups
,
stbName
,
ctbNum
,
rowsPerTbl
):
tsql
.
execute
(
"create database if not exists %s vgroups %d"
%
(
dbName
,
vgroups
))
tsql
.
execute
(
"create database if not exists %s vgroups %d
wal_retention_period 3600
"
%
(
dbName
,
vgroups
))
tsql
.
execute
(
"use %s"
%
dbName
)
tsql
.
execute
(
"create table if not exists %s (ts timestamp, c1 bigint, c2 binary(16)) tags(t1 int)"
%
stbName
)
pre_create
=
"create table"
...
...
@@ -176,7 +176,7 @@ class TDTestCase:
self
.
initConsumerTable
()
tdSql
.
execute
(
"create database if not exists %s vgroups %d"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'vgroups'
]))
tdSql
.
execute
(
"create database if not exists %s vgroups %d
wal_retention_period 3600
"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'vgroups'
]))
prepareEnvThread
=
threading
.
Thread
(
target
=
self
.
prepareEnv
,
kwargs
=
parameterDict
)
prepareEnvThread
.
start
()
...
...
@@ -238,7 +238,7 @@ class TDTestCase:
self
.
initConsumerTable
()
tdSql
.
execute
(
"create database if not exists %s vgroups %d"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'vgroups'
]))
tdSql
.
execute
(
"create database if not exists %s vgroups %d
wal_retention_period 3600
"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'vgroups'
]))
prepareEnvThread
=
threading
.
Thread
(
target
=
self
.
prepareEnv
,
kwargs
=
parameterDict
)
prepareEnvThread
.
start
()
...
...
@@ -304,7 +304,7 @@ class TDTestCase:
self
.
initConsumerTable
()
tdSql
.
execute
(
"create database if not exists %s vgroups %d"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'vgroups'
]))
tdSql
.
execute
(
"create database if not exists %s vgroups %d
wal_retention_period 3600
"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'vgroups'
]))
prepareEnvThread
=
threading
.
Thread
(
target
=
self
.
prepareEnv
,
kwargs
=
parameterDict
)
prepareEnvThread
.
start
()
...
...
tests/system-test/99-TDcase/TD-16025.py
浏览文件 @
19883fde
...
...
@@ -59,7 +59,7 @@ class TDTestCase:
def
initConsumerTable
(
self
,
cdbName
=
'cdb'
):
tdLog
.
info
(
"create consume database, and consume info table, and consume result table"
)
tdSql
.
query
(
"create database if not exists %s vgroups 1"
%
(
cdbName
))
tdSql
.
query
(
"create database if not exists %s vgroups 1
wal_retention_period 3600
"
%
(
cdbName
))
tdSql
.
query
(
"drop table if exists %s.consumeinfo "
%
(
cdbName
))
tdSql
.
query
(
"drop table if exists %s.consumeresult "
%
(
cdbName
))
...
...
@@ -110,7 +110,7 @@ class TDTestCase:
if
dropFlag
==
1
:
tsql
.
execute
(
"drop database if exists %s"
%
(
dbName
))
tsql
.
execute
(
"create database if not exists %s vgroups %d replica %d"
%
(
dbName
,
vgroups
,
replica
))
tsql
.
execute
(
"create database if not exists %s vgroups %d replica %d
wal_retention_period 3600
"
%
(
dbName
,
vgroups
,
replica
))
tdLog
.
debug
(
"complete to create database %s"
%
(
dbName
))
return
...
...
tests/system-test/99-TDcase/TD-16821.py
浏览文件 @
19883fde
...
...
@@ -73,6 +73,7 @@ class TDTestCase:
expectRowsList
=
[]
tmqCom
.
initConsumerTable
()
tdCom
.
create_database
(
tdSql
,
paraDict
[
"dbName"
],
paraDict
[
"dropFlag"
],
vgroups
=
4
,
replica
=
1
)
tdSql
.
execute
(
"alter database %s wal_retention_period 3600"
%
(
paraDict
[
'dbName'
]))
tdLog
.
info
(
"create stb"
)
tdCom
.
create_stable
(
tdSql
,
dbname
=
paraDict
[
"dbName"
],
stbname
=
paraDict
[
"stbName"
],
column_elm_list
=
paraDict
[
'colSchema'
],
tag_elm_list
=
paraDict
[
'tagSchema'
])
tdLog
.
info
(
"create ctb"
)
...
...
tests/system-test/99-TDcase/TD-17255.py
浏览文件 @
19883fde
...
...
@@ -53,6 +53,7 @@ class TDTestCase:
tmqCom
.
initConsumerTable
()
tdCom
.
create_database
(
tdSql
,
paraDict
[
"dbName"
],
paraDict
[
"dropFlag"
],
vgroups
=
paraDict
[
"vgroups"
],
replica
=
1
)
tdSql
.
execute
(
"alter database %s wal_retention_period 3600"
%
(
paraDict
[
'dbName'
]))
tdLog
.
info
(
"create stb"
)
tmqCom
.
create_stable
(
tdSql
,
dbName
=
paraDict
[
"dbName"
],
stbName
=
paraDict
[
"stbName"
])
tdLog
.
info
(
"create ctb"
)
...
...
@@ -97,6 +98,7 @@ class TDTestCase:
tmqCom
.
initConsumerTable
()
tdCom
.
create_database
(
tdSql
,
paraDict
[
"dbName"
],
paraDict
[
"dropFlag"
],
vgroups
=
paraDict
[
"vgroups"
],
replica
=
1
)
tdSql
.
execute
(
"alter database %s wal_retention_period 3600"
%
(
paraDict
[
'dbName'
]))
tdLog
.
info
(
"create stb"
)
tmqCom
.
create_stable
(
tdSql
,
dbName
=
paraDict
[
"dbName"
],
stbName
=
paraDict
[
"stbName"
])
tdLog
.
info
(
"create ctb"
)
...
...
@@ -181,6 +183,7 @@ class TDTestCase:
tmqCom
.
initConsumerTable
()
tdCom
.
create_database
(
tdSql
,
paraDict
[
"dbName"
],
paraDict
[
"dropFlag"
],
vgroups
=
paraDict
[
"vgroups"
],
replica
=
1
)
tdSql
.
execute
(
"alter database %s wal_retention_period 3600"
%
(
paraDict
[
'dbName'
]))
tdLog
.
info
(
"create stb"
)
tmqCom
.
create_stable
(
tdSql
,
dbName
=
paraDict
[
"dbName"
],
stbName
=
paraDict
[
"stbName"
])
tdLog
.
info
(
"create ctb"
)
...
...
@@ -267,6 +270,7 @@ class TDTestCase:
tmqCom
.
initConsumerTable
()
tdCom
.
create_database
(
tdSql
,
paraDict
[
"dbName"
],
paraDict
[
"dropFlag"
],
vgroups
=
paraDict
[
"vgroups"
],
replica
=
1
)
tdSql
.
execute
(
"alter database %s wal_retention_period 3600"
%
(
paraDict
[
'dbName'
]))
tdLog
.
info
(
"create stb"
)
tmqCom
.
create_stable
(
tdSql
,
dbName
=
paraDict
[
"dbName"
],
stbName
=
paraDict
[
"stbName"
])
tdLog
.
info
(
"insert data by auto create ctb"
)
...
...
tests/system-test/99-TDcase/TD-17699.py
浏览文件 @
19883fde
...
...
@@ -65,6 +65,7 @@ class TDTestCase:
tmqCom
.
initConsumerTable
(
self
.
cdbName
)
tdCom
.
create_database
(
tdSql
,
self
.
paraDict
[
"dbName"
],
self
.
paraDict
[
"dropFlag"
])
tdSql
.
execute
(
"alter database %s wal_retention_period 3600"
%
(
paraDict
[
'dbName'
]))
self
.
paraDict
[
"stbName"
]
=
'stb1'
tdCom
.
create_stable
(
tdSql
,
dbname
=
self
.
paraDict
[
"dbName"
],
stbname
=
self
.
paraDict
[
"stbName"
],
column_elm_list
=
self
.
paraDict
[
"colSchema"
],
tag_elm_list
=
self
.
paraDict
[
"tagSchema"
],
count
=
1
,
default_stbname_prefix
=
self
.
paraDict
[
"stbName"
])
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录