tags_dynamically_specifiy.sim 1.7 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
system sh/cfg.sh -n dnode1 -c commitLog -v 0
system sh/exec.sh -n dnode1 -s start
sleep 3000
sql connect
sleep 3000

$db = dytag_db
$tbNum = 10
$rowNum = 5
$totalNum = $tbNum * $rowNum
$ts0 = 1537146000000
$delta = 600000
print ========== tags_dynamically_specify.sim
$i = 0

sql drop database if exists $db
sql create database $db
sql use $db

sql create table stb (ts timestamp, c1 binary(10), c2 int, c3 float) tags (t1 binary(10), t2 int, t3 float)

sql insert into tb1 using stb (t1) tags ('tag1') values ( now + 1s, 'binary1', 1, 1.1)
sql insert into tb2 using stb (t2) tags (2)      values ( now + 2s, 'binary2', 2, 2.2)
sql insert into tb3 using stb (t3) tags (3.3)    values ( now + 3s, 'binary3', 3, 3.3)

sql insert into tb4 (ts, c1, c2) using stb (t1, t2) tags ('tag4', 4)   values ( now + 4s, 'binary4', 4)
sql insert into tb5 (ts, c1, c3) using stb (t1, t3) tags ('tag5', 11.11) values ( now + 5s, 'binary5', 5.5)

sql select * from stb order by ts asc
if $rows != 5 then
  return -1
endi



sql create table stbx (ts timestamp, c1 binary(10), c2 int, c3 float) tags (t1 binary(10), t2 int, t3 float)
sql insert into tb100 (ts, c1, c2, c3) using stbx (t1, t2, t3) tags ('tag100', 100, 100.9) values ( now + 10s, 'binary100', 100, 100.9) tb101 (ts, c1, c2, c3) using stbx (t1, t2, t3) tags ('tag101', 101, 101.9) values ( now + 10s, 'binary101', 101, 101.9) tb102 (ts, c1, c2, c3) using stbx (t1, t2, t3) tags ('tag102', 102, 102.9) values ( now + 10s, 'binary102', 102, 102.9)

sql select * from stbx
if $rows != 3 then
  return -1
endi

if $data04 != tag100 then
  return -1
endi

if $data05 != 100 then
  return -1
endi

#if $data06 != 100.90000 then
#  print "expect: 100.90000, act: $data06"
#  return -1
#endi