basic1.sim 2.2 KB
Newer Older
S
Shengliang Guan 已提交
1 2
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
S
Shengliang Guan 已提交
3
system sh/exec.sh -n dnode1 -s start -v
S
Shengliang Guan 已提交
4 5
sql connect

S
Shengliang Guan 已提交
6 7 8 9 10 11 12 13 14 15 16 17
print =============== step1: create drop show dnodes
$x = 0
step1:
	$x = $x + 1
	sleep 1000
	if $x == 10 then
	  print ---> dnode not ready!
		return -1
	endi
sql show dnodes
print ---> $data00 $data01 $data02 $data03 $data04 $data05
if $rows != 1 then
S
Shengliang Guan 已提交
18 19
  return -1
endi
S
Shengliang Guan 已提交
20 21
if $data(1)[4] != ready then
  goto step1
S
Shengliang Guan 已提交
22 23
endi

S
Shengliang Guan 已提交
24 25 26
$tbPrefix = tb
$tbNum = 5
$rowNum = 10
S
Shengliang Guan 已提交
27

S
Shengliang Guan 已提交
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
print =============== step2: prepare data
sql create database db vgroups 2
sql use db
sql create table if not exists stb (ts timestamp, tbcol int, tbcol2 float, tbcol3 double) tags (tgcol int unsigned)

$i = 0
while $i < $tbNum
  $tb = $tbPrefix . $i
  sql create table $tb using stb tags( $i )
  $x = 0
  while $x < $rowNum
    $cc = $x * 60000
    $ms = 1601481600000 + $cc
    sql insert into $tb values ($ms , $x , $x , $x ) 
    $x = $x + 1
  endw 
  $i = $i + 1
endw 

print =============== step3: tb
S
Shengliang Guan 已提交
48 49 50 51 52 53 54 55 56 57 58
sql explain analyze select ts from stb where -2;
sql explain analyze select ts from tb1;
sql explain analyze select ts from stb order by ts;
sql explain analyze select * from information_schema.user_stables;
sql explain analyze select count(*),sum(tbcol) from tb1;
sql explain analyze select count(*),sum(tbcol) from stb;
sql explain analyze select count(*),sum(tbcol) from stb group by tbcol;
sql explain analyze select * from information_schema.user_stables;
sql explain analyze verbose true select * from information_schema.user_stables where db_name='db2';
sql explain analyze verbose true select count(tbcol), avg(tbcol), max(tbcol), min(tbcol), count(tbcol) from stb where ts <= 1601481840000 and ts >= 1601481800000 partition by tgcol interval(1m) fill(value, 0)
sql explain select count(tbcol), avg(tbcol), max(tbcol), min(tbcol), count(tbcol) from stb where ts <= 1601481840000 and ts >= 1601481800000 partition by tgcol interval(1m) fill(value, 0)
S
Shengliang Guan 已提交
59

S
Shengliang Guan 已提交
60
_OVER:
S
Shengliang Guan 已提交
61
system sh/exec.sh -n dnode1 -s stop -x SIGINT
S
Shengliang Guan 已提交
62
print =============== check
S
Shengliang Guan 已提交
63
$null=
S
Shengliang Guan 已提交
64

S
Shengliang Guan 已提交
65
system_content sh/checkValgrind.sh -n dnode1 
S
Shengliang Guan 已提交
66
print cmd return result ----> [ $system_content ]
S
Shengliang Guan 已提交
67
if $system_content > 0 then
S
Shengliang Guan 已提交
68
  return -1
S
Shengliang Guan 已提交
69 70 71
endi 

if $system_content == $null then
S
Shengliang Guan 已提交
72
  return -1
D
dapan1121 已提交
73
endi