delete_reuse1.sim 1.6 KB
Newer Older
1 2 3 4 5
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/exec.sh -n dnode1 -s start
sql connect

G
Ganlin Zhao 已提交
6
print ======== step1
S
Shengliang Guan 已提交
7 8 9 10
sql create database d1 replica 1 vgroups 1
sql create database d2 replica 1 vgroups 1
sql create database d3 replica 1 vgroups 1
sql create database d4 replica 1 vgroups 1
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 47 48 49

sql create table d1.t1 (ts timestamp, i int)
sql create table d2.t2 (ts timestamp, i int)
sql create table d3.t3 (ts timestamp, i int)
sql create table d4.t4 (ts timestamp, i int)

sql insert into d2.t2 values(now, 1)
sql insert into d1.t1 values(now, 1)
sql insert into d3.t3 values(now, 1)
sql insert into d4.t4 values(now, 1)

sql select * from d1.t1
if $rows != 1 then
	return -1
endi

sql select * from d2.t2
if $rows != 1 then
	return -1
endi

sql select * from d3.t3
if $rows != 1 then
	return -1
endi

sql select * from d4.t4
if $rows != 1 then
	return -1
endi

print ======== step2
sql drop database d1
sql insert into d1.t1 values(now, 2) -x step2
  return -1
step2:

print ========= step3
sql reset query cache
G
Ganlin Zhao 已提交
50
sleep 50
S
Shengliang Guan 已提交
51

52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67
sql create database d1 replica 1
sql create table d1.t1 (ts timestamp, i int)
sql insert into d1.t1 values(now, 2)
sql select * from d1.t1
if $rows != 1 then
	return -1
endi

print ========= step4
$x = 0
while $x < 20

  sql drop database d1
  sql insert into d1.t1 values(now, -1) -x step4
    return -1
  step4:
G
Ganlin Zhao 已提交
68

69 70
  sql create database d1 replica 1
  sql reset query cache
G
Ganlin Zhao 已提交
71
  sleep 50
72 73 74 75 76 77
  sql create table d1.t1 (ts timestamp, i int)
  sql insert into d1.t1 values(now, $x )
  sql select * from d1.t1
  if $rows != 1 then
	return -1
  endi
G
Ganlin Zhao 已提交
78

79
  $x = $x + 1
G
Ganlin Zhao 已提交
80

81
  print ===> loop times: $x
G
Ganlin Zhao 已提交
82
endw
83

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