homework-jianmu/tests/script/tsim/db/basic7.sim

47 lines
900 B
Plaintext

system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/exec.sh -n dnode1 -s start
sql connect
print =============== create database d1
sql create database db1 vgroups 1;
sql use db1;
print =============== create stable and table
sql create stable st1 (ts timestamp, f1 int) tags(t1 int);
sql create table tb1 using st1 tags(1);
sql insert into tb1 values (now, 1);
sql show stables
if $rows != 1 then
print $rows
return -1
endi
sql show tables
if $rows != 1 then
return -1
endi
print =============== drop db
sql drop database db1;
sql_error show stables
sql_error show tables
print =============== re-create db and stb
sql create database db1;
sql use db1;
sql create stable st1 (ts timestamp, f1 int) tags(t1 int)
sql show stables
if $rows != 1 then
return -1
endi
sql show tables
if $rows != 0 then
return -1
endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT