Merge pull request #12453 from taosdata/feature/udf

feat: add test case to udf.sim
This commit is contained in:
shenglian-zhou 2022-05-13 23:11:35 +08:00 committed by GitHub
commit 6630507503
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 25 additions and 0 deletions

View File

@ -94,6 +94,31 @@ endi
if $data00 != 2.645751311 then
return -1
endi
sql insert into t2 values(now+4s, 4, 8)(now+5s, 5, 9);
sql select udf2(f1-f2), udf2(f1+f2) from t2;
print $rows , $data00 , $data01
if $rows != 1 then
return -1;
endi
if $data00 != 5.656854249 then
return -1
endi
if $data01 != 18.547236991 then
return -1
endi
sql select udf2(udf1(f2-f1)), udf2(udf1(f2/f1)) from t2;
if $rows != 1 then
return -1
endi
if $data00 != 176.000000000 then
return -1
endi
if $data01 != 152.420471066 then
return -1
endi
print $rows , $data00 , $data01
sql drop function udf1;
sql show functions;
if $rows != 1 then