提交 f59dc801 编写于 作者: W wpan

add test cases

上级 8d256e88
......@@ -2643,10 +2643,12 @@ int32_t filterRmUnitByRange(SFilterInfo *info, SDataStatis *pDataStatis, int32_t
SDataStatis* pDataBlockst = &pDataStatis[index];
void *minVal, *maxVal;
float minv = 0;
float maxv = 0;
if (cunit->dataType == TSDB_DATA_TYPE_FLOAT) {
float minv = (float)(*(double *)(&pDataBlockst->min));
float maxv = (float)(*(double *)(&pDataBlockst->max));
minv = (float)(*(double *)(&pDataBlockst->min));
maxv = (float)(*(double *)(&pDataBlockst->max));
minVal = &minv;
maxVal = &maxv;
......@@ -3263,10 +3265,12 @@ bool filterRangeExecute(SFilterInfo *info, SDataStatis *pDataStatis, int32_t num
SDataStatis* pDataBlockst = &pDataStatis[index];
SFilterRangeNode *r = ctx->rs;
float minv = 0;
float maxv = 0;
if (ctx->type == TSDB_DATA_TYPE_FLOAT) {
float minv = (float)(*(double *)(&pDataBlockst->min));
float maxv = (float)(*(double *)(&pDataBlockst->max));
minv = (float)(*(double *)(&pDataBlockst->min));
maxv = (float)(*(double *)(&pDataBlockst->max));
minVal = &minv;
maxVal = &maxv;
......
......@@ -204,8 +204,6 @@ sleep 100
run general/parser/condition_query.sim
run general/parser/condition_query2.sim
sql drop database if exists cdb
......
......@@ -32,6 +32,15 @@ sql_error select * from stb1 where c4 != 'null';
sql_error select * from stb1 where c5 >= 'null';
sql_error select * from stb1 where c6 <= 'null';
sql_error select * from stb1 where c7 < 'nuLl';
sql_error select * from stb1 where c1 match '.*';
sql_error select * from stb1 where c2 match '.*';
sql_error select * from stb1 where c3 match '.*';
sql_error select * from stb1 where c4 match '.*';
sql_error select * from stb1 where c5 match '.*';
sql_error select * from stb1 where c6 match '.*';
sql_error select * from stb1 where c7 match '.*';
sql_error select * from stb1 where c9 match '.*';
sql_error select * from stb1 where ts match '.*';
sql_error select * from (select * from stb1 where c7=true) a, (select * from stb1 where c1 > 30) b;
sql_error select a.ts,a.c1,a.c8 from (select * from stb1 where c7=true) a, (select * from stb1 where c1 > 30) b where a.ts=b.ts and a.c1 > 50 or b.c1 < 60;
......@@ -2232,3 +2241,77 @@ endi
if $data50 != @21-05-05 18:19:28.000@ then
return -1
endi
sql select * from stb1 where c8 match '^1.*';
if $rows != 5 then
return -1
endi
if $data00 != @21-05-05 18:19:00.000@ then
return -1
endi
if $data10 != @21-05-05 18:19:04.000@ then
return -1
endi
if $data20 != @21-05-05 18:19:05.000@ then
return -1
endi
if $data30 != @21-05-05 18:19:06.000@ then
return -1
endi
if $data40 != @21-05-05 18:19:07.000@ then
return -1
endi
sql select * from stb1 where c8 match '1.*';
if $rows != 10 then
return -1
endi
if $data00 != @21-05-05 18:19:00.000@ then
return -1
endi
if $data10 != @21-05-05 18:19:04.000@ then
return -1
endi
if $data20 != @21-05-05 18:19:05.000@ then
return -1
endi
if $data30 != @21-05-05 18:19:06.000@ then
return -1
endi
if $data40 != @21-05-05 18:19:07.000@ then
return -1
endi
if $data50 != @21-05-05 18:19:08.000@ then
return -1
endi
if $data60 != @21-05-05 18:19:12.000@ then
return -1
endi
if $data70 != @21-05-05 18:19:16.000@ then
return -1
endi
if $data80 != @21-05-05 18:19:20.000@ then
return -1
endi
if $data90 != @21-05-05 18:19:24.000@ then
return -1
endi
sql select * from stb1 where c8 match '1.+';
if $rows != 4 then
return -1
endi
if $data00 != @21-05-05 18:19:04.000@ then
return -1
endi
if $data10 != @21-05-05 18:19:05.000@ then
return -1
endi
if $data20 != @21-05-05 18:19:06.000@ then
return -1
endi
if $data30 != @21-05-05 18:19:07.000@ then
return -1
endi
......@@ -589,8 +589,50 @@ if $data70 != @21-05-05 18:19:15.000@ then
return -1
endi
print "tag test"
sql select ts,c1,t9,t10,tbname from stb5 where tbname match '^3';
if $rows != 0 then
return -1
endi
sql select ts,c1,t9,t10,tbname from stb5 where tbname match 'tb.?_[34]';
if $rows != 8 then
return -1
endi
if $data00 != @21-05-05 18:19:12.000@ then
return -1
endi
if $data10 != @21-05-05 18:19:13.000@ then
return -1
endi
if $data20 != @21-05-05 18:19:14.000@ then
return -1
endi
if $data30 != @21-05-05 18:19:15.000@ then
return -1
endi
if $data40 != @21-05-05 18:19:16.000@ then
return -1
endi
if $data50 != @21-05-05 18:19:17.000@ then
return -1
endi
if $data60 != @21-05-05 18:19:18.000@ then
return -1
endi
if $data70 != @21-05-05 18:19:19.000@ then
return -1
endi
print "tag test"
sql_error select * from stb5 where t1 match '.*';
sql_error select * from stb5 where t2 match '.*';
sql_error select * from stb5 where t3 match '.*';
sql_error select * from stb5 where t4 match '.*';
sql_error select * from stb5 where t5 match '.*';
sql_error select * from stb5 where t6 match '.*';
sql_error select * from stb5 where t7 match '.*';
sql_error select * from stb5 where t8 match '.*';
sql_error select * from stb5 where t10 match '.*';
sql_error select * from tb1 where t1 in (1,2) and t1 in (2,3);
sql select * from stb1 where t1 in (1,2) and t1 in (2,3);
......@@ -1179,6 +1221,61 @@ if $rows != 22 then
return -1
endi
sql select ts,c1,t9,t10 from stb5 where t9 match '1.+';
if $rows != 8 then
return -1
endi
if $data00 != @21-05-05 18:19:00.000@ then
return -1
endi
if $data10 != @21-05-05 18:19:01.000@ then
return -1
endi
if $data20 != @21-05-05 18:19:02.000@ then
return -1
endi
if $data30 != @21-05-05 18:19:03.000@ then
return -1
endi
if $data40 != @21-05-05 18:19:04.000@ then
return -1
endi
if $data50 != @21-05-05 18:19:05.000@ then
return -1
endi
if $data60 != @21-05-05 18:19:06.000@ then
return -1
endi
if $data70 != @21-05-05 18:19:07.000@ then
return -1
endi
sql select ts,c1,t9,t10 from stb5 where t9 match '[3-9]';
if $rows != 22 then
return -1
endi
sql select ts,c1,t9,t10 from stb5 where t9 match '8.*';
if $rows != 5 then
return -1
endi
if $data00 != @21-05-05 18:19:34.000@ then
return -1
endi
if $data10 != @21-05-05 18:19:35.000@ then
return -1
endi
if $data20 != @21-05-05 18:19:36.000@ then
return -1
endi
if $data30 != @21-05-05 18:19:37.000@ then
return -1
endi
if $data40 != @21-05-05 18:19:38.000@ then
return -1
endi
print "join test"
sql_error select * from tb1, tb2_1 where tb1.ts=tb2_1.ts or tb1.ts =tb2_1.ts;
......
......@@ -42,6 +42,9 @@ if $rows != 4 then
return -1
endi
sql select tbname,t1 from stba where t1 is null;
sql select tbname,t1 from stba where t1 is not null;
sql_error select tbname,t1 from stbb where t1 > true;
sql select tbname,t1 from stbb where t1 = true;
if $rows != 5 then
......@@ -53,6 +56,10 @@ if $rows != 5 then
return -1
endi
sql select tbname,t1 from stbb where t1 is null;
sql select tbname,t1 from stbb where t1 is not null;
sql select tbname,t1 from stbc;
if $rows != 10 then
return -1
......@@ -93,6 +100,9 @@ if $rows != 4 then
return -1
endi
sql select tbname,t1 from stbc where t1 is null;
sql select tbname,t1 from stbc where t1 is not null;
sql select tbname,t1 from stbd where t1 > '2222';
if $rows != 7 then
return -1
......@@ -128,6 +138,9 @@ if $rows != 4 then
return -1
endi
sql select tbname,t1 from stbd where t1 is null;
sql select tbname,t1 from stbd where t1 is not null;
sql select tbname,t1 from stbe where t1 > '2222';
if $rows != 7 then
return -1
......@@ -163,4 +176,7 @@ if $rows != 4 then
return -1
endi
sql select tbname,t1 from stbe where t1 is null;
sql select tbname,t1 from stbe where t1 is not null;
#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.
先完成此消息的编辑!
想要评论请 注册