basic.sim 2.9 KB
Newer Older
S
slguan 已提交
1 2 3
sql connect
sleep 3000

S
TD-1057  
Shengliang Guan 已提交
4 5 6 7 8 9 10
sql show databases
sql drop database $data00 -x e1
e1:
sql show databases
sql drop database $data00 -x e2
e2:

S
slguan 已提交
11 12 13 14 15
sql create database ibadb
sql use ibadb
sql create table tb(ts timestamp, i int)

print ================= step1
S
scripts  
slguan 已提交
16 17

sql import into tb values(1564641710000, 10000)
S
slguan 已提交
18 19 20 21 22 23
sql select * from tb;
if $rows != 1 then 
  return -1
endi

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

print ================= step3
S
scripts  
slguan 已提交
31
sql insert into tb values(1564641720000, 20000)
S
slguan 已提交
32
sql select * from tb;
S
scripts  
slguan 已提交
33
if $rows != 3 then 
S
slguan 已提交
34 35 36 37
  return -1
endi

print ================= step4
S
scripts  
slguan 已提交
38 39 40
sql import into tb values(1564641708000, 8000)
sql import into tb values(1564641715000, 15000)
sql import into tb values(1564641730000, 30000)
S
slguan 已提交
41 42 43 44 45 46
sql select * from tb;
if $rows != 5 then 
  return -1
endi

print ================= step5
S
scripts  
slguan 已提交
47 48 49 50
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 已提交
51
sql select * from tb;
S
scripts  
slguan 已提交
52
if $rows != 8 then 
S
slguan 已提交
53 54 55 56
  return -1
endi

print ================= step6
S
scripts  
slguan 已提交
57 58 59 60 61
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 已提交
62
sql select * from tb;
S
scripts  
slguan 已提交
63
if $rows != 13 then 
S
slguan 已提交
64 65 66 67
  return -1
endi

print ================= step7
S
scripts  
slguan 已提交
68 69 70 71 72
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 已提交
73
sql select * from tb;
S
scripts  
slguan 已提交
74
if $rows != 18 then 
S
slguan 已提交
75 76 77 78
  return -1
endi

print ================= step8
S
scripts  
slguan 已提交
79 80 81 82
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 已提交
83
sql select * from tb;
S
scripts  
slguan 已提交
84
if $rows != 22 then 
S
slguan 已提交
85 86 87 88
  return -1
endi

print ================= step9 only insert last one
S
scripts  
slguan 已提交
89
sql import into tb values(1564641705000, 5000)(1564641718000, 18000)(1564642400000, 700000)
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 ================= step10
S
scripts  
slguan 已提交
96
sql import into tb values(1564641705000, 5000)(1564641718000, 18000)(1564642400000, 70000)
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 ================= step11
S
scripts  
slguan 已提交
103
sql import into tb values(1564642400000, 700000)
S
slguan 已提交
104
sql select * from tb;
S
scripts  
slguan 已提交
105
if $rows != 25 then
S
slguan 已提交
106 107 108 109
  return -1
endi

print ================= step12
S
scripts  
slguan 已提交
110
sql import into tb values(1564641709527, 9527)(1564641709527, 9528)
S
slguan 已提交
111 112
sql select * from tb;
print rows=> $rows
S
scripts  
slguan 已提交
113
if $rows != 26 then
S
slguan 已提交
114 115 116 117
  return -1
endi

print ================= step13
S
scripts  
slguan 已提交
118
sql import into tb values(1564641709898, 9898)(1564641709897, 9897)
S
slguan 已提交
119 120
sql select * from tb;
print rows=> $rows
S
scripts  
slguan 已提交
121
if $rows != 28 then
S
slguan 已提交
122 123 124 125
  return -1
endi

sql drop database ibadb