Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
3c807f22
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
3c807f22
编写于
1月 14, 2022
作者:
G
Ganlin Zhao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[TD-12945]<fix>(query): taos shell crash when constant comparison cause crash
上级
5bba58b4
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
174 addition
and
0 deletion
+174
-0
tests/develop-test/2-query/constant_compare.py
tests/develop-test/2-query/constant_compare.py
+174
-0
未找到文件。
tests/develop-test/2-query/constant_compare.py
浏览文件 @
3c807f22
...
...
@@ -135,6 +135,21 @@ class TDTestCase:
tdSql
.
checkRows
(
1
)
tdSql
.
checkData
(
0
,
0
,
1
)
tdSql
.
error
(
'select "abc" = "def"'
)
tdSql
.
error
(
'select "abc" = 1'
)
tdSql
.
error
(
'select 1 = "abc"'
)
tdSql
.
error
(
'select "abc" = 1.0'
)
tdSql
.
error
(
'select 1.0 = "abc"'
)
tdSql
.
error
(
'select "abc" = true'
)
tdSql
.
error
(
'select false = "abc"'
)
tdSql
.
error
(
'select
\'
abc
\'
=
\'
def
\'
'
)
tdSql
.
error
(
'select
\'
abc
\'
= 1'
)
tdSql
.
error
(
'select 1 =
\'
abc
\'
'
)
tdSql
.
error
(
'select
\'
abc
\'
= 1.0'
)
tdSql
.
error
(
'select 1.0 =
\'
abc
\'
'
)
tdSql
.
error
(
'select
\'
abc
\'
= true'
)
tdSql
.
error
(
'select false =
\'
abc
\'
'
)
##operator: !=
tdSql
.
query
(
'select 1 != 1 from tb;'
)
...
...
@@ -217,6 +232,21 @@ class TDTestCase:
tdSql
.
checkRows
(
1
)
tdSql
.
checkData
(
0
,
0
,
0
)
tdSql
.
error
(
'select "abc" != "def"'
)
tdSql
.
error
(
'select "abc" != 1'
)
tdSql
.
error
(
'select 1 != "abc"'
)
tdSql
.
error
(
'select "abc" != 1.0'
)
tdSql
.
error
(
'select 1.0 != "abc"'
)
tdSql
.
error
(
'select "abc" != true'
)
tdSql
.
error
(
'select false != "abc"'
)
tdSql
.
error
(
'select
\'
abc
\'
!=
\'
def
\'
'
)
tdSql
.
error
(
'select
\'
abc
\'
!= 1'
)
tdSql
.
error
(
'select 1 !=
\'
abc
\'
'
)
tdSql
.
error
(
'select
\'
abc
\'
!= 1.0'
)
tdSql
.
error
(
'select 1.0 !=
\'
abc
\'
'
)
tdSql
.
error
(
'select
\'
abc
\'
!= true'
)
tdSql
.
error
(
'select false !=
\'
abc
\'
'
)
##operator: <>
tdSql
.
query
(
'select 1 <> 1 from tb;'
)
tdSql
.
checkRows
(
1
)
...
...
@@ -298,6 +328,21 @@ class TDTestCase:
tdSql
.
checkRows
(
1
)
tdSql
.
checkData
(
0
,
0
,
0
)
tdSql
.
error
(
'select "abc" <> "def"'
)
tdSql
.
error
(
'select "abc" <> 1'
)
tdSql
.
error
(
'select 1 <> "abc"'
)
tdSql
.
error
(
'select "abc" <> 1.0'
)
tdSql
.
error
(
'select 1.0 <> "abc"'
)
tdSql
.
error
(
'select "abc" <> true'
)
tdSql
.
error
(
'select false <> "abc"'
)
tdSql
.
error
(
'select
\'
abc
\'
<>
\'
def
\'
'
)
tdSql
.
error
(
'select
\'
abc
\'
<> 1'
)
tdSql
.
error
(
'select 1 <>
\'
abc
\'
'
)
tdSql
.
error
(
'select
\'
abc
\'
<> 1.0'
)
tdSql
.
error
(
'select 1.0 <>
\'
abc
\'
'
)
tdSql
.
error
(
'select
\'
abc
\'
<> true'
)
tdSql
.
error
(
'select false <>
\'
abc
\'
'
)
##operator: <
tdSql
.
query
(
'select 1 < 1 from tb;'
)
tdSql
.
checkRows
(
1
)
...
...
@@ -379,6 +424,21 @@ class TDTestCase:
tdSql
.
checkRows
(
1
)
tdSql
.
checkData
(
0
,
0
,
0
)
tdSql
.
error
(
'select "abc" < "def"'
)
tdSql
.
error
(
'select "abc" < 1'
)
tdSql
.
error
(
'select 1 < "abc"'
)
tdSql
.
error
(
'select "abc" < 1.0'
)
tdSql
.
error
(
'select 1.0 < "abc"'
)
tdSql
.
error
(
'select "abc" < true'
)
tdSql
.
error
(
'select false < "abc"'
)
tdSql
.
error
(
'select
\'
abc
\'
<
\'
def
\'
'
)
tdSql
.
error
(
'select
\'
abc
\'
< 1'
)
tdSql
.
error
(
'select 1 <
\'
abc
\'
'
)
tdSql
.
error
(
'select
\'
abc
\'
< 1.0'
)
tdSql
.
error
(
'select 1.0 <
\'
abc
\'
'
)
tdSql
.
error
(
'select
\'
abc
\'
< true'
)
tdSql
.
error
(
'select false <
\'
abc
\'
'
)
##operator: >
tdSql
.
query
(
'select 1 > 1 from tb;'
)
tdSql
.
checkRows
(
1
)
...
...
@@ -460,6 +520,21 @@ class TDTestCase:
tdSql
.
checkRows
(
1
)
tdSql
.
checkData
(
0
,
0
,
0
)
tdSql
.
error
(
'select "abc" > "def"'
)
tdSql
.
error
(
'select "abc" > 1'
)
tdSql
.
error
(
'select 1 > "abc"'
)
tdSql
.
error
(
'select "abc" > 1.0'
)
tdSql
.
error
(
'select 1.0 > "abc"'
)
tdSql
.
error
(
'select "abc" > true'
)
tdSql
.
error
(
'select false > "abc"'
)
tdSql
.
error
(
'select
\'
abc
\'
>
\'
def
\'
'
)
tdSql
.
error
(
'select
\'
abc
\'
> 1'
)
tdSql
.
error
(
'select 1 >
\'
abc
\'
'
)
tdSql
.
error
(
'select
\'
abc
\'
> 1.0'
)
tdSql
.
error
(
'select 1.0 >
\'
abc
\'
'
)
tdSql
.
error
(
'select
\'
abc
\'
> true'
)
tdSql
.
error
(
'select false >
\'
abc
\'
'
)
##operator: <=
tdSql
.
query
(
'select 1 <= 2 from tb;'
)
tdSql
.
checkRows
(
1
)
...
...
@@ -561,6 +636,21 @@ class TDTestCase:
tdSql
.
checkRows
(
1
)
tdSql
.
checkData
(
0
,
0
,
1
)
tdSql
.
error
(
'select "abc" <= "def"'
)
tdSql
.
error
(
'select "abc" <= 1'
)
tdSql
.
error
(
'select 1 <= "abc"'
)
tdSql
.
error
(
'select "abc" <= 1.0'
)
tdSql
.
error
(
'select 1.0 <= "abc"'
)
tdSql
.
error
(
'select "abc" <= true'
)
tdSql
.
error
(
'select false <= "abc"'
)
tdSql
.
error
(
'select
\'
abc
\'
<=
\'
def
\'
'
)
tdSql
.
error
(
'select
\'
abc
\'
<= 1'
)
tdSql
.
error
(
'select 1 <=
\'
abc
\'
'
)
tdSql
.
error
(
'select
\'
abc
\'
<= 1.0'
)
tdSql
.
error
(
'select 1.0 <=
\'
abc
\'
'
)
tdSql
.
error
(
'select
\'
abc
\'
<= true'
)
tdSql
.
error
(
'select false <=
\'
abc
\'
'
)
##operator: >=
tdSql
.
query
(
'select 1 >= 2 from tb;'
)
tdSql
.
checkRows
(
1
)
...
...
@@ -662,6 +752,21 @@ class TDTestCase:
tdSql
.
checkRows
(
1
)
tdSql
.
checkData
(
0
,
0
,
1
)
tdSql
.
error
(
'select "abc" >= "def"'
)
tdSql
.
error
(
'select "abc" >= 1'
)
tdSql
.
error
(
'select 1 >= "abc"'
)
tdSql
.
error
(
'select "abc" >= 1.0'
)
tdSql
.
error
(
'select 1.0 >= "abc"'
)
tdSql
.
error
(
'select "abc" >= true'
)
tdSql
.
error
(
'select false >= "abc"'
)
tdSql
.
error
(
'select
\'
abc
\'
>=
\'
def
\'
'
)
tdSql
.
error
(
'select
\'
abc
\'
>= 1'
)
tdSql
.
error
(
'select 1 >=
\'
abc
\'
'
)
tdSql
.
error
(
'select
\'
abc
\'
>= 1.0'
)
tdSql
.
error
(
'select 1.0 >=
\'
abc
\'
'
)
tdSql
.
error
(
'select
\'
abc
\'
>= true'
)
tdSql
.
error
(
'select false >=
\'
abc
\'
'
)
##operator: between and
tdSql
.
query
(
'select 1 between 2 and 4 from tb;'
)
tdSql
.
checkRows
(
1
)
...
...
@@ -808,6 +913,28 @@ class TDTestCase:
tdSql
.
checkRows
(
1
)
tdSql
.
checkData
(
0
,
0
,
1
)
tdSql
.
error
(
'select "abc" between "def" and "ghi"'
)
tdSql
.
error
(
'select "abc" between 1 and 2'
)
tdSql
.
error
(
'select "abc" between 1.0 and 2.0'
)
tdSql
.
error
(
'select "abc" between true and false'
)
tdSql
.
error
(
'select 1 between 1.0 and "cde"'
)
tdSql
.
error
(
'select 1.0 between true and "cde"'
)
tdSql
.
error
(
'select true between 1 and "cde"'
)
tdSql
.
error
(
'select 1 between "abc" and 1.0'
)
tdSql
.
error
(
'select 1.0 between "abc" and true'
)
tdSql
.
error
(
'select true between "abc" and 1'
)
tdSql
.
error
(
'select
\'
abc
\'
between
\'
def
\'
and
\'
ghi
\'
'
)
tdSql
.
error
(
'select
\'
abc
\'
between 1 and 2'
)
tdSql
.
error
(
'select
\'
abc
\'
between 1.0 and 2.0'
)
tdSql
.
error
(
'select
\'
abc
\'
between true and false'
)
tdSql
.
error
(
'select 1 between 1.0 and
\'
cde
\'
'
)
tdSql
.
error
(
'select 1.0 between true and
\'
cde
\'
'
)
tdSql
.
error
(
'select true between 1 and
\'
cde
\'
'
)
tdSql
.
error
(
'select 1 between
\'
abc
\'
and 1.0'
)
tdSql
.
error
(
'select 1.0 between
\'
abc
\'
and true'
)
tdSql
.
error
(
'select true between
\'
abc
\'
and 1'
)
##operator: and
tdSql
.
query
(
'select 10 and 10 from tb;'
)
tdSql
.
checkRows
(
1
)
...
...
@@ -861,6 +988,28 @@ class TDTestCase:
tdSql
.
checkRows
(
1
)
tdSql
.
checkData
(
0
,
0
,
0
)
tdSql
.
error
(
'select "abc" and "def"'
)
tdSql
.
error
(
'select "abc" and 1'
)
tdSql
.
error
(
'select 1 and "abc"'
)
tdSql
.
error
(
'select "abc" and 1.0'
)
tdSql
.
error
(
'select 1.0 and abc'
)
tdSql
.
error
(
'select "abc" and true'
)
tdSql
.
error
(
'select false and "abc"'
)
tdSql
.
error
(
'select 1 and "abc" and 1.0 and true and false and 0'
)
tdSql
.
error
(
'select 1 and "abc" and 1.0 and "cde" and false and 0'
)
tdSql
.
error
(
'select 1 and "abc" and 1.0 and "cde" and false and "fhi"'
)
tdSql
.
error
(
'select
\'
abc
\'
and
\'
def
\'
'
)
tdSql
.
error
(
'select
\'
abc
\'
and 1'
)
tdSql
.
error
(
'select 1 and
\'
abc
\'
'
)
tdSql
.
error
(
'select
\'
abc
\'
and 1.0'
)
tdSql
.
error
(
'select 1.0 and abc'
)
tdSql
.
error
(
'select
\'
abc
\'
and true'
)
tdSql
.
error
(
'select false and
\'
abc
\'
'
)
tdSql
.
error
(
'select 1 and
\'
abc
\'
and 1.0 and true and false and 0'
)
tdSql
.
error
(
'select 1 and
\'
abc
\'
and 1.0 and
\'
cde
\'
and false and "fhi"'
)
##operator: or
tdSql
.
query
(
'select 10 or 10 from tb;'
)
tdSql
.
checkRows
(
1
)
...
...
@@ -902,6 +1051,27 @@ class TDTestCase:
tdSql
.
checkRows
(
1
)
tdSql
.
checkData
(
0
,
0
,
1
)
tdSql
.
error
(
'select "abc" or "def"'
)
tdSql
.
error
(
'select "abc" or 1'
)
tdSql
.
error
(
'select 1 or "abc"'
)
tdSql
.
error
(
'select "abc" or 1.0'
)
tdSql
.
error
(
'select 1.0 or abc'
)
tdSql
.
error
(
'select "abc" or true'
)
tdSql
.
error
(
'select false or "abc"'
)
tdSql
.
error
(
'select 1 or "abc" or 1.0 or true or false or 0'
)
tdSql
.
error
(
'select 1 or "abc" or 1.0 or "cde" or false or 0'
)
tdSql
.
error
(
'select 1 or "abc" or 1.0 or "cde" or false or "fhi"'
)
tdSql
.
error
(
'select
\'
abc
\'
or
\'
def
\'
'
)
tdSql
.
error
(
'select
\'
abc
\'
or 1'
)
tdSql
.
error
(
'select 1 or
\'
abc
\'
'
)
tdSql
.
error
(
'select
\'
abc
\'
or 1.0'
)
tdSql
.
error
(
'select 1.0 or abc'
)
tdSql
.
error
(
'select
\'
abc
\'
or true'
)
tdSql
.
error
(
'select false or
\'
abc
\'
'
)
tdSql
.
error
(
'select 1 or
\'
abc
\'
or 1.0 or true or false or 0'
)
tdSql
.
error
(
'select 1 or
\'
abc
\'
or 1.0 or
\'
cde
\'
or false or "fhi"'
)
##operator: multiple operations
tdSql
.
query
(
'select 1 and 1 != 2 and 1 < 2 and 2 between 1 and 3 from tb;'
)
tdSql
.
checkRows
(
1
)
...
...
@@ -955,6 +1125,10 @@ class TDTestCase:
tdSql
.
checkRows
(
1
)
tdSql
.
checkData
(
0
,
0
,
1
)
tdSql
.
error
(
'select 1 != 2 and "abc" or 1 >= 2 or "cde" between 4 and 5 and
\'
ghi
\'
or 10.1 from tb;'
)
tdSql
.
error
(
'select 1 != 2 and 1 < 2 or
\'
abc123
\'
or 2 between
\'
abc123
\'
and 5 and false or "abc123" from tb;'
)
tdSql
.
query
(
'select
\'
1234
\'
or 1 < 2 or
\'
aace
\'
and "cde" between 4 and "def" and "ckas" or 10.1 from tb;'
)
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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录