basic4.sim 1.6 KB
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
sql create database d1 vgroups 1
8 9 10 11 12 13
sql create table d1.t1 (ts timestamp, i int);
sql create table d1.t2 (ts timestamp, i int);
sql create table d1.t3 (ts timestamp, i int);
sql create table d1.t4 (ts timestamp, i int);

sql show databases
S
Shengliang Guan 已提交
14
if $rows != 3 then 
15 16 17
  return -1
endi

S
Shengliang Guan 已提交
18
if $data20 != d1 then 
19 20 21
  return -1
endi

S
Shengliang Guan 已提交
22
if $data22 != 1 then 
23 24 25
  return -1
endi

S
Shengliang Guan 已提交
26
if $data24 != 1 then 
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
  return -1
endi

sql show d1.tables
if $rows != 4 then 
  return -1
endi

sql show d1.vgroups
if $rows != 1 then 
  return -1
endi
if $data00 != 2 then 
  return -1
endi
S
Shengliang Guan 已提交
42
if $data01 != d1 then 
43 44 45 46 47 48 49
  return -1
endi

print =============== drop table 
sql drop table d1.t1

sql show databases
S
Shengliang Guan 已提交
50
if $rows != 3 then 
51 52 53
  return -1
endi

S
Shengliang Guan 已提交
54
if $data20 != d1 then 
55 56 57
  return -1
endi

S
Shengliang Guan 已提交
58
if $data22 != 1 then 
59 60 61
  return -1
endi

S
Shengliang Guan 已提交
62
if $data24 != 1 then 
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77
  return -1
endi

sql show d1.tables
if $rows != 3 then 
  return -1
endi

sql show d1.vgroups
if $rows != 1 then 
  return -1
endi
if $data00 != 2 then 
  return -1
endi
S
Shengliang Guan 已提交
78
if $data01 != d1 then 
79 80 81 82 83 84 85 86
  return -1
endi
print =============== drop all table 
sql drop table d1.t2
sql drop table d1.t3
sql drop table d1.t4

sql show databases
S
Shengliang Guan 已提交
87
if $rows != 3 then 
88 89 90
  return -1
endi

S
Shengliang Guan 已提交
91
if $data20 != d1 then 
92 93 94
  return -1
endi

S
Shengliang Guan 已提交
95
if $data22 != 1 then 
96 97 98
  return -1
endi

S
Shengliang Guan 已提交
99
if $data24 != 1 then 
100 101 102 103 104 105 106 107 108
  return -1
endi

sql show d1.tables
if $rows != 0 then 
  return -1
endi

sql show d1.vgroups
S
Shengliang Guan 已提交
109 110 111 112 113 114 115
if $rows != 1 then 
  return -1
endi
if $data00 != 2 then 
  return -1
endi
if $data01 != d1 then 
116 117 118 119
  return -1
endi

system sh/exec.sh -n dnode1 -s stop -x SIGINT