test: restore 2.0 case

This commit is contained in:
Shengliang Guan 2022-07-21 10:38:33 +08:00
parent d9f7c34a79
commit f78555c73b
1 changed files with 29 additions and 61 deletions

View File

@ -4,23 +4,17 @@ system sh/exec.sh -n dnode1 -s start
sql connect sql connect
print ======================== dnode1 start print ======================== dnode1 start
$db = testdb $db = testdb
sql create database $db sql create database $db
sql use $db sql use $db
sql create stable st2 (ts timestamp, f1 int) tags (id int, t1 int, t2 nchar(4), t3 double) sql create stable st2 (ts timestamp, f1 int) tags (id int, t1 int, t2 nchar(4), t3 double)
sql insert into tb1 using st2 (id, t1) tags(1,2) values (now, 1) sql insert into tb1 using st2 (id, t1) tags(1,2) values (now, 1)
sql select id,t1,t2,t3 from tb1 sql select id,t1,t2,t3 from tb1
if $rows != 1 then if $rows != 1 then
return -1 return -1
endi endi
if $data00 != 1 then if $data00 != 1 then
return -1 return -1
endi endi
@ -35,124 +29,98 @@ if $data03 != NULL then
endi endi
sql create table tb2 using st2 (t2,t3) tags ("12",22.0) sql create table tb2 using st2 (t2,t3) tags ("12",22.0)
sql show tags from tb2
sql select id,t1,t2,t3 from tb2; if $rows != 4 then
if $rows != 1 then
return -1 return -1
endi endi
if $data05 != NULL then
if $data00 != NULL then
return -1 return -1
endi endi
if $data01 != NULL then if $data15 != NULL then
return -1 return -1
endi endi
if $data02 != 12 then if $data25 != 12 then
return -1 return -1
endi endi
if $data03 != 22.000000000 then if $data35 != 22.000000000 then
return -1 return -1
endi endi
sql create table tb3 using st2 tags (1,2,"3",33.0); sql create table tb3 using st2 tags (1,2,"3",33.0);
sql show tags from tb3;
sql select id,t1,t2,t3 from tb3; if $rows != 4 then
if $rows != 1 then
return -1 return -1
endi endi
if $data05 != 1 then
if $data00 != 1 then
return -1 return -1
endi endi
if $data01 != 2 then if $data15 != 2 then
return -1 return -1
endi endi
if $data02 != 3 then if $data25 != 3 then
return -1 return -1
endi endi
if $data03 != 33.000000000 then if $data35 != 33.000000000 then
return -1 return -1
endi endi
sql insert into tb4 using st2 tags(1,2,"33",44.0) values (now, 1); sql insert into tb4 using st2 tags(1,2,"33",44.0) values (now, 1);
sql show tags from tb4;
sql select id,t1,t2,t3 from tb4; if $rows != 4 then
if $rows != 1 then
return -1 return -1
endi endi
if $data05 != 1 then
if $data00 != 1 then
return -1 return -1
endi endi
if $data01 != 2 then if $data15 != 2 then
return -1 return -1
endi endi
if $data02 != 33 then if $data25 != 33 then
return -1
endi
if $data03 != 44.000000000 then
return -1 return -1
endi endi
sql_error create table tb5 using st2() tags (3,3,"3",33.0); sql_error create table tb5 using st2() tags (3,3,"3",33.0);
sql_error create table tb6 using st2 (id,t1) tags (3,3,"3",33.0); sql_error create table tb6 using st2 (id,t1) tags (3,3,"3",33.0);
sql_error create table tb7 using st2 (id,t1) tags (3); sql_error create table tb7 using st2 (id,t1) tags (3);
sql_error create table tb8 using st2 (ide) tags (3); sql_error create table tb8 using st2 (ide) tags (3);
sql_error create table tb9 using st2 (id); sql_error create table tb9 using st2 (id);
sql_error create table tb10 using st2 (id t1) tags (1,1); sql_error create table tb10 using st2 (id t1) tags (1,1);
sql_error create table tb10 using st2 (id,,t1) tags (1,1,1); sql_error create table tb10 using st2 (id,,t1) tags (1,1,1);
sql_error create table tb11 using st2 (id,t1,) tags (1,1,1); sql_error create table tb11 using st2 (id,t1,) tags (1,1,1);
sql create table tb12 using st2 (t1,id) tags (2,1); sql create table tb12 using st2 (t1,id) tags (2,1);
sql show tags from tb12;
sql select id,t1,t2,t3 from tb12; if $rows != 5 then
if $rows != 1 then
return -1 return -1
endi endi
if $data05 != 1 then
if $data00 != 1 then
return -1 return -1
endi endi
if $data01 != 2 then if $data15 != 2 then
return -1 return -1
endi endi
if $data02 != NULL then if $data25 != NULL then
return -1 return -1
endi endi
if $data03 != NULL then if $data35 != NULL then
return -1 return -1
endi endi
sql create table tb13 using st2 ("t1",'id') tags (2,1); sql create table tb13 using st2 ("t1",'id') tags (2,1);
sql show tags from tb13;
sql select id,t1,t2,t3 from tb13; if $rows != 2 then
if $rows != 1 then
return -1 return -1
endi endi
if $data05 != 1 then
if $data00 != 1 then
return -1 return -1
endi endi
if $data01 != 2 then if $data15 != 2 then
return -1 return -1
endi endi
if $data02 != NULL then if $data25 != NULL then
return -1 return -1
endi endi
if $data03 != NULL then if $data35 != NULL then
return -1 return -1
endi endi