regressiontest.sim 2.2 KB
Newer Older
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 30 31 32 33
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/exec.sh -n dnode1 -s start
sql connect

$dbPrefix = reg_db
$tb = tb
$rowNum = 8200

$ts0 = 1537146000000
$delta = 100
print ========== reg.sim
$i = 0
$db = $dbPrefix . $i

sql drop database if exists $db -x step1
step1:
sql create database $db vgroups 1;

sql use $db
sql create table $tb (ts timestamp, c1 int)

$i = 0
$ts = $ts0

$x = 0
while $x < $rowNum
$xs = $x * $delta
$ts = $ts0 + $xs
sql insert into $tb values ( $ts , $x )
$x = $x + 1
endw

34
sql flush database $db
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51

sql delete from $tb where ts=1537146000000
sql delete from $tb where ts=1537146409500

print =========================> TS-2410
sql select * from  $tb limit 20 offset 4090
print $data00
print $data10
print $data20
print $data30
print $data40
print $data50
print $data60
print $data70
print $data80
print $data90

H
Haojun Liao 已提交
52
if $data40 != @18-09-17 09:06:49.600@ then
53 54 55
 return -1
endi

56 57 58 59 60
sql select * from $tb order by ts desc;
if $rows != 8198 then
  return -1
endi

61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84
sql drop database if exists $db -x step1
sql create database $db vgroups 1;

sql use $db
sql create stable st1 (ts timestamp, c  int) tags(a  int);
sql create table t1 using st1 tags(1);
sql create table t2 using st1 tags(2);

$i = 0
$ts = 1674977959000
$rowNum = 200

$x = 0
while $x < $rowNum
$xs = $x * $delta
$ts = $ts0 + $xs
sql insert into t1 values ( $ts , $x )
sql insert into t2 values ( $ts + 1000a, $x )
$x = $x + 1
$ts = $ts + 1000
endw

sql flush database $db

85 86
print ===========================>  TD-22077  && TD-21877

87 88 89 90 91 92 93 94 95
sql insert into t1 values('2018-09-17 09:00:26', 26);
sql insert into t2 values('2018-09-17 09:00:25', 25);

sql insert into t2 values('2018-09-17 09:00:30', 30);
sql flush  database reg_db0;

sql delete from st1 where ts<='2018-9-17 09:00:26';
sql select * from st1;

96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124
sql drop table t1
sql drop table t2

print =========================================>TD-22196
sql create table t1 using st1 tags(1);

$i = 0
$ts = 1674977959000
$rowNum = 200

$x = 0
while $x < $rowNum
$xs = $x * $delta
$ts = $ts0 + $xs
sql insert into t1 values ( $ts , $x )
$x = $x + 1
$ts = $ts + 1000
endw

sql flush database $db
sql select min(c),max(c) from t1
if $data00 != 0 then
   return -1
endi

if $data01 != 199 then
  return -1
endi

125
system sh/exec.sh -n dnode1 -s stop -x SIGINT