lastrow_query.sim 1.1 KB
Newer Older
S
slguan 已提交
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
sleep 3000
sql connect

$dbPrefix = lr_db
$tbPrefix = lr_tb
$stbPrefix = lr_stb
$tbNum = 8
$rowNum = 60 * 24
$totalNum = $tbNum * $rowNum
$ts0 = 1537146000000
$delta = 60000
print ========== lastrow_query.sim
$i = 0
$db = $dbPrefix . $i
$stb = $stbPrefix . $i

sql use $db

##### select lastrow from STable with two vnodes, timestamp decreases from tables in vnode0 to tables in vnode1
sql select last_row(*) from $stb
if $rows != 1 then
  return -1
endi
if $data00 != @18-09-25 09:00:00.000@ then
  return -1
endi
if $data01 != 1439 then
  return -1   
endi  
30
if $data02 != NULL then
S
slguan 已提交
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
  return -1  
endi 
if $data03 != 1439.00000 then
  return -1  
endi    
if $data04 != 1439.000000000 then
  return -1
endi
if $data06 != 31 then
  return -1
endi 
if $data07 != 1 then
  return -1
endi
if $data08 != BINARY then
H
hjxilinx 已提交
46
  print expect BINARY actual: $data08
S
slguan 已提交
47 48 49
  return -1
endi
if $data09 != NCHAR then
H
hjxilinx 已提交
50
  print expect NCHAR actual: $data09
S
slguan 已提交
51 52 53
  return -1
endi

H
Haojun Liao 已提交
54 55 56 57
sql select count(*) from lr_tb1 where ts>'2018-09-18 08:45:00.1' and ts<'2018-09-18 08:45:00.2'
if $row != 0 then
  return -1
endi