basic4.sim 1.7 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
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);

X
Xiaoyu Wang 已提交
13
sql select * from information_schema.ins_databases
G
Ganlin Zhao 已提交
14
if $rows != 3 then
15 16 17
  return -1
endi

G
Ganlin Zhao 已提交
18
if $data20 != d1 then
19 20 21
  return -1
endi

G
Ganlin Zhao 已提交
22
if $data22 != 1 then
23 24 25
  return -1
endi

G
Ganlin Zhao 已提交
26
if $data24 != 1 then
27 28 29 30
  return -1
endi

sql show d1.tables
G
Ganlin Zhao 已提交
31
if $rows != 4 then
32 33 34 35
  return -1
endi

sql show d1.vgroups
G
Ganlin Zhao 已提交
36
if $rows != 1 then
37 38
  return -1
endi
G
Ganlin Zhao 已提交
39
if $data00 != 2 then
40 41
  return -1
endi
G
Ganlin Zhao 已提交
42
if $data01 != d1 then
43 44 45
  return -1
endi

G
Ganlin Zhao 已提交
46
print =============== drop table
47 48
sql drop table d1.t1

X
Xiaoyu Wang 已提交
49
sql select * from information_schema.ins_databases
G
Ganlin Zhao 已提交
50
if $rows != 3 then
51 52 53
  return -1
endi

G
Ganlin Zhao 已提交
54
if $data20 != d1 then
55 56 57
  return -1
endi

G
Ganlin Zhao 已提交
58
if $data22 != 1 then
59 60 61
  return -1
endi

G
Ganlin Zhao 已提交
62
if $data24 != 1 then
63 64 65 66
  return -1
endi

sql show d1.tables
G
Ganlin Zhao 已提交
67
if $rows != 3 then
68 69 70 71
  return -1
endi

sql show d1.vgroups
G
Ganlin Zhao 已提交
72
if $rows != 1 then
73 74
  return -1
endi
G
Ganlin Zhao 已提交
75
if $data00 != 2 then
76 77
  return -1
endi
G
Ganlin Zhao 已提交
78
if $data01 != d1 then
79 80
  return -1
endi
G
Ganlin Zhao 已提交
81
print =============== drop all table
82 83 84 85
sql drop table d1.t2
sql drop table d1.t3
sql drop table d1.t4

X
Xiaoyu Wang 已提交
86
sql select * from information_schema.ins_databases
G
Ganlin Zhao 已提交
87
if $rows != 3 then
88 89 90
  return -1
endi

G
Ganlin Zhao 已提交
91
if $data20 != d1 then
92 93 94
  return -1
endi

G
Ganlin Zhao 已提交
95
if $data22 != 1 then
96 97 98
  return -1
endi

G
Ganlin Zhao 已提交
99
if $data24 != 1 then
100 101 102 103
  return -1
endi

sql show d1.tables
G
Ganlin Zhao 已提交
104
if $rows != 0 then
105 106 107 108
  return -1
endi

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

G
Ganlin Zhao 已提交
119
system sh/exec.sh -n dnode1 -s stop -x SIGINT