basic5.sim 901 字节
Newer Older
1 2 3 4 5 6
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
S
Shengliang Guan 已提交
7 8
sql create database db1 vgroups 1;
sql use db1;
9

S
Shengliang Guan 已提交
10 11 12 13 14 15
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
16
if $rows != 1 then 
S
Shengliang Guan 已提交
17
  print $rows
18 19 20
  return -1
endi

S
Shengliang Guan 已提交
21 22
sql show tables
if $rows != 1 then 
23 24 25
  return -1
endi

S
Shengliang Guan 已提交
26 27
print =============== drop db
sql drop database db1;
28

S
Shengliang Guan 已提交
29 30
sql_error show stables
sql_error show tables
31

S
Shengliang Guan 已提交
32 33 34 35
print =============== re-create db and stb
sql create database db1;
sql use db1;
sql create stable st1 (ts timestamp, f1 int) tags(t1 int)
36

S
Shengliang Guan 已提交
37
sql show stables
38 39 40 41
if $rows != 1 then 
  return -1
endi

S
Shengliang Guan 已提交
42
sql show tables
43 44 45 46
if $rows != 0 then 
  return -1
endi

S
Shengliang Guan 已提交
47
system sh/exec.sh -n dnode1 -s stop -x SIGINT