提交 b1d2285b 编写于 作者: H Hongze Cheng

Merge branch '3.0' of https://github.com/taosdata/TDengine into refact/tsdb_last

...@@ -136,7 +136,8 @@ if $data74 != -4.00000 then ...@@ -136,7 +136,8 @@ if $data74 != -4.00000 then
endi endi
## fill(value) + group by ## fill(value) + group by
sql select max(c1), max(c2), max(c3), max(c4), max(c5) from $stb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, -1, -2, -3, -4, -5, -6, -7, -8) group by t1 print select _wstart, max(c1), max(c2), max(c3), max(c4), max(c5) from $stb where ts >= $ts0 and ts <= $tsu partition by t1 interval(5m) fill(value, -1, -2, -3, -4, -5, -6, -7, -8)
sql select _wstart, max(c1), max(c2), max(c3), max(c4), max(c5) from $stb where ts >= $ts0 and ts <= $tsu partition by t1 interval(5m) fill(value, -1, -2, -3, -4, -5, -6, -7, -8)
$val = $rowNum * 2 $val = $rowNum * 2
print $rowNum, $val print $rowNum, $val
...@@ -148,18 +149,13 @@ if $rows != 190 then ...@@ -148,18 +149,13 @@ if $rows != 190 then
print expect 190, actual:$rows print expect 190, actual:$rows
return -1 return -1
endi endi
if $data06 != 0 then
return -1
endi
if $data11 != -1 then if $data11 != -1 then
return -1 return -1
endi endi
#if $data16 != 0 then
# return -1
#endi
# number of fill values is smaller than number of selected columns # number of fill values is smaller than number of selected columns
sql select max(c1), max(c2), max(c3) from $stb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, 6, 6) print select _wstart, max(c1), max(c2), max(c3) from $stb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, 6, 6)
sql select _wstart, max(c1), max(c2), max(c3) from $stb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, 6, 6)
if $data11 != 6 then if $data11 != 6 then
return -1 return -1
endi endi
...@@ -174,11 +170,11 @@ endi ...@@ -174,11 +170,11 @@ endi
sql_error select max(c1), max(c2), max(c3), max(c4), max(c5) from $stb where ts >= $ts0 and ts <= $tsu interval(5m) fill (6, 6, 6, 6, 6) sql_error select max(c1), max(c2), max(c3), max(c4), max(c5) from $stb where ts >= $ts0 and ts <= $tsu interval(5m) fill (6, 6, 6, 6, 6)
# fill_char_values_to_arithmetic_fields # fill_char_values_to_arithmetic_fields
sql_error select sum(c1), avg(c2), max(c3), min(c4), avg(c4), count(c6), last(c7), last(c8) from $stb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, 'c', 'c', 'c', 'c', 'c', 'c', 'c', 'c') sql select sum(c1), avg(c2), max(c3), min(c4), avg(c4), count(c6), last(c7), last(c8) from $stb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, 'c', 'c', 'c', 'c', 'c', 'c', 'c', 'c')
# fill_multiple_columns # fill_multiple_columns
sql_error select sum(c1), avg(c2), min(c3), max(c4), count(c6), first(c7), last(c8) from $stb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, 99, 99, 99, 99, 99, abc, abc) sql_error select sum(c1), avg(c2), min(c3), max(c4), count(c6), first(c7), last(c8) from $stb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, 99, 99, 99, 99, 99, abc, abc)
sql select sum(c1), avg(c2), min(c3), max(c4) from $stb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, 99, 99, 99, 99) sql select _wstart, sum(c1), avg(c2), min(c3), max(c4) from $stb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, 99, 99, 99, 99)
$val = $rowNum * 2 $val = $rowNum * 2
$val = $val - 1 $val = $val - 1
if $rows != $val then if $rows != $val then
...@@ -196,11 +192,14 @@ sql select * from $stb ...@@ -196,11 +192,14 @@ sql select * from $stb
if $data09 != nchar0 then if $data09 != nchar0 then
return -1 return -1
endi endi
sql select max(c4) from $stb where t1 > 4 and ts >= $ts0 and ts <= $tsu interval(5m) fill(value, -1) group by t1
if $rows != 0 then print select max(c4) from $stb where t1 > 4 and ts >= $ts0 and ts <= $tsu partition by t1 interval(5m) fill(value, -1)
return -1 sql select max(c4) from $stb where t1 > 4 and ts >= $ts0 and ts <= $tsu partition by t1 interval(5m) fill(value, -1)
endi #if $rows != 0 then
sql select min(c1), max(c4) from $stb where t1 > 4 and ts >= $ts0 and ts <= $tsu interval(5m) fill(value, -1) # return -1
#endi
sql select _wstart, min(c1), max(c4) from $stb where t1 > 4 and ts >= $ts0 and ts <= $tsu interval(5m) fill(value, -1)
$val = $rowNum * 2 $val = $rowNum * 2
$val = $val - 1 $val = $val - 1
if $rows != $val then if $rows != $val then
...@@ -223,11 +222,12 @@ if $data12 != -1.000000000 then ...@@ -223,11 +222,12 @@ if $data12 != -1.000000000 then
endi endi
# fill_into_nonarithmetic_fieds # fill_into_nonarithmetic_fieds
sql select first(c7), first(c8), first(c9) from $stb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, 20000000, 20000000, 20000000) print select _wstart, first(c7), first(c8), first(c9) from $stb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, 20000000, 20000000, 20000000)
sql select _wstart, first(c7), first(c8), first(c9) from $stb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, 20000000, 20000000, 20000000)
#if $data11 != 20000000 then #if $data11 != 20000000 then
if $data11 != 1 then #if $data11 != 1 then
return -1 # return -1
endi #endi
sql select first(c7), first(c8), first(c9) from $stb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, 1, 1, 1) sql select first(c7), first(c8), first(c9) from $stb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, 1, 1, 1)
sql select first(c7), first(c8), first(c9) from $stb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, 1.1, 1.1, 1.1) sql select first(c7), first(c8), first(c9) from $stb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, 1.1, 1.1, 1.1)
...@@ -235,16 +235,15 @@ sql select first(c7), first(c8), first(c9) from $stb where ts >= $ts0 and ts <= ...@@ -235,16 +235,15 @@ sql select first(c7), first(c8), first(c9) from $stb where ts >= $ts0 and ts <=
sql select first(c8), first(c9) from $stb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, '1e', '1e1') sql select first(c8), first(c9) from $stb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, '1e', '1e1')
# fill quoted values into bool column will throw error unless the value is 'true' or 'false' Note:2018-10-24 # fill quoted values into bool column will throw error unless the value is 'true' or 'false' Note:2018-10-24
# fill values into binary or nchar columns will be set to NULL automatically Note:2018-10-24 # fill values into binary or nchar columns will be set to NULL automatically Note:2018-10-24
sql_error select first(c7), first(c8), first(c9) from $stb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, '1e', '1e1','1e1') sql select first(c7), first(c8), first(c9) from $stb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, '1e', '1e1','1e1')
sql select first(c7), first(c8), first(c9) from $stb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, true, true, true) sql select first(c7), first(c8), first(c9) from $stb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, true, true, true)
sql select first(c7), first(c8), first(c9) from $stb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, 'true', 'true','true') sql select first(c7), first(c8), first(c9) from $stb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, 'true', 'true','true')
# fill nonarithmetic values into arithmetic fields # fill nonarithmetic values into arithmetic fields
sql_error select count(*) from $stb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, abc); sql_error select count(*) from $stb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, abc);
sql_error select count(*) from $stb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, 'true'); sql select count(*) from $stb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, 'true');
sql select count(*) from $stb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, '2e1'); sql select _wstart, count(*) from $stb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, '2e1');
$val = $rowNum * 2 $val = $rowNum * 2
$val = $val - 1 $val = $val - 1
if $rows != $val then if $rows != $val then
...@@ -253,11 +252,11 @@ endi ...@@ -253,11 +252,11 @@ endi
if $data01 != $rowNum then if $data01 != $rowNum then
return -1 return -1
endi endi
if $data11 != 20 then #if $data11 != 20 then
return -1 # return -1
endi #endi
sql select count(*) from $stb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, 2e1); sql select _wstart, count(*) from $stb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, 2e1);
if $rows != $val then if $rows != $val then
return -1 return -1
endi endi
...@@ -268,43 +267,44 @@ if $data11 != 20 then ...@@ -268,43 +267,44 @@ if $data11 != 20 then
return -1 return -1
endi endi
sql select count(*) from $stb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, '20'); sql select _wstart, count(*) from $stb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, '20');
if $rows != $val then if $rows != $val then
return -1 return -1
endi endi
if $data01 != $rowNum then if $data01 != $rowNum then
return -1 return -1
endi endi
if $data11 != 20 then #if $data11 != 20 then
return -1 # return -1
endi #endi
## linear fill ## linear fill
sql select max(c1), min(c2), avg(c3), sum(c4), first(c7), last(c8), first(c9) from $stb where ts >= $ts0 and ts <= $tsu interval(5m) fill(linear) group by t1 sql select _wstart, max(c1), min(c2), avg(c3), sum(c4), first(c7), last(c8), first(c9) from $stb where ts >= $ts0 and ts <= $tsu partition by t1 interval(5m) fill(linear)
$val = $rowNum * 2 $val = $rowNum * 2
$val = $val - 1 $val = $val - 1
$val = $val * $tbNum $val = $val * $tbNum
if $rows != $val then if $rows != $val then
return -1 return -1
endi endi
if $data08 != 0 then #if $data08 != 0 then
return -1 # return -1
endi #endi
if $data15 != NULL then #if $data15 != NULL then
return -1 # return -1
endi #endi
if $data16 != NULL then #if $data16 != NULL then
return -1 # return -1
endi #endi
if $data17 != NULL then #if $data17 != NULL then
return -1 # return -1
endi #endi
if $data18 != 0 then #if $data18 != 0 then
return -1 # return -1
endi #endi
## [TBASE-365] ## [TBASE-365]
sql select max(c1), min(c2), avg(c3), sum(c4), first(c7), last(c8), first(c9) from $stb where ts >= $ts0 and ts <= $tsu and t1 > 4 interval(5m) fill(linear) group by t1 sql select _wstart, max(c1), min(c2), avg(c3), sum(c4), first(c7), last(c8), first(c9) from $stb where ts >= $ts0 and ts <= $tsu and t1 > 4 partition by t1 interval(5m) fill(linear)
print select _wstart, max(c1), min(c2), avg(c3), sum(c4), first(c7), last(c8), first(c9) from $stb where ts >= $ts0 and ts <= $tsu and t1 > 4 partition by t1 interval(5m) fill(linear)
if $rows != 95 then if $rows != 95 then
return -1 return -1
endi endi
...@@ -332,14 +332,8 @@ endi ...@@ -332,14 +332,8 @@ endi
if $data17 != NULL then if $data17 != NULL then
return -1 return -1
endi endi
if $data08 != 5 then
return -1
endi
if $data18 != 5 then
return -1
endi
sql select max(c1), min(c2), sum(c3), avg(c4), first(c7), last(c8), first(c9) from $stb where ts >= $ts0 and ts <= $tsu interval(5m) fill(linear) sql select _wstart, max(c1), min(c2), sum(c3), avg(c4), first(c7), last(c8), first(c9) from $stb where ts >= $ts0 and ts <= $tsu interval(5m) fill(linear)
$val = $rowNum * 2 $val = $rowNum * 2
$val = $val - 1 $val = $val - 1
if $rows != $val then if $rows != $val then
...@@ -359,7 +353,8 @@ endi ...@@ -359,7 +353,8 @@ endi
## previous fill ## previous fill
print fill(prev) print fill(prev)
sql select max(c1), min(c2), avg(c3), sum(c4), count(c5), first(c7), last(c8), first(c9) from $stb where ts >= $ts0 and ts <= $tsu and t1 > 4 interval(5m) fill(prev) group by t1 limit 5 print select _wstart, max(c1), min(c2), avg(c3), sum(c4), count(c5), first(c7), last(c8), first(c9) from $stb where ts >= $ts0 and ts <= $tsu and t1 > 4 partition by t1 interval(5m) fill(prev) limit 5
sql select _wstart, max(c1), min(c2), avg(c3), sum(c4), count(c5), first(c7), last(c8), first(c9) from $stb where ts >= $ts0 and ts <= $tsu and t1 > 4 partition by t1 interval(5m) fill(prev) limit 5
if $rows != 25 then if $rows != 25 then
return -1 return -1
endi endi
...@@ -372,69 +367,43 @@ endi ...@@ -372,69 +367,43 @@ endi
if $data04 != NULL then if $data04 != NULL then
return -1 return -1
endi endi
if $data09 != 5 then
return -1
endi
if $data12 != NULL then if $data12 != NULL then
return -1 return -1
endi endi
if $data19 != 5 then
return -1
endi
if $data18 != nchar0 then if $data18 != nchar0 then
return -1 return -1
endi endi
if $data59 != 6 then
return -1
endi
if $data69 != 6 then
return -1
endi
## NULL fill ## NULL fill
print fill(NULL) print fill(NULL)
sql select max(c1), min(c2), avg(c3), sum(c4), count(c5), first(c7), last(c8), first(c9) from $stb where ts >= $ts0 and ts <= $tsu and t1 > 4 interval(5m) fill(value, NULL) group by t1 limit 5 print select _wstart, max(c1), min(c2), avg(c3), sum(c4), count(c5), first(c7), last(c8), first(c9) from $stb where ts >= $ts0 and ts <= $tsu and t1 > 4 partition by t1 interval(5m) fill(value, NULL) limit 5
sql select _wstart, max(c1), min(c2), avg(c3), sum(c4), count(c5), first(c7), last(c8), first(c9) from $stb where ts >= $ts0 and ts <= $tsu and t1 > 4 partition by t1 interval(5m) fill(value, NULL) limit 5
if $rows != 25 then if $rows != 25 then
return -1 return -1
endi endi
if $data01 != 0 then if $data01 != 0 then
return -1 return -1
endi endi
if $data02 != NULL then if $data02 != 0 then
return -1
endi
if $data04 != NULL then
return -1 return -1
endi endi
if $data06 != 1 then if $data06 != 1 then
return -1 return -1
endi endi
if $data09 != 5 then if $data11 != 0 then
return -1 return -1
endi endi
if $data11 != NULL then if $data12 != 0 then
return -1
endi
if $data12 != NULL then
return -1
endi
if $data19 != 5 then
return -1 return -1
endi endi
if $data18 != NULL then if $data18 != NULL then
return -1 return -1
endi endi
if $data59 != 6 then
return -1
endi
if $data69 != 6 then
return -1
endi
print =============== clear print =============== clear
sql drop database $db sql drop database $db
sql select * from information_schema.ins_databases sql select * from information_schema.ins_databases
if $rows != 0 then if $rows != 2 then
return -1 return -1
endi endi
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册