basic7.sim 886 字节
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
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 
  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