TDengine/tests/script/tsim/db/basic2.sim

75 lines
1.6 KiB
Text
Raw Normal View History

2022-03-28 07:28:21 +00:00
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/exec.sh -n dnode1 -s start
sql connect
print =============== conflict stb
sql create database db vgroups 4;
sql use db;
sql create table stb (ts timestamp, i int) tags (j int);
sql_error create table stb using stb tags (1);
sql_error create table stb (ts timestamp, i int);
sql create table ctb (ts timestamp, i int);
sql_error create table ctb (ts timestamp, i int) tags (j int);
sql create table ntb (ts timestamp, i int);
sql_error create table ntb (ts timestamp, i int) tags (j int);
sql drop table ntb
sql create table ntb (ts timestamp, i int) tags (j int);
sql drop database db
2022-03-28 07:28:21 +00:00
print =============== create database d1
sql create database d1
sql use d1
sql create table t1 (ts timestamp, i int);
sql create table t2 (ts timestamp, i int);
sql create table t3 (ts timestamp, i int);
sql create table t4 (ts timestamp, i int);
2022-08-11 12:26:40 +00:00
sql select * from information_schema.ins_databases
2022-08-18 11:32:14 +00:00
print rows: $rows
2022-03-28 07:28:21 +00:00
print $data00 $data01 $data02 $data03
print $data10 $data11 $data12 $data13
2022-04-14 03:36:06 +00:00
if $rows != 3 then
2022-03-28 07:28:21 +00:00
return -1
endi
2022-04-14 03:36:06 +00:00
if $data20 != d1 then
2022-03-28 07:28:21 +00:00
return -1
endi
2022-04-14 03:36:06 +00:00
if $data22 != 2 then # vgroups
2022-03-28 07:28:21 +00:00
return -1
endi
#if $data03 != 4 then # ntables
# return -1
#endi
sql show tables
2022-08-18 11:32:14 +00:00
if $rows != 4 then
2022-03-28 07:28:21 +00:00
return -1
endi
print =============== create database d2
sql create database d2
sql use d2
sql create table t1 (ts timestamp, i int);
sql create table t2 (ts timestamp, i int);
sql create table t3 (ts timestamp, i int);
2022-08-11 12:26:40 +00:00
sql select * from information_schema.ins_databases
2022-04-14 03:36:06 +00:00
if $rows != 4 then
2022-03-28 07:28:21 +00:00
return -1
endi
sql show tables
2022-08-18 11:32:14 +00:00
if $rows != 3 then
2022-03-28 07:28:21 +00:00
return -1
endi
2022-08-18 11:32:14 +00:00
system sh/exec.sh -n dnode1 -s stop -x SIGINT