basic.sim 3.5 KB
Newer Older
S
slguan 已提交
1
system sh/stop_dnodes.sh
S
slguan 已提交
2
system sh/deploy.sh -n dnode1 -i 1
S
scripts  
slguan 已提交
3
system sh/cfg.sh -n dnode1 -c wallevel -v 0
S
scripts  
Shengliang Guan 已提交
4 5
system sh/cfg.sh -n dnode1 -c maxVgroupsPerDb -v 4
system sh/cfg.sh -n dnode1 -c maxTablesPerVnode -v 1000
S
slguan 已提交
6 7 8 9 10 11 12 13 14 15 16 17 18 19

system sh/exec.sh -n dnode1 -s start

sleep 3000
sql connect
print ============================ dnode1 start

$i = 0
$dbPrefix = ob_db_db
$tbPrefix = ob_db_tb
$db = $dbPrefix . $i
$tb = $tbPrefix . $i

print =============== step1
S
scripts  
Shengliang Guan 已提交
20
sql create database $db replica 1 days 20 keep 2000 cache 16
S
slguan 已提交
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
sql show databases
print $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07
if $data00 != $db then 
  return -1
endi
if $data02 != 0 then 
  return -1
endi
if $data03 != 0 then 
  return -1
endi
if $data04 != 1 then 
  return -1
endi
if $data05 != 20 then 
  return -1
endi
S
scripts  
Shengliang Guan 已提交
38
if $data07 != 16 then 
S
slguan 已提交
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195
  return -1
endi
 
print =============== step2
sql create database $db
sql show databases
if $rows != 1 then 
  return -1
endi 

print =============== step3
sql drop database $db
sql show databases
if $rows != 0 then 
  return -1
endi 

print =============== step4
sql_error drop database $db

print =============== step5
sql create database $db replica 1 days 15 keep 1500
sql show databases
print $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07
if $data00 != $db then 
  return -1
endi
if $data02 != 0 then 
  return -1
endi
if $data03 != 0 then 
  return -1
endi
if $data04 != 1 then 
  return -1
endi
if $data05 != 15 then 
  return -1
endi

print =============== step6
sql use $db
sql create table $tb (ts timestamp, speed int)
$i = 1
while $i < 4
  $db = $dbPrefix . $i
  $tb = $tbPrefix . $i
  sql create database $db
  sql use $db
  sql create table $tb (ts timestamp, speed int)
  $i = $i + 1
endw

sql show databases
if $rows != 4 then 
  return -1
endi

$i = 4
$db = $dbPrefix . $i
$tb = $tbPrefix . $i
sql create database $db
sql use $db
sql create table $tb (ts timestamp, speed int) -x step6
	return -1
step6:

print =============== step7
$i = 0
while $i < 5
  $db = $dbPrefix . $i  
  sql drop database $db 
  $i = $i + 1
endw

print =============== step8
$i = 0
$db = $dbPrefix . $i
$tb = $tbPrefix . $i
sql create database $db
sql use $db
sql create table $tb (ts timestamp, speed int)
sql show tables
if $rows != 1 then 
  return -1
endi

print =============== step9
sql drop database $db

print =============== step10
sql create database $db
sql use $db
sql show tables
if $rows != 0 then 
  return -1
endi

print =============== step11
sql create table $tb (ts timestamp, speed int)
sql show tables
if $rows != 1 then 
  return -1
endi

print =============== step12
sql drop database $db

print =============== step13
sql create database $db
sql use $db
sql show tables
if $rows != 0 then 
  return -1
endi
sql create table $tb (ts timestamp, speed int)
sql show tables
if $rows != 1 then 
  return -1
endi
sql insert into $tb values (now+1a, 0)
sql insert into $tb values (now+2a, 1)
sql insert into $tb values (now+3a, 2)
sql insert into $tb values (now+4a, 3)
sql insert into $tb values (now+5a, 4)
sql select * from $tb
if $rows != 5 then 
  return -1
endi

print =============== step14
sql drop database $db

print =============== step15
sql create database $db
sql use $db
sql show tables
if $rows != 0 then 
  return -1
endi

print =============== step16
sql create table $tb (ts timestamp, speed int)
sql show tables
if $rows != 1 then 
  return -1
endi
sql select * from $tb
if $rows != 0 then 
  return -1
endi

sql drop database $db
sql show databases
if $rows != 0 then 
  return -1
endi
S
scripts  
slguan 已提交
196 197

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