timestamp_query.sim 1.2 KB
Newer Older
H
Haojun Liao 已提交
1
sleep 500
S
slguan 已提交
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
sql connect

$dbPrefix = ts_db
$tbPrefix = ts_tb
$stbPrefix = ts_stb
$tbNum = 10
$rowNum = 300
$totalNum = $tbNum * $rowNum
$ts0 = 1537146000000
$delta = 600000
print ========== timestamp_query.sim
$i = 0
$db = $dbPrefix . $i
$stb = $stbPrefix . $i

print ====== use db
sql use $db

$tsu = $rowNum * $delta
$tsu = $tsu - $delta
$tsu = $tsu + $ts0

H
Haojun Liao 已提交
24 25 26 27
print ==================>issue #3481, normal column not allowed,
sql_error select ts,c1,min(c2) from ts_stb0


S
slguan 已提交
28 29
##### select from supertable
$tb = $tbPrefix . 0
H
Haojun Liao 已提交
30
sql select first(c1), last(c1), (1537325400 - 1537146000)/(5*60) v from $tb where ts >= $ts0 and ts < $tsu interval(5m) fill(value, -1)
S
slguan 已提交
31
$res = $rowNum * 2
H
Haojun Liao 已提交
32 33 34 35
$n = $res - 2
print ============>$n
if $rows != $n then
  print expect $n, actual $rows
S
slguan 已提交
36 37 38
  return -1
endi

H
Haojun Liao 已提交
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
if $data03 != 598.000000000 then
  print expect 598.000000000, actual $data03
  return -1
endi


if $data13 != 598.000000000 then
  print expect 598.000000000, actual $data03
  return -1
endi

sql select first(c1), last(c1), (1537325400 - 1537146000)/(5*60) v from $tb where ts >= $ts0 and ts < $tsu interval(5m) fill(value, NULL)
if $data13 != 598.000000000 then
  print expect 598.000000000, actual $data03
  return -1
endi