fill.sim 1.8 KB
Newer Older
S
slguan 已提交
1
system sh/stop_dnodes.sh
S
slguan 已提交
2 3

system sh/deploy.sh -n dnode1 -i 1
S
slguan 已提交
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
system sh/cfg.sh -n dnode1 -c commitLog -v 0
system sh/exec.sh -n dnode1 -s start

sleep 3000
sql connect

print =================== step1
sql create database db
sql use db
sql create table mt (ts timestamp, k int, h binary(20), t bigint, s float, f double, x smallint, y tinyint, z bool) tags (a int, b binary(20), c bigint)
sql create table tb using mt tags (0, '1', 2)

sql insert into tb values(now -200d, 200, '1', 2, 3, 4, 5, 6, true);
sql insert into tb values(now -100d, 100, '1', 2, 3, 4, 5, 6, true);
sql insert into tb values(now -30d,  30,  '1', 2, 3, 4, 5, 6, true);
sql insert into tb values(now -20d,  20,  '1', 2, 3, 4, 5, 6, true);
sql insert into tb values(now -10d,  10,  '1', 2, 3, 4, 5, 6, true);
sql insert into tb values(now -5d,   5,   '1', 2, 3, 4, 5, 6, true);
sql insert into tb values(now -1d,   1,   '1', 2, 3, 4, 5, 6, true);
sql insert into tb values(now,       0,   '1', 2, 3, 4, 5, 6, true);

sql select * from db.mt
if $rows != 8 then 
  return -1
endi

sql select * from db.tb
if $rows != 8 then 
  return -1
endi

sql select count(*) from db.mt
if $data00 != 8 then 
  return -1
endi

sql select count(*), last(ts), min(k), max(k), avg(k) from db.mt where a=0 and ts>="2016-4-29 8:0:0" and ts < "2018-7-18 8:9:0" interval(1d) fill(value, 1)
sql select count(*), last(ts), min(k), max(k), avg(k) from db.mt where a=0 and ts>="2016-4-29 8:0:0" and ts < "2018-7-18 8:9:0" interval(1d) fill(value, 1)

print =================== step2
system sh/exec.sh -n dnode1 -s stop -x SIGINT
sleep 10000
system sh/exec.sh -n dnode1 -s start
sleep 3000

print =================== step3
sql select * from db.mt
if $rows != 8 then 
  return -1
endi

sql select * from db.tb
if $rows != 8 then 
  return -1
endi

sql select count(*) from db.mt
if $data00 != 8 then 
  return -1
endi