Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
4e1334b0
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看板
提交
4e1334b0
编写于
1月 14, 2022
作者:
G
Ganlin Zhao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[TD-12945]<fix>(query): taos shell crash when constant comparison cause crash
上级
8593f094
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
219 addition
and
2 deletion
+219
-2
tests/develop-test/2-query/constant_compare.py
tests/develop-test/2-query/constant_compare.py
+219
-2
未找到文件。
tests/develop-test/2-query/constant_compare.py
浏览文件 @
4e1334b0
...
...
@@ -111,6 +111,31 @@ class TDTestCase:
tdSql
.
checkRows
(
1
)
tdSql
.
checkData
(
0
,
0
,
0
)
tdSql
.
query
(
'select 1.0 = true from tb;'
)
tdSql
.
checkRows
(
1
)
tdSql
.
checkData
(
0
,
0
,
1
)
tdSql
.
query
(
'select 0.0 = false from tb;'
)
tdSql
.
checkRows
(
1
)
tdSql
.
checkData
(
0
,
0
,
1
)
tdSql
.
query
(
'select 1.0 = false from tb;'
)
tdSql
.
checkRows
(
1
)
tdSql
.
checkData
(
0
,
0
,
0
)
tdSql
.
query
(
'select 0.0 = true from tb;'
)
tdSql
.
checkRows
(
1
)
tdSql
.
checkData
(
0
,
0
,
0
)
tdSql
.
query
(
'select true = 1.001 from tb;'
)
tdSql
.
checkRows
(
1
)
tdSql
.
checkData
(
0
,
0
,
0
)
tdSql
.
query
(
'select true = 1.0000000001 from tb;'
)
##DBL_EPSILON is used in floating number comparison
tdSql
.
checkRows
(
1
)
tdSql
.
checkData
(
0
,
0
,
1
)
##operator: !=
tdSql
.
query
(
'select 1 != 1 from tb;'
)
tdSql
.
checkRows
(
1
)
...
...
@@ -168,6 +193,30 @@ class TDTestCase:
tdSql
.
checkRows
(
1
)
tdSql
.
checkData
(
0
,
0
,
1
)
tdSql
.
query
(
'select 1.0 != true from tb;'
)
tdSql
.
checkRows
(
1
)
tdSql
.
checkData
(
0
,
0
,
0
)
tdSql
.
query
(
'select 0.0 != false from tb;'
)
tdSql
.
checkRows
(
1
)
tdSql
.
checkData
(
0
,
0
,
0
)
tdSql
.
query
(
'select 1.0 != false from tb;'
)
tdSql
.
checkRows
(
1
)
tdSql
.
checkData
(
0
,
0
,
1
)
tdSql
.
query
(
'select 0.0 != true from tb;'
)
tdSql
.
checkRows
(
1
)
tdSql
.
checkData
(
0
,
0
,
1
)
tdSql
.
query
(
'select true != 1.001 from tb;'
)
tdSql
.
checkRows
(
1
)
tdSql
.
checkData
(
0
,
0
,
1
)
tdSql
.
query
(
'select true != 1.0000000001 from tb;'
)
##DBL_EPSILON is used in floating number comparison
tdSql
.
checkRows
(
1
)
tdSql
.
checkData
(
0
,
0
,
0
)
##operator: <>
tdSql
.
query
(
'select 1 <> 1 from tb;'
)
tdSql
.
checkRows
(
1
)
...
...
@@ -225,6 +274,30 @@ class TDTestCase:
tdSql
.
checkRows
(
1
)
tdSql
.
checkData
(
0
,
0
,
1
)
tdSql
.
query
(
'select 1.0 <> true from tb;'
)
tdSql
.
checkRows
(
1
)
tdSql
.
checkData
(
0
,
0
,
0
)
tdSql
.
query
(
'select 0.0 <> false from tb;'
)
tdSql
.
checkRows
(
1
)
tdSql
.
checkData
(
0
,
0
,
0
)
tdSql
.
query
(
'select 1.0 <> false from tb;'
)
tdSql
.
checkRows
(
1
)
tdSql
.
checkData
(
0
,
0
,
1
)
tdSql
.
query
(
'select 0.0 <> true from tb;'
)
tdSql
.
checkRows
(
1
)
tdSql
.
checkData
(
0
,
0
,
1
)
tdSql
.
query
(
'select true <> 1.001 from tb;'
)
tdSql
.
checkRows
(
1
)
tdSql
.
checkData
(
0
,
0
,
1
)
tdSql
.
query
(
'select true <> 1.0000000001 from tb;'
)
##DBL_EPSILON is used in floating number comparison
tdSql
.
checkRows
(
1
)
tdSql
.
checkData
(
0
,
0
,
0
)
##operator: <
tdSql
.
query
(
'select 1 < 1 from tb;'
)
tdSql
.
checkRows
(
1
)
...
...
@@ -282,6 +355,30 @@ class TDTestCase:
tdSql
.
checkRows
(
1
)
tdSql
.
checkData
(
0
,
0
,
0
)
tdSql
.
query
(
'select 1.0 < true from tb;'
)
tdSql
.
checkRows
(
1
)
tdSql
.
checkData
(
0
,
0
,
0
)
tdSql
.
query
(
'select 0.0 < false from tb;'
)
tdSql
.
checkRows
(
1
)
tdSql
.
checkData
(
0
,
0
,
0
)
tdSql
.
query
(
'select false < 1.0 from tb;'
)
tdSql
.
checkRows
(
1
)
tdSql
.
checkData
(
0
,
0
,
1
)
tdSql
.
query
(
'select 0.0 < true from tb;'
)
tdSql
.
checkRows
(
1
)
tdSql
.
checkData
(
0
,
0
,
1
)
tdSql
.
query
(
'select true < 1.001 from tb;'
)
tdSql
.
checkRows
(
1
)
tdSql
.
checkData
(
0
,
0
,
1
)
tdSql
.
query
(
'select true < 1.0000000001 from tb;'
)
##DBL_EPSILON is used in floating number comparison
tdSql
.
checkRows
(
1
)
tdSql
.
checkData
(
0
,
0
,
0
)
##operator: >
tdSql
.
query
(
'select 1 > 1 from tb;'
)
tdSql
.
checkRows
(
1
)
...
...
@@ -339,6 +436,30 @@ class TDTestCase:
tdSql
.
checkRows
(
1
)
tdSql
.
checkData
(
0
,
0
,
1
)
tdSql
.
query
(
'select 1.0 > true from tb;'
)
tdSql
.
checkRows
(
1
)
tdSql
.
checkData
(
0
,
0
,
0
)
tdSql
.
query
(
'select 0.0 > false from tb;'
)
tdSql
.
checkRows
(
1
)
tdSql
.
checkData
(
0
,
0
,
0
)
tdSql
.
query
(
'select 1.0 > false from tb;'
)
tdSql
.
checkRows
(
1
)
tdSql
.
checkData
(
0
,
0
,
1
)
tdSql
.
query
(
'select true > 0.0 from tb;'
)
tdSql
.
checkRows
(
1
)
tdSql
.
checkData
(
0
,
0
,
1
)
tdSql
.
query
(
'select 1.001 > true from tb;'
)
tdSql
.
checkRows
(
1
)
tdSql
.
checkData
(
0
,
0
,
1
)
tdSql
.
query
(
'select 1.0000000001 > true from tb;'
)
##DBL_EPSILON is used in floating number comparison
tdSql
.
checkRows
(
1
)
tdSql
.
checkData
(
0
,
0
,
0
)
##operator: <=
tdSql
.
query
(
'select 1 <= 2 from tb;'
)
tdSql
.
checkRows
(
1
)
...
...
@@ -408,11 +529,35 @@ class TDTestCase:
tdSql
.
checkRows
(
1
)
tdSql
.
checkData
(
0
,
0
,
0
)
tdSql
.
query
(
'select true
>
= true from tb;'
)
tdSql
.
query
(
'select true
<
= true from tb;'
)
tdSql
.
checkRows
(
1
)
tdSql
.
checkData
(
0
,
0
,
1
)
tdSql
.
query
(
'select false >= false from tb;'
)
tdSql
.
query
(
'select false <= false from tb;'
)
tdSql
.
checkRows
(
1
)
tdSql
.
checkData
(
0
,
0
,
1
)
tdSql
.
query
(
'select 1.0 <= true from tb;'
)
tdSql
.
checkRows
(
1
)
tdSql
.
checkData
(
0
,
0
,
1
)
tdSql
.
query
(
'select 0.0 <= false from tb;'
)
tdSql
.
checkRows
(
1
)
tdSql
.
checkData
(
0
,
0
,
1
)
tdSql
.
query
(
'select false <= 1.0 from tb;'
)
tdSql
.
checkRows
(
1
)
tdSql
.
checkData
(
0
,
0
,
1
)
tdSql
.
query
(
'select 0.0 <= true from tb;'
)
tdSql
.
checkRows
(
1
)
tdSql
.
checkData
(
0
,
0
,
1
)
tdSql
.
query
(
'select true <= 1.001 from tb;'
)
tdSql
.
checkRows
(
1
)
tdSql
.
checkData
(
0
,
0
,
1
)
tdSql
.
query
(
'select true <= 1.0000000001 from tb;'
)
##DBL_EPSILON is used in floating number comparison
tdSql
.
checkRows
(
1
)
tdSql
.
checkData
(
0
,
0
,
1
)
...
...
@@ -493,6 +638,30 @@ class TDTestCase:
tdSql
.
checkRows
(
1
)
tdSql
.
checkData
(
0
,
0
,
1
)
tdSql
.
query
(
'select 1.0 >= true from tb;'
)
tdSql
.
checkRows
(
1
)
tdSql
.
checkData
(
0
,
0
,
1
)
tdSql
.
query
(
'select 0.0 >= false from tb;'
)
tdSql
.
checkRows
(
1
)
tdSql
.
checkData
(
0
,
0
,
1
)
tdSql
.
query
(
'select 1.0 >= false from tb;'
)
tdSql
.
checkRows
(
1
)
tdSql
.
checkData
(
0
,
0
,
1
)
tdSql
.
query
(
'select true >= 0.0 from tb;'
)
tdSql
.
checkRows
(
1
)
tdSql
.
checkData
(
0
,
0
,
1
)
tdSql
.
query
(
'select 1.001 >= true from tb;'
)
tdSql
.
checkRows
(
1
)
tdSql
.
checkData
(
0
,
0
,
1
)
tdSql
.
query
(
'select 1.0000000001 >= true from tb;'
)
##DBL_EPSILON is used in floating number comparison
tdSql
.
checkRows
(
1
)
tdSql
.
checkData
(
0
,
0
,
1
)
##operator: between and
tdSql
.
query
(
'select 1 between 2 and 4 from tb;'
)
tdSql
.
checkRows
(
1
)
...
...
@@ -591,6 +760,22 @@ class TDTestCase:
tdSql
.
checkRows
(
1
)
tdSql
.
checkData
(
0
,
0
,
0
)
tdSql
.
query
(
'select false between 0.0 and 1.0 from tb;'
)
tdSql
.
checkRows
(
1
)
tdSql
.
checkData
(
0
,
0
,
1
)
tdSql
.
query
(
'select false between 1.0 and 2.0 from tb;'
)
tdSql
.
checkRows
(
1
)
tdSql
.
checkData
(
0
,
0
,
0
)
tdSql
.
query
(
'select true between 0.0 and 1.0 from tb;'
)
tdSql
.
checkRows
(
1
)
tdSql
.
checkData
(
0
,
0
,
1
)
tdSql
.
query
(
'select true between -1.0 and 0.0 from tb;'
)
tdSql
.
checkRows
(
1
)
tdSql
.
checkData
(
0
,
0
,
0
)
tdSql
.
query
(
'select 0 between false and true from tb;'
)
tdSql
.
checkRows
(
1
)
tdSql
.
checkData
(
0
,
0
,
1
)
...
...
@@ -607,6 +792,22 @@ class TDTestCase:
tdSql
.
checkRows
(
1
)
tdSql
.
checkData
(
0
,
0
,
1
)
tdSql
.
query
(
'select 0.0 between false and true from tb;'
)
tdSql
.
checkRows
(
1
)
tdSql
.
checkData
(
0
,
0
,
1
)
tdSql
.
query
(
'select 1.0 between false and true from tb;'
)
tdSql
.
checkRows
(
1
)
tdSql
.
checkData
(
0
,
0
,
1
)
tdSql
.
query
(
'select 0 between false and 10.0 from tb;'
)
tdSql
.
checkRows
(
1
)
tdSql
.
checkData
(
0
,
0
,
1
)
tdSql
.
query
(
'select 1 between true and 10.0 from tb;'
)
tdSql
.
checkRows
(
1
)
tdSql
.
checkData
(
0
,
0
,
1
)
##operator: and
tdSql
.
query
(
'select 10 and 10 from tb;'
)
tdSql
.
checkRows
(
1
)
...
...
@@ -644,6 +845,10 @@ class TDTestCase:
tdSql
.
checkRows
(
1
)
tdSql
.
checkData
(
0
,
0
,
0
)
tdSql
.
query
(
'select true and 10.0 and false from tb;'
)
tdSql
.
checkRows
(
1
)
tdSql
.
checkData
(
0
,
0
,
0
)
tdSql
.
query
(
'select 1 and 2 and 3 and 10.1 and -20.02 and 22.03 from tb;'
)
tdSql
.
checkRows
(
1
)
tdSql
.
checkData
(
0
,
0
,
1
)
...
...
@@ -693,6 +898,10 @@ class TDTestCase:
tdSql
.
checkRows
(
1
)
tdSql
.
checkData
(
0
,
0
,
1
)
tdSql
.
query
(
'select true or 10.0 or false from tb;'
)
tdSql
.
checkRows
(
1
)
tdSql
.
checkData
(
0
,
0
,
1
)
##operator: multiple operations
tdSql
.
query
(
'select 1 and 1 != 2 and 1 < 2 and 2 between 1 and 3 from tb;'
)
tdSql
.
checkRows
(
1
)
...
...
@@ -738,6 +947,14 @@ class TDTestCase:
tdSql
.
checkRows
(
1
)
tdSql
.
checkData
(
0
,
0
,
1
)
tdSql
.
query
(
'select 1 != 2 and 1 < 2 or 1 >= 2 or 2 between 4 and 5 and true and 10.1 from tb;'
)
tdSql
.
checkRows
(
1
)
tdSql
.
checkData
(
0
,
0
,
1
)
tdSql
.
query
(
'select 1 != 2 and 1 < 2 or 1 >= 2 or 2 between 4 and 5 and false or 10.1 from tb;'
)
tdSql
.
checkRows
(
1
)
tdSql
.
checkData
(
0
,
0
,
1
)
tdSql
.
execute
(
'drop database db'
)
def
stop
(
self
):
tdSql
.
close
()
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录