Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
7bf7dcdf
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
7bf7dcdf
编写于
12月 07, 2021
作者:
S
shenglian zhou
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
modify scalar_expression.sim under general/parser
上级
0b81b578
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
131 addition
and
125 deletion
+131
-125
tests/script/general/parser/scalar_expression.sim
tests/script/general/parser/scalar_expression.sim
+131
-125
未找到文件。
tests/script/general/parser/scalar_expression.sim
浏览文件 @
7bf7dcdf
...
...
@@ -43,181 +43,187 @@ while $i < $tbNum
endw
print ================= step2
$stb = $mtPrefix . 0
$tb = $tbPrefix . 0
print execute sql select floor(3.0)+ceil(4.0) from $tb
sql select floor(3.0)+ceil(4.0) from $tb
if $rows != 50 then
return -1
endi
if $data00 != 7.000000000 then
return -1
endi
if $data10 != 7.000000000 then
return -1
endi
if $data20 != 7.000000000 then
return -1
print execute sql select floor(3.0)+ceil(4.0) from ct0
sql select floor(3.0)+ceil(4.0) from ct0
if $data00 != @7.000000000@ then
return -1
endi
if $data
30 != 7.000000000
then
return -1
if $data
10 != @7.000000000@
then
return -1
endi
if $data
40 != 7.000000000
then
return -1
if $data
20 != @7.000000000@
then
return -1
endi
if $data
50 != 7.000000000
then
return -1
if $data
30 != @7.000000000@
then
return -1
endi
if $data
60 != 7.000000000
then
return -1
if $data
40 != @7.000000000@
then
return -1
endi
if $data
70 != 7.000000000
then
return -1
if $data
50 != @7.000000000@
then
return -1
endi
if $data
80 != 7.000000000
then
return -1
if $data
60 != @7.000000000@
then
return -1
endi
if $data
90 != 7.000000000
then
return -1
if $data
70 != @7.000000000@
then
return -1
endi
print execute sql select sum(c1)+3.0+4.0 from $stb
sql select sum(c1)+3.0+4.0 from $stb
if $rows != 1 then
return -1
if $data80 != @7.000000000@ then
return -1
endi
if $data
00 != 2457.000000000
then
return -1
if $data
90 != @7.000000000@
then
return -1
endi
print execute sql select s
in(log(avg(c1),sum(c2))+3)%4 from $stb
sql select s
in(log(avg(c1),sum(c2))+3)%4 from $stb
if $
rows != 1
then
return -1
print execute sql select s
um(c1)+3.0+4.0 from st0
sql select s
um(c1)+3.0+4.0 from st0
if $
data00 != @2457.000000000@
then
return -1
endi
if $data00 != -0.265074286 then
return -1
print execute sql select sin(log(avg(c1),sum(c2))+3)%4 from st0
sql select sin(log(avg(c1),sum(c2))+3)%4 from st0
if $data00 != @-0.265074286@ then
return -1
endi
print execute sql select select log(pow(length(concat('3','4')),2),c2) from $stb
sql select log(pow(length(concat('3','4')),2),c2) from $stb
print [ $data00 , $data10 , $data20 , $data30 , $data40 , $data50 , $data60 , $data70 , $data80 , $data90 ]
if $data00 != -1.000000000 then
return -1
print execute sql select log(pow(length(concat('3','4')),2),c2) from st0
sql select log(pow(length(concat('3','4')),2),c2) from st0
if $data00 != @-1.000000000@ then
return -1
endi
if $data10 != @inf@ then
return -1
return -1
endi
if $data20 !=
2.000000000
then
return -1
if $data20 !=
@2.000000000@
then
return -1
endi
if $data30 !=
1.261859507
then
return -1
if $data30 !=
@1.261859507@
then
return -1
endi
if $data40 !=
1.000000000
then
return -1
if $data40 !=
@1.000000000@
then
return -1
endi
if $data50 !=
0.861353116
then
return -1
if $data50 !=
@0.861353116@
then
return -1
endi
if $data60 !=
0.773705614
then
return -1
if $data60 !=
@0.773705614@
then
return -1
endi
if $data70 !=
0.712414374
then
return -1
if $data70 !=
@0.712414374@
then
return -1
endi
if $data80 !=
0.666666667
then
return -1
if $data80 !=
@0.666666667@
then
return -1
endi
if $data90 !=
0.630929754
then
return -1
if $data90 !=
@0.630929754@
then
return -1
endi
print execute sql select round(log(pow(length(concat('3','4')),2),c2)+floor(c3))+2 from $stb
sql select round(log(pow(length(concat('3','4')),2),c2)+floor(c3))+2 from $stb
print [ $data00 , $data10 , $data20 , $data30 , $data40 , $data50 , $data60 , $data70 , $data80 , $data90 ]
if $data00 != 1.000000000 then
return -1
print execute sql select round(log(pow(length(concat('3','4')),2),c2)+floor(c3))+2 from st0
sql select round(log(pow(length(concat('3','4')),2),c2)+floor(c3))+2 from st0
if $data00 != @1.000000000@ then
return -1
endi
if $data10 != @inf@ then
return -1
return -1
endi
if $data20 !=
4.000000000
then
return -1
if $data20 !=
@6.000000000@
then
return -1
endi
if $data30 !=
3.000000000
then
return -1
if $data30 !=
@6.000000000@
then
return -1
endi
if $data40 !=
3.000000000
then
return -1
if $data40 !=
@7.000000000@
then
return -1
endi
if $data50 !=
3.000000000
then
return -1
if $data50 !=
@8.000000000@
then
return -1
endi
if $data60 !=
3.000000000
then
return -1
if $data60 !=
@9.000000000@
then
return -1
endi
if $data70 !=
3.000000000
then
return -1
if $data70 !=
@10.000000000@
then
return -1
endi
if $data80 !=
3.000000000
then
return -1
if $data80 !=
@11.000000000@
then
return -1
endi
if $data90 !=
3.000000000
then
return -1
if $data90 !=
@12.000000000@
then
return -1
endi
$tb0 = $tbPrefix . 0
$tb1 = $tbPrefix . 1
print execute sql select sin(pow(c1,log(c2,2))+pow(c2,2)) as val from $tb0 union all select pow(c4,2)+tan(sin(c5)/cos(c6)) as val from $tb1
sql select sin(pow(c1,log(c2,2))+pow(c2,2)) as val from $tb0 union all select pow(c4,2)+tan(sin(c5)/cos(c6)) as val from $tb1
print [ $data00 , $data10 , $data20 , $data30 , $data40 , $data50 , $data60 , $data70 , $data80 , $data90 ]
print execute sql select sin(pow(c1,log(c2,2))+pow(c2,2)) as val from ct0 union all select pow(c4,2)+tan(sin(c5)/cos(c6)) as val from ct1
sql select sin(pow(c1,log(c2,2))+pow(c2,2)) as val from ct0 union all select pow(c4,2)+tan(sin(c5)/cos(c6)) as val from ct1
if $data00 != @-nan@ then
return -1
return -1
endi
if $data10 !=
0.909297427
then
return -1
if $data10 !=
@0.909297427@
then
return -1
endi
if $data20 !=
-0.279415498
then
return -1
if $data20 !=
@-0.279415498@
then
return -1
endi
if $data30 !=
0.843325058
then
return -1
if $data30 !=
@0.843325058@
then
return -1
endi
if $data40 !=
0.551426681
then
return -1
if $data40 !=
@0.551426681@
then
return -1
endi
if $data50 !=
-0.840606612
then
return -1
if $data50 !=
@-0.840606612@
then
return -1
endi
if $data60 !=
0.436161076
then
return -1
if $data60 !=
@0.436161076@
then
return -1
endi
if $data70 !=
0.897498185
then
return -1
if $data70 !=
@0.897498185@
then
return -1
endi
if $data80 !=
-0.885952778
then
return -1
if $data80 !=
@-0.885952778@
then
return -1
endi
if $data90 !=
0.429470715
then
return -1
if $data90 !=
@0.429470715@
then
return -1
endi
print execute sql select asin(c1) from
$stb
limit 1
sql select asin(c1) from
$stb
limit 1
if $data00 !=
0.000000000
then
return -1
print execute sql select asin(c1) from
st0
limit 1
sql select asin(c1) from
st0
limit 1
if $data00 !=
@0.000000000@
then
return -1
endi
print execute sql select pow(c1,2) from
$stb
limit 1 offset 2;
sql select pow(c1,2) from
$stb
limit 1 offset 2;
if $data00 !=
4.000000000
then
return -1
print execute sql select pow(c1,2) from
st0
limit 1 offset 2;
sql select pow(c1,2) from
st0
limit 1 offset 2;
if $data00 !=
@4.000000000@
then
return -1
endi
print exe
ucte sql select cos(c1) from db0.ct0, db0.ct1 where ct0.ts==ct1.ts;
print exe
cute sql select cos(c1) from db0.ct0, db0.ct1 where ct0.ts==ct1.ts
sql select cos(c1) from db0.ct0, db0.ct1 where ct0.ts==ct1.ts
if $
rows != 50
then
return -1
if $
data00 != @1.000000000@
then
return -1
endi
if $data10 != 0.540302306 then
return -1
if $data10 != @0.540302306@ then
return -1
endi
if $data20 != @-0.416146837@ then
return -1
endi
if $data30 != @-0.989992497@ then
return -1
endi
if $data40 != @-0.653643621@ then
return -1
endi
if $data50 != @0.283662185@ then
return -1
endi
if $data60 != @0.960170287@ then
return -1
endi
if $data70 != @0.753902254@ then
return -1
endi
if $data80 != @-0.145500034@ then
return -1
endi
if $data90 != @-0.911130262@ then
return -1
endi
print ============== invalid expressions
sql_error select agg(c1)+c2 from $stb
sql_error select agg(c1+2) from $stb
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录