basic1.sim 1.7 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 18 19 20 21 22 23 24 25
print ======== step1 
sql drop database if exists db1;
sql create database db1 vgroups 3;
sql use db1;
sql create stable st1 (ts timestamp, f1 int, f2 binary(200)) tags(t1 int);
sql create table tb1 using st1 tags(1);
sql insert into tb1 values ('2022-07-07 10:01:01', 11, "aaa");
sql insert into tb1 values ('2022-07-07 11:01:02', 12, "bbb");
sql create table tb2 using st1 tags(2);
sql insert into tb2 values ('2022-07-07 10:02:01', 21, "aaa");
sql insert into tb2 values ('2022-07-07 11:02:02', 22, "bbb");
sql create table tb3 using st1 tags(3);
sql insert into tb3 values ('2022-07-07 10:03:01', 31, "aaa");
sql insert into tb3 values ('2022-07-07 11:03:02', 32, "bbb");
sql create table tb4 using st1 tags(4);

sql insert into tb4 select * from tb1;

sql select * from tb4;
if $rows != 2 then
S
Shengliang Guan 已提交
26 27
  return -1
endi
D
dapan1121 已提交
28

S
Shengliang Guan 已提交
29 30 31 32
sql insert into tb4 select ts,f1,f2 from st1;
sql select * from tb4;
if $rows != 6 then
  return -1
S
Shengliang Guan 已提交
33
endi
S
Shengliang Guan 已提交
34 35 36 37 38
sql create table tba (ts timestamp, f1 binary(10), f2 bigint, f3 double);
sql_error insert into tba select * from tb1;
sql insert into tba (ts,f2,f1) select * from tb1;
sql select * from tba;
if $rows != 2 then
S
Shengliang Guan 已提交
39 40
  return -1
endi
S
Shengliang Guan 已提交
41 42 43 44
sql create table tbb (ts timestamp, f1 binary(10), f2 bigint, f3 double);
sql insert into tbb (f2,f1,ts) select f1+1,f2,ts+3 from tb2;
sql select * from tbb;
if $rows != 2 then
S
Shengliang Guan 已提交
45 46 47
  return -1
endi

S
Shengliang Guan 已提交
48
_OVER:
S
Shengliang Guan 已提交
49
system sh/exec.sh -n dnode1 -s stop -x SIGINT
S
Shengliang Guan 已提交
50
print =============== check
S
Shengliang Guan 已提交
51
$null=
S
Shengliang Guan 已提交
52

S
Shengliang Guan 已提交
53
system_content sh/checkValgrind.sh -n dnode1 
S
Shengliang Guan 已提交
54
print cmd return result ----> [ $system_content ]
S
Shengliang Guan 已提交
55 56
if $system_content > 1 then
  return -1
S
Shengliang Guan 已提交
57 58 59
endi 

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