TDengine/tests/script/general/insert/basic.sim

49 lines
832 B
Text
Raw Normal View History

2020-04-19 15:28:22 +00:00
system sh/stop_dnodes.sh
2020-04-29 09:30:03 +00:00
system sh/deploy.sh -n dnode1 -i 1
2020-05-07 06:28:39 +00:00
system sh/cfg.sh -n dnode1 -c walLevel -v 0
2020-04-19 15:28:22 +00:00
system sh/exec.sh -n dnode1 -s start
2021-01-20 05:43:54 +00:00
sleep 2000
2020-04-19 15:28:22 +00:00
sql connect
$i = 0
2020-11-03 07:36:59 +00:00
$dbPrefix = d
$tbPrefix = t
2020-04-19 15:28:22 +00:00
$db = $dbPrefix . $i
$tb = $tbPrefix . $i
print =============== step1
sql drop database -x step1
step1:
sql create database $db
sql use $db
sql create table $tb (ts timestamp, speed int)
$x = 0
while $x < 10
2020-11-03 07:36:59 +00:00
$cc = $x * 60000
$ms = 1601481600000 + $cc
sql insert into $tb values ($ms , $x )
2020-04-19 15:28:22 +00:00
$x = $x + 1
endw
print =============== step 2
2020-11-03 07:36:59 +00:00
$x = 0
while $x < 5
$cc = $x * 60000
$ms = 1551481600000 + $cc
sql insert into $tb values ($ms , $x )
$x = $x + 1
endw
2020-04-19 15:28:22 +00:00
sql select * from $tb
print $rows points data are retrieved
2020-11-03 07:36:59 +00:00
if $rows != 15 then
2020-04-19 15:28:22 +00:00
return -1
endi
2020-05-08 03:51:34 +00:00
system sh/exec.sh -n dnode1 -s stop -x SIGINT