4.sim 21.7 KB
Newer Older
S
slguan 已提交
1
system sh/stop_dnodes.sh
S
slguan 已提交
2
system sh/deploy.sh -n dnode1 -i 1
3
system sh/cfg.sh -n dnode1 -c walLevel -v 1
S
slguan 已提交
4 5
system sh/exec.sh -n dnode1 -s start

H
Haojun Liao 已提交
6
sleep 2000
S
slguan 已提交
7 8 9
sql connect
print ======================== dnode1 start

guanshengliang's avatar
scripts  
guanshengliang 已提交
10 11 12
$dbPrefix = db
$tbPrefix = tb
$mtPrefix = st
S
slguan 已提交
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
$tbNum = 10
$rowNum = 20
$totalNum = 200

print =============== step1
$i = 0
$db = $dbPrefix . $i
$mt = $mtPrefix . $i

sql create database $db
sql use $db
sql create table $mt (ts timestamp, tbcol1 smallint, tbcol2 bigint, tbcol3 float, tbcol4 double) TAGS(tgcol1 smallint, tgcol2 bigint, tgcol3 float, tgcol4 double)

$i = 0
while $i < 5
  $tb = $tbPrefix . $i
  sql create table $tb using $mt tags( 0, 0, 0, 0 )  
  $x = 0
  while $x < $rowNum
    $ms = $x . m 
33
    sql insert into $tb values (1626739200000 + $ms , 0, 0, 0, 0 ) 
S
slguan 已提交
34 35 36 37 38 39 40 41 42 43
    $x = $x + 1
  endw  
  $i = $i + 1
endw 
while $i < 10
  $tb = $tbPrefix . $i
  sql create table $tb using $mt tags( 1, 1, 1, 1 )  
  $x = 0
  while $x < $rowNum
    $ms = $x . m 
44
    sql insert into $tb values (1626739200000 + $ms , 1, 1, 1, 1 ) 
S
slguan 已提交
45 46 47 48 49 50 51 52 53 54 55
    $x = $x + 1
  endw  
  $i = $i + 1
endw 

print =============== step2
sql select * from $mt
if $rows != $totalNum then 
  return -1
endi

56
sql select * from $mt where ts < 1626739440001
S
slguan 已提交
57 58 59
if $rows != 50 then 
  return -1
endi
60
sql select * from $mt where ts > 1626739440001
S
slguan 已提交
61 62 63
if $rows != 150 then 
  return -1
endi
64
sql select * from $mt where ts = 1626739440001
S
slguan 已提交
65 66 67
if $rows != 0 then 
  return -1
endi
68
sql select * from $mt where ts > 1626739440001 and ts < 1626739500001
S
slguan 已提交
69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 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 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161
if $rows != 10 then 
  return -1
endi

print =============== step3
sql select * from $mt where tbcol1 = 0
if $rows != 100 then 
  return -1
endi
sql select * from $mt where tbcol1 <> 0
if $rows != 100 then 
  return -1
endi
sql select * from $mt where tbcol1 = 1
if $rows != 100 then 
  return -1
endi
sql select * from $mt where tbcol1 <> 1
if $rows != 100 then 
  return -1
endi
sql select * from $mt where tbcol1 = 1
if $rows != 100 then 
  return -1
endi
sql select * from $mt where tbcol1 <> 1
if $rows != 100 then 
  return -1
endi
sql select * from $mt where tbcol1 = 0
if $rows != 100 then 
  return -1
endi
sql select * from $mt where tbcol1 <> 0
if $rows != 100 then 
  return -1
endi

print =============== step4
sql select * from $mt where tbcol2 = 0
if $rows != 100 then 
  return -1
endi
sql select * from $mt where tbcol2 <> 0
if $rows != 100 then 
  return -1
endi
sql select * from $mt where tbcol2 = 1
if $rows != 100 then 
  return -1
endi
sql select * from $mt where tbcol2 <> 1
if $rows != 100 then 
  return -1
endi

print =============== step5
sql select * from $mt where tbcol3 = 0
if $rows != 100 then 
  return -1
endi
sql select * from $mt where tbcol3 <> 0
if $rows != 100 then 
  return -1
endi
sql select * from $mt where tbcol3 = 1
if $rows != 100 then 
  return -1
endi
sql select * from $mt where tbcol3 <> 1
if $rows != 100 then 
  return -1
endi

print =============== step6
sql select * from $mt where tbcol4 = 0
if $rows != 100 then 
  return -1
endi
sql select * from $mt where tbcol4 <> 0
if $rows != 100 then 
  return -1
endi
sql select * from $mt where tbcol4 = 1
if $rows != 100 then 
  return -1
endi
sql select * from $mt where tbcol4 <> 1
if $rows != 100 then 
  return -1
endi

print =============== step7
162
sql select * from $mt where ts > 1626739440001 and tbcol1 = 1
S
slguan 已提交
163 164 165
if $rows != 75 then 
  return -1
endi
166
sql select * from $mt where ts > 1626739440001 and tbcol1 <> 1
S
slguan 已提交
167 168 169
if $rows != 75 then 
  return -1
endi
170
sql select * from $mt where ts < 1626739440001 and tbcol1 = 0
S
slguan 已提交
171 172 173
if $rows != 25 then 
  return -1
endi
174
sql select * from $mt where ts < 1626739440001 and tbcol1 <> 0
S
slguan 已提交
175 176 177
if $rows != 25 then 
  return -1
endi
178
sql select * from $mt where ts <= 1626739440001 and tbcol1 = 0
S
slguan 已提交
179 180 181
if $rows != 25 then 
  return -1
endi
182
sql select * from $mt where ts <= 1626739440001 and tbcol1 <> 0
S
slguan 已提交
183 184 185
if $rows != 25 then 
  return -1
endi
186
sql select * from $mt where ts > 1626739440001 and ts < 1626739500001 and tbcol1 <> 0
S
slguan 已提交
187 188 189
if $rows != 5 then 
  return -1
endi
190
sql select * from $mt where ts > 1626739440001 and tbcol1 <> 0 and ts < 1626739500001
S
slguan 已提交
191 192 193 194 195
if $rows != 5 then 
  return -1
endi

print =============== step8
196
sql select * from $mt where ts > 1626739440001 and tbcol2 = 1
S
slguan 已提交
197 198 199
if $rows != 75 then 
  return -1
endi
200
sql select * from $mt where ts > 1626739440001 and tbcol2 <> 1
S
slguan 已提交
201 202 203
if $rows != 75 then 
  return -1
endi
204
sql select * from $mt where ts < 1626739440001 and tbcol2 = 0
S
slguan 已提交
205 206 207
if $rows != 25 then 
  return -1
endi
208
sql select * from $mt where ts < 1626739440001 and tbcol2 <> 0
S
slguan 已提交
209 210 211
if $rows != 25 then 
  return -1
endi
212
sql select * from $mt where ts <= 1626739440001 and tbcol2 = 0
S
slguan 已提交
213 214 215
if $rows != 25 then 
  return -1
endi
216
sql select * from $mt where ts <= 1626739440001 and tbcol2 <> 0
S
slguan 已提交
217 218 219
if $rows != 25 then 
  return -1
endi
220
sql select * from $mt where ts > 1626739440001 and ts < 1626739500001 and tbcol2 <> 0
S
slguan 已提交
221 222 223
if $rows != 5 then 
  return -1
endi
224
sql select * from $mt where ts > 1626739440001 and tbcol2 <> 0 and ts < 1626739500001
S
slguan 已提交
225 226 227 228 229
if $rows != 5 then 
  return -1
endi

print =============== step9
230
sql select * from $mt where ts > 1626739440001 and tbcol3 = 1
S
slguan 已提交
231 232 233
if $rows != 75 then 
  return -1
endi
234
sql select * from $mt where ts > 1626739440001 and tbcol3 <> 1
S
slguan 已提交
235 236 237
if $rows != 75 then 
  return -1
endi
238
sql select * from $mt where ts < 1626739440001 and tbcol3 = 0
S
slguan 已提交
239 240 241
if $rows != 25 then 
  return -1
endi
242
sql select * from $mt where ts < 1626739440001 and tbcol3 <> 0
S
slguan 已提交
243 244 245
if $rows != 25 then 
  return -1
endi
246
sql select * from $mt where ts <= 1626739440001 and tbcol3 = 0
S
slguan 已提交
247 248 249
if $rows != 25 then 
  return -1
endi
250
sql select * from $mt where ts <= 1626739440001 and tbcol3 <> 0
S
slguan 已提交
251 252 253
if $rows != 25 then 
  return -1
endi
254
sql select * from $mt where ts > 1626739440001 and ts < 1626739500001 and tbcol3 <> 0
S
slguan 已提交
255 256 257
if $rows != 5 then 
  return -1
endi
258
sql select * from $mt where ts > 1626739440001 and tbcol3 <> 0 and ts < 1626739500001
S
slguan 已提交
259 260 261 262 263
if $rows != 5 then 
  return -1
endi

print =============== step10
264
sql select * from $mt where ts > 1626739440001 and tbcol4 = 1
S
slguan 已提交
265 266 267
if $rows != 75 then 
  return -1
endi
268
sql select * from $mt where ts > 1626739440001 and tbcol4 <> 1
S
slguan 已提交
269 270 271
if $rows != 75 then 
  return -1
endi
272
sql select * from $mt where ts < 1626739440001 and tbcol4 = 0
S
slguan 已提交
273 274 275
if $rows != 25 then 
  return -1
endi
276
sql select * from $mt where ts < 1626739440001 and tbcol4 <> 0
S
slguan 已提交
277 278 279
if $rows != 25 then 
  return -1
endi
280
sql select * from $mt where ts <= 1626739440001 and tbcol4 = 0
S
slguan 已提交
281 282 283
if $rows != 25 then 
  return -1
endi
284
sql select * from $mt where ts <= 1626739440001 and tbcol4 <> 0
S
slguan 已提交
285 286 287
if $rows != 25 then 
  return -1
endi
288
sql select * from $mt where ts > 1626739440001 and ts < 1626739500001 and tbcol4 <> 0
S
slguan 已提交
289 290 291
if $rows != 5 then 
  return -1
endi
292
sql select * from $mt where ts > 1626739440001 and tbcol4 <> 0 and ts < 1626739500001
S
slguan 已提交
293 294 295 296 297
if $rows != 5 then 
  return -1
endi

print =============== step11
298
sql select * from $mt where ts > 1626739440001 and tbcol2 = 1 and tbcol1 = 1
S
slguan 已提交
299 300 301
if $rows != 75 then 
  return -1
endi
302
sql select * from $mt where ts > 1626739440001 and tbcol2 <> 1 and tbcol1 <> 1
S
slguan 已提交
303 304 305
if $rows != 75 then 
  return -1
endi
306
sql select * from $mt where ts < 1626739440001 and tbcol2 = 0 and tbcol1 = 0
S
slguan 已提交
307 308 309
if $rows != 25 then 
  return -1
endi
310
sql select * from $mt where ts < 1626739440001 and tbcol2 <> 0 and tbcol1 <> 0
S
slguan 已提交
311 312 313
if $rows != 25 then 
  return -1
endi
314
sql select * from $mt where ts <= 1626739440001 and tbcol2 = 0 and tbcol1 = 0
S
slguan 已提交
315 316 317
if $rows != 25 then 
  return -1
endi
318
sql select * from $mt where ts <= 1626739440001 and tbcol2 <> 0 and tbcol1 <> 0
S
slguan 已提交
319 320 321
if $rows != 25 then 
  return -1
endi
322
sql select * from $mt where ts > 1626739440001 and ts < 1626739500001 and tbcol2 <> 0 and tbcol1 <> 0
S
slguan 已提交
323 324 325
if $rows != 5 then 
  return -1
endi
326
sql select * from $mt where ts > 1626739440001 and tbcol2 <> 0 and ts < 1626739500001 and ts < 1626739500001 and tbcol1 <> 0
S
slguan 已提交
327 328 329 330 331
if $rows != 5 then 
  return -1
endi

print =============== step12
332
sql select * from $mt where ts > 1626739440001 and tbcol3 = 1 and tbcol1 = 1
S
slguan 已提交
333 334 335
if $rows != 75 then 
  return -1
endi
336
sql select * from $mt where ts > 1626739440001 and tbcol3 <> 1 and tbcol1 <> 1
S
slguan 已提交
337 338 339
if $rows != 75 then 
  return -1
endi
340
sql select * from $mt where ts < 1626739440001 and tbcol3 = 0 and tbcol1 = 0
S
slguan 已提交
341 342 343
if $rows != 25 then 
  return -1
endi
344
sql select * from $mt where ts < 1626739440001 and tbcol3 <> 0 and tbcol1 <> 0
S
slguan 已提交
345 346 347
if $rows != 25 then 
  return -1
endi
348
sql select * from $mt where ts <= 1626739440001 and tbcol3 = 0 and tbcol1 = 0
S
slguan 已提交
349 350 351
if $rows != 25 then 
  return -1
endi
352
sql select * from $mt where ts <= 1626739440001 and tbcol3 <> 0 and tbcol1 <> 0
S
slguan 已提交
353 354 355
if $rows != 25 then 
  return -1
endi
356
sql select * from $mt where ts > 1626739440001 and ts < 1626739500001 and tbcol3 <> 0 and tbcol1 <> 0
S
slguan 已提交
357 358 359
if $rows != 5 then 
  return -1
endi
360
sql select * from $mt where ts > 1626739440001 and tbcol3 <> 0 and ts < 1626739500001 and ts < 1626739500001 and tbcol1 <> 0
S
slguan 已提交
361 362 363 364 365
if $rows != 5 then 
  return -1
endi

print =============== step13
366
sql select * from $mt where ts > 1626739440001 and tbcol3 = 1 and tbcol2 = 1
S
slguan 已提交
367 368 369
if $rows != 75 then 
  return -1
endi
370
sql select * from $mt where ts > 1626739440001 and tbcol3 <> 1 and tbcol2 <> 1
S
slguan 已提交
371 372 373
if $rows != 75 then 
  return -1
endi
374
sql select * from $mt where ts < 1626739440001 and tbcol3 = 0 and tbcol2 = 0
S
slguan 已提交
375 376 377
if $rows != 25 then 
  return -1
endi
378
sql select * from $mt where ts < 1626739440001 and tbcol3 <> 0 and tbcol2 <> 0
S
slguan 已提交
379 380 381
if $rows != 25 then 
  return -1
endi
382
sql select * from $mt where ts <= 1626739440001 and tbcol3 = 0 and tbcol2 = 0
S
slguan 已提交
383 384 385
if $rows != 25 then 
  return -1
endi
386
sql select * from $mt where ts <= 1626739440001 and tbcol3 <> 0 and tbcol2 <> 0
S
slguan 已提交
387 388 389
if $rows != 25 then 
  return -1
endi
390
sql select * from $mt where ts > 1626739440001 and ts < 1626739500001 and tbcol3 <> 0 and tbcol2 <> 0
S
slguan 已提交
391 392 393
if $rows != 5 then 
  return -1
endi
394
sql select * from $mt where ts > 1626739440001 and tbcol3 <> 0 and ts < 1626739500001 and ts < 1626739500001 and tbcol2 <> 0
S
slguan 已提交
395 396 397 398 399
if $rows != 5 then 
  return -1
endi

print =============== step14
400
sql select * from $mt where ts > 1626739440001 and tbcol3 = 1 and tbcol4 = 1
S
slguan 已提交
401 402 403
if $rows != 75 then 
  return -1
endi
404
sql select * from $mt where ts > 1626739440001 and tbcol3 <> 1 and tbcol4 <> 1
S
slguan 已提交
405 406 407
if $rows != 75 then 
  return -1
endi
408
sql select * from $mt where ts < 1626739440001 and tbcol3 = 0 and tbcol4 = 0
S
slguan 已提交
409 410 411
if $rows != 25 then 
  return -1
endi
412
sql select * from $mt where ts < 1626739440001 and tbcol3 <> 0 and tbcol4 <> 0
S
slguan 已提交
413 414 415
if $rows != 25 then 
  return -1
endi
416
sql select * from $mt where ts <= 1626739440001 and tbcol3 = 0 and tbcol4 = 0
S
slguan 已提交
417 418 419
if $rows != 25 then 
  return -1
endi
420
sql select * from $mt where ts <= 1626739440001 and tbcol3 <> 0 and tbcol4 <> 0
S
slguan 已提交
421 422 423
if $rows != 25 then 
  return -1
endi
424
sql select * from $mt where ts > 1626739440001 and ts < 1626739500001 and tbcol3 <> 0 and tbcol4 <> 0
S
slguan 已提交
425 426 427
if $rows != 5 then 
  return -1
endi
428
sql select * from $mt where ts > 1626739440001 and tbcol3 <> 0 and ts < 1626739500001 and ts < 1626739500001 and tbcol4 <> 0
S
slguan 已提交
429 430 431 432 433
if $rows != 5 then 
  return -1
endi

print =============== step15
434
sql select * from $mt where ts > 1626739440001 and tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1
S
slguan 已提交
435 436 437
if $rows != 75 then 
  return -1
endi
438
sql select * from $mt where ts > 1626739440001 and tbcol1 <> 1 and tbcol2 <> 1  and tbcol3 <> 1
S
slguan 已提交
439 440 441
if $rows != 75 then 
  return -1
endi
442
sql select * from $mt where ts < 1626739440001 and tbcol1 = 0 and tbcol2 = 0 and tbcol3 = 0
S
slguan 已提交
443 444 445
if $rows != 25 then 
  return -1
endi
446
sql select * from $mt where ts < 1626739440001 and tbcol1 <> 0 and tbcol2 <> 0 and tbcol3 <> 0
S
slguan 已提交
447 448 449
if $rows != 25 then 
  return -1
endi
450
sql select * from $mt where ts <= 1626739440001 and tbcol1 = 0 and tbcol2 = 0 and tbcol3 = 0
S
slguan 已提交
451 452 453
if $rows != 25 then 
  return -1
endi
454
sql select * from $mt where ts <= 1626739440001 and tbcol1 <> 0 and tbcol2 <> 0 and tbcol3 <> 0
S
slguan 已提交
455 456 457
if $rows != 25 then 
  return -1
endi
458
sql select * from $mt where ts > 1626739440001 and ts < 1626739500001 and tbcol1 <> 0 and tbcol2 <> 0  and tbcol3 <> 0
S
slguan 已提交
459 460 461
if $rows != 5 then 
  return -1
endi
462
sql select * from $mt where ts > 1626739440001 and tbcol1 <> 0 and ts < 1626739500001 and ts < 1626739500001 and tbcol2 <> 0  and tbcol3 <> 0
S
slguan 已提交
463 464 465 466 467
if $rows != 5 then 
  return -1
endi

print =============== step16
468
sql select * from $mt where ts > 1626739440001 and tbcol4 = 1 and tbcol2 = 1 and tbcol3 = 1
S
slguan 已提交
469 470 471
if $rows != 75 then 
  return -1
endi
472
sql select * from $mt where ts > 1626739440001 and tbcol4 <> 1 and tbcol2 <> 1  and tbcol3 <> 1
S
slguan 已提交
473 474 475
if $rows != 75 then 
  return -1
endi
476
sql select * from $mt where ts < 1626739440001 and tbcol4 = 0 and tbcol2 = 0 and tbcol3 = 0
S
slguan 已提交
477 478 479
if $rows != 25 then 
  return -1
endi
480
sql select * from $mt where ts < 1626739440001 and tbcol4 <> 0 and tbcol2 <> 0 and tbcol3 <> 0
S
slguan 已提交
481 482 483
if $rows != 25 then 
  return -1
endi
484
sql select * from $mt where ts <= 1626739440001 and tbcol4 = 0 and tbcol2 = 0 and tbcol3 = 0
S
slguan 已提交
485 486 487
if $rows != 25 then 
  return -1
endi
488
sql select * from $mt where ts <= 1626739440001 and tbcol4 <> 0 and tbcol2 <> 0 and tbcol3 <> 0
S
slguan 已提交
489 490 491
if $rows != 25 then 
  return -1
endi
492
sql select * from $mt where ts > 1626739440001 and ts < 1626739500001 and tbcol4 <> 0 and tbcol2 <> 0  and tbcol3 <> 0
S
slguan 已提交
493 494 495
if $rows != 5 then 
  return -1
endi
496
sql select * from $mt where ts > 1626739440001 and tbcol4 <> 0 and ts < 1626739500001 and ts < 1626739500001 and tbcol2 <> 0  and tbcol3 <> 0
S
slguan 已提交
497 498 499 500 501
if $rows != 5 then 
  return -1
endi

print =============== step17
502
sql select * from $mt where ts > 1626739440001 and tbcol4 = 1 and tbcol2 = 1 and tbcol3 = 1 and tbcol1 = 1
S
slguan 已提交
503 504 505
if $rows != 75 then 
  return -1
endi
506
sql select * from $mt where ts > 1626739440001 and tbcol4 <> 1 and tbcol2 <> 1  and tbcol3 <> 1 and tbcol1 <> 1
S
slguan 已提交
507 508 509
if $rows != 75 then 
  return -1
endi
510
sql select * from $mt where ts < 1626739440001 and tbcol4 = 0 and tbcol2 = 0 and tbcol3 = 0 and tbcol1 = 0
S
slguan 已提交
511 512 513
if $rows != 25 then 
  return -1
endi
514
sql select * from $mt where ts < 1626739440001 and tbcol4 <> 0 and tbcol2 <> 0 and tbcol3 <> 0 and tbcol1 <> 0
S
slguan 已提交
515 516 517
if $rows != 25 then 
  return -1
endi
518
sql select * from $mt where ts <= 1626739440001 and tbcol4 = 0 and tbcol2 = 0 and tbcol3 = 0 and tbcol1 = 0
S
slguan 已提交
519 520 521
if $rows != 25 then 
  return -1
endi
522
sql select * from $mt where ts <= 1626739440001 and tbcol4 <> 0 and tbcol2 <> 0 and tbcol3 <> 0 and tbcol1 <> 0
S
slguan 已提交
523 524 525
if $rows != 25 then 
  return -1
endi
526
sql select * from $mt where ts > 1626739440001 and ts < 1626739500001 and tbcol4 <> 0 and tbcol2 <> 0  and tbcol3 <> 0 and tbcol1 <> 0
S
slguan 已提交
527 528 529
if $rows != 5 then 
  return -1
endi
530
sql select * from $mt where ts > 1626739440001 and tbcol4 <> 0 and ts < 1626739500001 and ts < 1626739500001 and tbcol2 <> 0  and tbcol3 <> 0 and tbcol1 <> 0
S
slguan 已提交
531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567
if $rows != 5 then 
  return -1
endi

print =============== step18
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt
print $data00 $data01 $data02 $data03 $data04 $data05 $data06 
if $data00 != 200 then 
  return -1
endi

print =============== step19
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1
print $data00 $data01 $data02 $data03 $data04 $data05 $data06 
if $data00 != 100 then 
  return -1
endi

sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 and tbcol2 = 1 
print $data00 $data01 $data02 $data03 $data04 $data05 $data06 
if $data00 != 100 then 
  return -1
endi

sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1
print $data00 $data01 $data02 $data03 $data04 $data05 $data06 
if $data00 != 100 then 
  return -1
endi

sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1  and tbcol4 = 1
print $data00 $data01 $data02 $data03 $data04 $data05 $data06 
if $data00 != 100 then 
  return -1
endi

print =============== step20
568
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where ts < 1626739440001
S
slguan 已提交
569 570 571 572 573
print $data00 $data01 $data02 $data03 $data04 $data05 $data06 
if $data00 != 50 then 
  return -1
endi

574
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where ts < 1626739440001 and tbcol1 = 1
S
slguan 已提交
575 576 577 578 579
print $data00 $data01 $data02 $data03 $data04 $data05 $data06 
if $data00 != 25 then 
  return -1
endi

580
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where ts < 1626739440001 and tbcol1 = 1 and tbcol2 = 1 
S
slguan 已提交
581 582 583 584 585
print $data00 $data01 $data02 $data03 $data04 $data05 $data06 
if $data00 != 25 then 
  return -1
endi

586
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where ts < 1626739440001 and tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1
S
slguan 已提交
587 588 589 590 591
print $data00 $data01 $data02 $data03 $data04 $data05 $data06 
if $data00 != 25 then 
  return -1
endi

592
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where ts < 1626739440001 and tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 and tbcol4 = 1
S
slguan 已提交
593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648
print $data00 $data01 $data02 $data03 $data04 $data05 $data06 
if $data00 != 25 then 
  return -1
endi

print =============== step21
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt group by tgcol1
print $data00 $data01 $data02 $data03 $data04 $data05 $data06 
if $data00 != 100 then 
  return -1
endi

sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt group by tgcol2
print $data00 $data01 $data02 $data03 $data04 $data05 $data06 
if $data00 != 100 then 
  return -1
endi

sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt group by tgcol3
print $data00 $data01 $data02 $data03 $data04 $data05 $data06 
if $data00 != 100 then 
  return -1
endi

sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt group by tgcol4
print $data00 $data01 $data02 $data03 $data04 $data05 $data06 
if $data00 != 100 then 
  return -1
endi

print =============== step22
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 group by tgcol1
print $data00 $data01 $data02 $data03 $data04 $data05 $data06 
if $data00 != 100 then 
  return -1
endi

sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 and tbcol2 = 1  group by tgcol1
print $data00 $data01 $data02 $data03 $data04 $data05 $data06 
if $data00 != 100 then 
  return -1
endi

sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 group by tgcol1
print $data00 $data01 $data02 $data03 $data04 $data05 $data06 
if $data00 != 100 then 
  return -1
endi

sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 and tbcol4 = 1 group by tgcol1
print $data00 $data01 $data02 $data03 $data04 $data05 $data06 
if $data00 != 100 then 
  return -1
endi

print =============== step23
649
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where ts < 1626739440001 group by tgcol2
S
slguan 已提交
650 651 652 653 654
print $data00 $data01 $data02 $data03 $data04 $data05 $data06 
if $data00 != 25 then 
  return -1
endi

655
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where ts < 1626739440001 and tbcol1 = 1 group by tgcol2
S
slguan 已提交
656 657 658 659 660
print $data00 $data01 $data02 $data03 $data04 $data05 $data06 
if $data00 != 25 then 
  return -1
endi

661
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where ts < 1626739440001 and tbcol1 = 1 and tbcol2 = 1  group by tgcol2
S
slguan 已提交
662 663 664 665 666
print $data00 $data01 $data02 $data03 $data04 $data05 $data06 
if $data00 != 25 then 
  return -1
endi

667
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where ts < 1626739440001 and tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 group by tgcol2
S
slguan 已提交
668 669 670 671 672
print $data00 $data01 $data02 $data03 $data04 $data05 $data06 
if $data00 != 25 then 
  return -1
endi

673
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where ts < 1626739440001 and tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 and tbcol4 = 1 group by tgcol2
S
slguan 已提交
674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708
print $data00 $data01 $data02 $data03 $data04 $data05 $data06 
if $data00 != 25 then 
  return -1
endi

print =============== step24
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 interval(1d) group by tgcol1 order by tgcol1 desc
print $data00 $data01 $data02 $data03 $data04 $data05 $data06 
if $data01 != 100 then 
  return -1
endi

sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 interval(1d) group by tgcol2 order by tgcol2 desc
print $data00 $data01 $data02 $data03 $data04 $data05 $data06 
if $data01 != 100 then 
  return -1
endi

sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 interval(1d) group by tgcol3 order by tgcol3 desc
print $data00 $data01 $data02 $data03 $data04 $data05 $data06 
if $data01 != 100 then 
  return -1
endi

sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 and tbcol4 = 1 interval(1d) group by tgcol4 order by tgcol4 desc
print $data00 $data01 $data02 $data03 $data04 $data05 $data06 
if $data01 != 100 then 
  return -1
endi

print =============== clear
sql drop database $db
sql show databases
if $rows != 0 then 
  return -1
guanshengliang's avatar
scripts  
guanshengliang 已提交
709 710 711
endi

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