select_across_vnodes.sim 1.7 KB
Newer Older
S
slguan 已提交
1
system sh/stop_dnodes.sh
S
slguan 已提交
2 3

system sh/deploy.sh -n dnode1 -i 1
H
hjxilinx 已提交
4
system sh/cfg.sh -n dnode1 -c walLevel -v 0
S
scripts  
slguan 已提交
5
system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 5
S
slguan 已提交
6
system sh/exec.sh -n dnode1 -s start
H
Haojun Liao 已提交
7
sleep 100
S
slguan 已提交
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 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81
sql connect

$dbPrefix = sav_db
$tbPrefix = sav_tb
$stbPrefix = sav_stb
$tbNum = 20
$rowNum = 10
$totalNum = $tbNum * $rowNum
$ts0 = 1537146000000
$delta = 600000
print ========== alter.sim
$i = 0
$db = $dbPrefix
$stb = $stbPrefix

sql drop database if exists $db
sql create database $db
sql use $db
print ====== create tables
sql create table $stb (ts timestamp, c1 int, c2 bigint, c3 float, c4 double, c5 smallint, c6 tinyint, c7 bool, c8 binary(10), c9 nchar(10)) tags(t1 int)

$i = 0
$ts = $ts0
while $i < $tbNum
  $tb = $tbPrefix . $i
  sql create table $tb using $stb tags( $i )
 
  $x = 0
  while $x < $rowNum
    $xs = $x * $delta
    $ts = $ts0 + $xs
    $c = $x / 10
    $c = $c * 10
    $c = $x - $c
    $binary = 'binary . $c
    $binary = $binary . '
    $nchar = '涛思 . $c
    $nchar = $nchar . '
    sql insert into $tb values ( $ts , $c , $c , $c , $c , $c , $c , true, $binary , $nchar ) 
    $x = $x + 1
  endw 

  $i = $i + 1
endw 
print ====== tables created

##### select * from stb
sql select * from $stb
if $rows != $totalNum then
  return -1
endi

##### select * from $stb with limit
sql select * from $stb limit 1 
if $rows != 1 then
  return -1
endi

$limit = $rowNum / 2
sql select * from $stb limit $limit
if $rows != $limit then
  return -1
endi

sql select last(*) from $stb where t1 >= 0 group by t1 limit 5
if $rows != $tbNum then
  return -1
endi

sql drop database $db
sql show databases
if $rows != 0 then 
  return -1
endi
S
scripts  
Shengliang Guan 已提交
82 83

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