basic.sim 2.8 KB
Newer Older
S
slguan 已提交
1 2 3 4 5 6 7 8
sql connect
sleep 3000

sql create database ibadb
sql use ibadb
sql create table tb(ts timestamp, i int)

print ================= step1
S
scripts  
slguan 已提交
9 10

sql import into tb values(1564641710000, 10000)
S
slguan 已提交
11 12 13 14 15 16
sql select * from tb;
if $rows != 1 then 
  return -1
endi

print ================= step2
S
scripts  
slguan 已提交
17
sql insert into tb values(1564641708000, 8000)
S
slguan 已提交
18
sql select * from tb;
S
scripts  
slguan 已提交
19
if $rows != 2 then 
S
slguan 已提交
20 21 22 23
  return -1
endi

print ================= step3
S
scripts  
slguan 已提交
24
sql insert into tb values(1564641720000, 20000)
S
slguan 已提交
25
sql select * from tb;
S
scripts  
slguan 已提交
26
if $rows != 3 then 
S
slguan 已提交
27 28 29 30
  return -1
endi

print ================= step4
S
scripts  
slguan 已提交
31 32 33
sql import into tb values(1564641708000, 8000)
sql import into tb values(1564641715000, 15000)
sql import into tb values(1564641730000, 30000)
S
slguan 已提交
34 35 36 37 38 39
sql select * from tb;
if $rows != 5 then 
  return -1
endi

print ================= step5
S
scripts  
slguan 已提交
40 41 42 43
sql insert into tb values(1564641708000, 8000)
sql insert into tb values(1564641714000, 14000)
sql insert into tb values(1564641725000, 25000)
sql insert into tb values(1564641740000, 40000)
S
slguan 已提交
44
sql select * from tb;
S
scripts  
slguan 已提交
45
if $rows != 8 then 
S
slguan 已提交
46 47 48 49
  return -1
endi

print ================= step6
S
scripts  
slguan 已提交
50 51 52 53 54
sql import into tb values(1564641707000, 7000)
sql import into tb values(1564641712000, 12000)
sql import into tb values(1564641723000, 23000)
sql import into tb values(1564641734000, 34000)
sql import into tb values(1564641750000, 50000)
S
slguan 已提交
55
sql select * from tb;
S
scripts  
slguan 已提交
56
if $rows != 13 then 
S
slguan 已提交
57 58 59 60
  return -1
endi

print ================= step7
S
scripts  
slguan 已提交
61 62 63 64 65
sql import into tb values(1564641707001, 7001)
sql import into tb values(1564641712001, 12001)
sql import into tb values(1564641723001, 23001)
sql import into tb values(1564641734001, 34001)
sql import into tb values(1564641750001, 50001)
S
slguan 已提交
66
sql select * from tb;
S
scripts  
slguan 已提交
67
if $rows != 18 then 
S
slguan 已提交
68 69 70 71
  return -1
endi

print ================= step8
S
scripts  
slguan 已提交
72 73 74 75
sql insert into tb values(1564641708002, 8002)
sql insert into tb values(1564641714002, 14002)
sql insert into tb values(1564641725002, 25002)
sql insert into tb values(1564641900000, 200000)
S
slguan 已提交
76
sql select * from tb;
S
scripts  
slguan 已提交
77
if $rows != 22 then 
S
slguan 已提交
78 79 80 81
  return -1
endi

print ================= step9 only insert last one
S
scripts  
slguan 已提交
82
sql import into tb values(1564641705000, 5000)(1564641718000, 18000)(1564642400000, 700000)
S
slguan 已提交
83
sql select * from tb;
S
scripts  
slguan 已提交
84
if $rows != 25 then
S
slguan 已提交
85 86 87 88
  return -1
endi

print ================= step10
S
scripts  
slguan 已提交
89
sql import into tb values(1564641705000, 5000)(1564641718000, 18000)(1564642400000, 70000)
S
slguan 已提交
90
sql select * from tb;
S
scripts  
slguan 已提交
91
if $rows != 25 then
S
slguan 已提交
92 93 94 95
  return -1
endi

print ================= step11
S
scripts  
slguan 已提交
96
sql import into tb values(1564642400000, 700000)
S
slguan 已提交
97
sql select * from tb;
S
scripts  
slguan 已提交
98
if $rows != 25 then
S
slguan 已提交
99 100 101 102
  return -1
endi

print ================= step12
S
scripts  
slguan 已提交
103
sql import into tb values(1564641709527, 9527)(1564641709527, 9528)
S
slguan 已提交
104 105
sql select * from tb;
print rows=> $rows
S
scripts  
slguan 已提交
106
if $rows != 26 then
S
slguan 已提交
107 108 109 110
  return -1
endi

print ================= step13
S
scripts  
slguan 已提交
111
sql import into tb values(1564641709898, 9898)(1564641709897, 9897)
S
slguan 已提交
112 113
sql select * from tb;
print rows=> $rows
S
scripts  
slguan 已提交
114
if $rows != 28 then
S
slguan 已提交
115 116 117 118
  return -1
endi

sql drop database ibadb