stream_1970.sim 1.4 KB
Newer Older
D
dapan1121 已提交
1 2 3 4 5 6 7 8 9 10 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 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73
system sh/stop_dnodes.sh

system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/exec.sh -n dnode1 -s start

sleep 2000
sql connect

print ======================== dnode1 start

$dbPrefix = s3_db
$tbPrefix = s3_tb
$mtPrefix = s3_mt
$stPrefix = s3_st
$tbNum = 10
$rowNum = 20
$totalNum = 200

print =============== step1
$i = 0
$db = $dbPrefix . $i
$mt = $mtPrefix . $i
$st = $stPrefix . $i

sql drop databae $db -x step1
step1:
sql create database $db keep 36500
sql use $db
sql create stable $mt (ts timestamp, tbcol int, tbcol2 float) TAGS(tgcol int)

sql create table cq1 as select count(*) from $mt interval(10s);

sleep 1000

sql create table $st using $mt tags(1);

sql insert into $st values (-50000, 1, 1.0);
sql insert into $st values (-10000, 1, 1.0);
sql insert into $st values (10000, 1, 1.0);


$i = 0 
while $i < 12
  sql select * from cq1;
  
  if $rows != 3 then
      sleep 10000
  else
      if $data00 != @70-01-01 07:59:10.000@ then
         return -1
      endi
      if $data01 != 1 then
         return -1
      endi
      if $data10 != @70-01-01 07:59:50.000@ then
         return -1
      endi
      if $data11 != 1 then
         return -1
      endi
      if $data20 != @70-01-01 08:00:10.000@ then
         return -1
      endi
      if $data21 != 1 then
         return -1
      endi
      $i = 12
  endi

  $i = $i + 1 
endw