未验证 提交 164dea54 编写于 作者: C Cary Xu 提交者: GitHub

Merge pull request #15290 from taosdata/feature/TD-11274-3.0

test: add test case basic2.sim
......@@ -69,6 +69,7 @@
./test.sh -f tsim/insert/basic.sim
./test.sh -f tsim/insert/basic0.sim
./test.sh -f tsim/insert/basic1.sim
./test.sh -f tsim/insert/basic2.sim
./test.sh -f tsim/insert/commit-merge0.sim
./test.sh -f tsim/insert/insert_drop.sim
./test.sh -f tsim/insert/insert_select.sim
......
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/exec.sh -n dnode1 -s start
sql connect
print =============== create database
sql create database d0 keep 365000d,365000d,365000d
sql use d0
print =============== create super table
sql create table if not exists stb (ts timestamp, c1 int unsigned, c2 double, c3 binary(10), c4 nchar(10), c5 double) tags (city binary(20),district binary(20));
sql show stables
if $rows != 1 then
return -1
endi
print =============== create child table
sql create table ct1 using stb tags("BeiJing", "ChaoYang")
sql create table ct2 using stb tags("BeiJing", "HaiDian")
sql show tables
if $rows != 2 then
return -1
endi
print =============== step3-1 insert records into ct1
sql insert into ct1 values('2022-05-03 16:59:00.010', 10, 20, 'n','n',30);
sql insert into ct1 values('2022-05-03 16:59:00.011', 'N', 'n', 'N',"N",30);
sql insert into ct1 values('2022-05-03 16:59:00.012', 'Nu', 'nul', 'Nul','NUL',30);
sql insert into ct1 values('2022-05-03 16:59:00.013', NULL, 'null', 'Null',null,30);
sql insert into ct1 values('2022-05-03 16:59:00.014', NULL, 'NuLL', 'Null',NULL,30);
sql_error insert into ct1 values('2022-05-03 16:59:00.015', NULL, 20, 'Null',NUL,30);
sql_error insert into ct1 values('2022-05-03 16:59:00.015', NULL, 20, 'Null',NU,30);
sql_error insert into ct1 values('2022-05-03 16:59:00.015', NULL, 20, 'Null',Nu,30);
sql_error insert into ct1 values('2022-05-03 16:59:00.015', NULL, 20, 'Null',N,30);
sql_error insert into ct1 values('2022-05-03 16:59:00.015', N, 20, 'Null',NULL,30);
sql_error insert into ct1 values('2022-05-03 16:59:00.015', Nu, 20, 'Null',NULL,30);
sql_error insert into ct1 values('2022-05-03 16:59:00.015', Nul, 20, 'Null',NULL,30);
print =============== step3-1 query records of ct1 from memory
sql select * from ct1;
print $data00 $data01 $data02 $data03 $data04 $data05
print $data10 $data11 $data12 $data13 $data14 $data15
print $data20 $data21 $data22 $data23 $data24 $data25
print $data30 $data31 $data32 $data33 $data34 $data35
print $data40 $data41 $data42 $data43 $data44 $data45
if $rows != 5 then
print rows $rows != 5
return -1
endi
if $data01 != 10 then
print data01 $data01 != 10
return -1
endi
if $data02 != 20.000000000 then
print data02 $data02 != 20.000000000
return -1
endi
if $data03 != n then
print data03 $data03 != n
return -1
endi
if $data04 != n then
print data04 $data04 != n
return -1
endi
if $data05 != 30.000000000 then
print data05 $data05 != 30.000000000
return -1
endi
if $data11 != NULL then
print data11 $data11 != NULL
return -1
endi
if $data12 != NULL then
print data12 $data12 != NULL
return -1
endi
if $data13 != N then
print data13 $data13 != N
return -1
endi
if $data14 != N then
print data14 $data14 != N
return -1
endi
if $data15 != 30.000000000 then
print data15 $data15 != 30.000000000
return -1
endi
if $data21 != NULL then
print data21 $data21 != NULL
return -1
endi
if $data22 != NULL then
print data22 $data22 != NULL
return -1
endi
if $data23 != Nul then
print data23 $data23 != Nul
return -1
endi
if $data24 != NUL then
print data24 $data24 != NUL
return -1
endi
if $data25 != 30.000000000 then
print data25 $data25 != 30.000000000
return -1
endi
if $data31 != NULL then
print data31 $data31 != NULL
return -1
endi
if $data32 != NULL then
print data32 $data32 != NULL
return -1
endi
if $data33 != Null then
print data33 $data33 != Null
return -1
endi
if $data34 != NULL then
print data34 $data34 != NULL
return -1
endi
if $data35 != 30.000000000 then
print data35 $data35 != 30.000000000
return -1
endi
if $data41 != NULL then
print data41 $data41 != NULL
return -1
endi
if $data42 != NULL then
print data42 $data42 != NULL
return -1
endi
if $data43 != Null then
print data43 $data43 != Null
return -1
endi
if $data44 != NULL then
print data44 $data44 != NULL
return -1
endi
if $data45 != 30.000000000 then
print data45 $data45 != 30.000000000
return -1
endi
#==================== reboot to trigger commit data to file
system sh/exec.sh -n dnode1 -s stop -x SIGINT
system sh/exec.sh -n dnode1 -s start
print =============== step3-2 query records of ct1 from file
sql select * from ct1;
print $data00 $data01 $data02 $data03 $data04 $data05
print $data10 $data11 $data12 $data13 $data14 $data15
print $data20 $data21 $data22 $data23 $data24 $data25
print $data30 $data31 $data32 $data33 $data34 $data35
print $data40 $data41 $data42 $data43 $data44 $data45
if $rows != 5 then
print rows $rows != 5
return -1
endi
if $data01 != 10 then
print data01 $data01 != 10
return -1
endi
if $data02 != 20.000000000 then
print data02 $data02 != 20.000000000
return -1
endi
if $data03 != n then
print data03 $data03 != n
return -1
endi
if $data04 != n then
print data04 $data04 != n
return -1
endi
if $data05 != 30.000000000 then
print data05 $data05 != 30.000000000
return -1
endi
if $data11 != NULL then
print data11 $data11 != NULL
return -1
endi
if $data12 != NULL then
print data12 $data12 != NULL
return -1
endi
if $data13 != N then
print data13 $data13 != N
return -1
endi
if $data14 != N then
print data14 $data14 != N
return -1
endi
if $data15 != 30.000000000 then
print data15 $data15 != 30.000000000
return -1
endi
if $data21 != NULL then
print data21 $data21 != NULL
return -1
endi
if $data22 != NULL then
print data22 $data22 != NULL
return -1
endi
if $data23 != Nul then
print data23 $data23 != Nul
return -1
endi
if $data24 != NUL then
print data24 $data24 != NUL
return -1
endi
if $data25 != 30.000000000 then
print data25 $data25 != 30.000000000
return -1
endi
if $data31 != NULL then
print data31 $data31 != NULL
return -1
endi
if $data32 != NULL then
print data32 $data32 != NULL
return -1
endi
if $data33 != Null then
print data33 $data33 != Null
return -1
endi
if $data34 != NULL then
print data34 $data34 != NULL
return -1
endi
if $data35 != 30.000000000 then
print data35 $data35 != 30.000000000
return -1
endi
if $data41 != NULL then
print data41 $data41 != NULL
return -1
endi
if $data42 != NULL then
print data42 $data42 != NULL
return -1
endi
if $data43 != Null then
print data43 $data43 != Null
return -1
endi
if $data44 != NULL then
print data44 $data44 != NULL
return -1
endi
if $data45 != 30.000000000 then
print data45 $data45 != 30.000000000
return -1
endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
......@@ -242,3 +242,5 @@ else
$reboot_cnt = $reboot_cnt + 1
goto reboot_and_check
endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
......@@ -226,4 +226,6 @@ endi
if $data41 != NULL then
print data41 $data41 != NULL
return -1
endi
\ No newline at end of file
endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
......@@ -816,4 +816,6 @@ endi
if $data44 != n8 then
print data44 $data44 != n8
return -1
endi
\ No newline at end of file
endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
......@@ -179,4 +179,6 @@ if $data05 != 30.000000000 then
return -1
endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册