提交 bf8b149a 编写于 作者: G Ganlin Zhao

[TD-12945]<fix>(query): taos shell crash when constant comparison cause crash

上级 13a6f84d
...@@ -135,20 +135,20 @@ class TDTestCase: ...@@ -135,20 +135,20 @@ class TDTestCase:
tdSql.checkRows(1) tdSql.checkRows(1)
tdSql.checkData(0, 0, 1) tdSql.checkData(0, 0, 1)
tdSql.error('select "abc" = "def"') tdSql.error('select "abc" = "def" from tb;')
tdSql.error('select "abc" = 1') tdSql.error('select "abc" = 1 from tb;')
tdSql.error('select 1 = "abc"') tdSql.error('select 1 = "abc" from tb;')
tdSql.error('select "abc" = 1.0') tdSql.error('select "abc" = 1.0 from tb;')
tdSql.error('select 1.0 = "abc"') tdSql.error('select 1.0 = "abc" from tb;')
tdSql.error('select "abc" = true') tdSql.error('select "abc" = true from tb;')
tdSql.error('select false = "abc"') tdSql.error('select false = "abc" from tb;')
tdSql.error('select \'abc\' = \'def\'') tdSql.error('select \'abc\' = \'def\' from tb;')
tdSql.error('select \'abc\' = 1') tdSql.error('select \'abc\' = 1 from tb;')
tdSql.error('select 1 = \'abc\'') tdSql.error('select 1 = \'abc\' from tb;')
tdSql.error('select \'abc\' = 1.0') tdSql.error('select \'abc\' = 1.0 from tb;')
tdSql.error('select 1.0 = \'abc\'') tdSql.error('select 1.0 = \'abc\' from tb;')
tdSql.error('select \'abc\' = true') tdSql.error('select \'abc\' = true from tb;')
tdSql.error('select false = \'abc\'') tdSql.error('select false = \'abc\' from tb;')
##operator: != ##operator: !=
...@@ -232,20 +232,20 @@ class TDTestCase: ...@@ -232,20 +232,20 @@ class TDTestCase:
tdSql.checkRows(1) tdSql.checkRows(1)
tdSql.checkData(0, 0, 0) tdSql.checkData(0, 0, 0)
tdSql.error('select "abc" != "def"') tdSql.error('select "abc" != "def" from tb;')
tdSql.error('select "abc" != 1') tdSql.error('select "abc" != 1 from tb;')
tdSql.error('select 1 != "abc"') tdSql.error('select 1 != "abc" from tb;')
tdSql.error('select "abc" != 1.0') tdSql.error('select "abc" != 1.0 from tb;')
tdSql.error('select 1.0 != "abc"') tdSql.error('select 1.0 != "abc" from tb;')
tdSql.error('select "abc" != true') tdSql.error('select "abc" != true from tb;')
tdSql.error('select false != "abc"') tdSql.error('select false != "abc" from tb;')
tdSql.error('select \'abc\' != \'def\'') tdSql.error('select \'abc\' != \'def\' from tb;')
tdSql.error('select \'abc\' != 1') tdSql.error('select \'abc\' != 1 from tb;')
tdSql.error('select 1 != \'abc\'') tdSql.error('select 1 != \'abc\' from tb;')
tdSql.error('select \'abc\' != 1.0') tdSql.error('select \'abc\' != 1.0 from tb;')
tdSql.error('select 1.0 != \'abc\'') tdSql.error('select 1.0 != \'abc\' from tb;')
tdSql.error('select \'abc\' != true') tdSql.error('select \'abc\' != true from tb;')
tdSql.error('select false != \'abc\'') tdSql.error('select false != \'abc\' from tb;')
##operator: <> ##operator: <>
tdSql.query('select 1 <> 1 from tb;') tdSql.query('select 1 <> 1 from tb;')
...@@ -328,20 +328,20 @@ class TDTestCase: ...@@ -328,20 +328,20 @@ class TDTestCase:
tdSql.checkRows(1) tdSql.checkRows(1)
tdSql.checkData(0, 0, 0) tdSql.checkData(0, 0, 0)
tdSql.error('select "abc" <> "def"') tdSql.error('select "abc" <> "def" from tb;')
tdSql.error('select "abc" <> 1') tdSql.error('select "abc" <> 1 from tb;')
tdSql.error('select 1 <> "abc"') tdSql.error('select 1 <> "abc" from tb;')
tdSql.error('select "abc" <> 1.0') tdSql.error('select "abc" <> 1.0 from tb;')
tdSql.error('select 1.0 <> "abc"') tdSql.error('select 1.0 <> "abc" from tb;')
tdSql.error('select "abc" <> true') tdSql.error('select "abc" <> true from tb;')
tdSql.error('select false <> "abc"') tdSql.error('select false <> "abc" from tb;')
tdSql.error('select \'abc\' <> \'def\'') tdSql.error('select \'abc\' <> \'def\' from tb;')
tdSql.error('select \'abc\' <> 1') tdSql.error('select \'abc\' <> 1 from tb;')
tdSql.error('select 1 <> \'abc\'') tdSql.error('select 1 <> \'abc\' from tb;')
tdSql.error('select \'abc\' <> 1.0') tdSql.error('select \'abc\' <> 1.0 from tb;')
tdSql.error('select 1.0 <> \'abc\'') tdSql.error('select 1.0 <> \'abc\' from tb;')
tdSql.error('select \'abc\' <> true') tdSql.error('select \'abc\' <> true from tb;')
tdSql.error('select false <> \'abc\'') tdSql.error('select false <> \'abc\' from tb;')
##operator: < ##operator: <
tdSql.query('select 1 < 1 from tb;') tdSql.query('select 1 < 1 from tb;')
...@@ -424,20 +424,20 @@ class TDTestCase: ...@@ -424,20 +424,20 @@ class TDTestCase:
tdSql.checkRows(1) tdSql.checkRows(1)
tdSql.checkData(0, 0, 0) tdSql.checkData(0, 0, 0)
tdSql.error('select "abc" < "def"') tdSql.error('select "abc" < "def" from tb;')
tdSql.error('select "abc" < 1') tdSql.error('select "abc" < 1 from tb;')
tdSql.error('select 1 < "abc"') tdSql.error('select 1 < "abc" from tb;')
tdSql.error('select "abc" < 1.0') tdSql.error('select "abc" < 1.0 from tb;')
tdSql.error('select 1.0 < "abc"') tdSql.error('select 1.0 < "abc" from tb;')
tdSql.error('select "abc" < true') tdSql.error('select "abc" < true from tb;')
tdSql.error('select false < "abc"') tdSql.error('select false < "abc" from tb;')
tdSql.error('select \'abc\' < \'def\'') tdSql.error('select \'abc\' < \'def\' from tb;')
tdSql.error('select \'abc\' < 1') tdSql.error('select \'abc\' < 1 from tb;')
tdSql.error('select 1 < \'abc\'') tdSql.error('select 1 < \'abc\' from tb;')
tdSql.error('select \'abc\' < 1.0') tdSql.error('select \'abc\' < 1.0 from tb;')
tdSql.error('select 1.0 < \'abc\'') tdSql.error('select 1.0 < \'abc\' from tb;')
tdSql.error('select \'abc\' < true') tdSql.error('select \'abc\' < true from tb;')
tdSql.error('select false < \'abc\'') tdSql.error('select false < \'abc\' from tb;')
##operator: > ##operator: >
tdSql.query('select 1 > 1 from tb;') tdSql.query('select 1 > 1 from tb;')
...@@ -520,20 +520,20 @@ class TDTestCase: ...@@ -520,20 +520,20 @@ class TDTestCase:
tdSql.checkRows(1) tdSql.checkRows(1)
tdSql.checkData(0, 0, 0) tdSql.checkData(0, 0, 0)
tdSql.error('select "abc" > "def"') tdSql.error('select "abc" > "def" from tb;')
tdSql.error('select "abc" > 1') tdSql.error('select "abc" > 1 from tb;')
tdSql.error('select 1 > "abc"') tdSql.error('select 1 > "abc" from tb;')
tdSql.error('select "abc" > 1.0') tdSql.error('select "abc" > 1.0 from tb;')
tdSql.error('select 1.0 > "abc"') tdSql.error('select 1.0 > "abc" from tb;')
tdSql.error('select "abc" > true') tdSql.error('select "abc" > true from tb;')
tdSql.error('select false > "abc"') tdSql.error('select false > "abc" from tb;')
tdSql.error('select \'abc\' > \'def\'') tdSql.error('select \'abc\' > \'def\' from tb;')
tdSql.error('select \'abc\' > 1') tdSql.error('select \'abc\' > 1 from tb;')
tdSql.error('select 1 > \'abc\'') tdSql.error('select 1 > \'abc\' from tb;')
tdSql.error('select \'abc\' > 1.0') tdSql.error('select \'abc\' > 1.0 from tb;')
tdSql.error('select 1.0 > \'abc\'') tdSql.error('select 1.0 > \'abc\' from tb;')
tdSql.error('select \'abc\' > true') tdSql.error('select \'abc\' > true from tb;')
tdSql.error('select false > \'abc\'') tdSql.error('select false > \'abc\' from tb;')
##operator: <= ##operator: <=
tdSql.query('select 1 <= 2 from tb;') tdSql.query('select 1 <= 2 from tb;')
...@@ -636,20 +636,20 @@ class TDTestCase: ...@@ -636,20 +636,20 @@ class TDTestCase:
tdSql.checkRows(1) tdSql.checkRows(1)
tdSql.checkData(0, 0, 1) tdSql.checkData(0, 0, 1)
tdSql.error('select "abc" <= "def"') tdSql.error('select "abc" <= "def" from tb;')
tdSql.error('select "abc" <= 1') tdSql.error('select "abc" <= 1 from tb;')
tdSql.error('select 1 <= "abc"') tdSql.error('select 1 <= "abc" from tb;')
tdSql.error('select "abc" <= 1.0') tdSql.error('select "abc" <= 1.0 from tb;')
tdSql.error('select 1.0 <= "abc"') tdSql.error('select 1.0 <= "abc" from tb;')
tdSql.error('select "abc" <= true') tdSql.error('select "abc" <= true from tb;')
tdSql.error('select false <= "abc"') tdSql.error('select false <= "abc" from tb;')
tdSql.error('select \'abc\' <= \'def\'') tdSql.error('select \'abc\' <= \'def\' from tb;')
tdSql.error('select \'abc\' <= 1') tdSql.error('select \'abc\' <= 1 from tb;')
tdSql.error('select 1 <= \'abc\'') tdSql.error('select 1 <= \'abc\' from tb;')
tdSql.error('select \'abc\' <= 1.0') tdSql.error('select \'abc\' <= 1.0 from tb;')
tdSql.error('select 1.0 <= \'abc\'') tdSql.error('select 1.0 <= \'abc\' from tb;')
tdSql.error('select \'abc\' <= true') tdSql.error('select \'abc\' <= true from tb;')
tdSql.error('select false <= \'abc\'') tdSql.error('select false <= \'abc\' from tb;')
##operator: >= ##operator: >=
tdSql.query('select 1 >= 2 from tb;') tdSql.query('select 1 >= 2 from tb;')
...@@ -752,20 +752,20 @@ class TDTestCase: ...@@ -752,20 +752,20 @@ class TDTestCase:
tdSql.checkRows(1) tdSql.checkRows(1)
tdSql.checkData(0, 0, 1) tdSql.checkData(0, 0, 1)
tdSql.error('select "abc" >= "def"') tdSql.error('select "abc" >= "def" from tb;')
tdSql.error('select "abc" >= 1') tdSql.error('select "abc" >= 1 from tb;')
tdSql.error('select 1 >= "abc"') tdSql.error('select 1 >= "abc" from tb;')
tdSql.error('select "abc" >= 1.0') tdSql.error('select "abc" >= 1.0 from tb;')
tdSql.error('select 1.0 >= "abc"') tdSql.error('select 1.0 >= "abc" from tb;')
tdSql.error('select "abc" >= true') tdSql.error('select "abc" >= true from tb;')
tdSql.error('select false >= "abc"') tdSql.error('select false >= "abc" from tb;')
tdSql.error('select \'abc\' >= \'def\'') tdSql.error('select \'abc\' >= \'def\' from tb;')
tdSql.error('select \'abc\' >= 1') tdSql.error('select \'abc\' >= 1 from tb;')
tdSql.error('select 1 >= \'abc\'') tdSql.error('select 1 >= \'abc\' from tb;')
tdSql.error('select \'abc\' >= 1.0') tdSql.error('select \'abc\' >= 1.0 from tb;')
tdSql.error('select 1.0 >= \'abc\'') tdSql.error('select 1.0 >= \'abc\' from tb;')
tdSql.error('select \'abc\' >= true') tdSql.error('select \'abc\' >= true from tb;')
tdSql.error('select false >= \'abc\'') tdSql.error('select false >= \'abc\' from tb;')
##operator: between and ##operator: between and
tdSql.query('select 1 between 2 and 4 from tb;') tdSql.query('select 1 between 2 and 4 from tb;')
...@@ -913,27 +913,27 @@ class TDTestCase: ...@@ -913,27 +913,27 @@ class TDTestCase:
tdSql.checkRows(1) tdSql.checkRows(1)
tdSql.checkData(0, 0, 1) tdSql.checkData(0, 0, 1)
tdSql.error('select "abc" between "def" and "ghi"') tdSql.error('select "abc" between "def" and "ghi" from tb;')
tdSql.error('select "abc" between 1 and 2') tdSql.error('select "abc" between 1 and 2 from tb;')
tdSql.error('select "abc" between 1.0 and 2.0') tdSql.error('select "abc" between 1.0 and 2.0 from tb;')
tdSql.error('select "abc" between true and false') tdSql.error('select "abc" between true and false from tb;')
tdSql.error('select 1 between 1.0 and "cde"') tdSql.error('select 1 between 1.0 and "cde" from tb;')
tdSql.error('select 1.0 between true and "cde"') tdSql.error('select 1.0 between true and "cde" from tb;')
tdSql.error('select true between 1 and "cde"') tdSql.error('select true between 1 and "cde" from tb;')
tdSql.error('select 1 between "abc" and 1.0') tdSql.error('select 1 between "abc" and 1.0 from tb;')
tdSql.error('select 1.0 between "abc" and true') tdSql.error('select 1.0 between "abc" and true from tb;')
tdSql.error('select true between "abc" and 1') tdSql.error('select true between "abc" and 1 from tb;')
tdSql.error('select \'abc\' between \'def\' and \'ghi\'') tdSql.error('select \'abc\' between \'def\' and \'ghi\' from tb;')
tdSql.error('select \'abc\' between 1 and 2') tdSql.error('select \'abc\' between 1 and 2 from tb;')
tdSql.error('select \'abc\' between 1.0 and 2.0') tdSql.error('select \'abc\' between 1.0 and 2.0 from tb;')
tdSql.error('select \'abc\' between true and false') tdSql.error('select \'abc\' between true and false from tb;')
tdSql.error('select 1 between 1.0 and \'cde\'') tdSql.error('select 1 between 1.0 and \'cde\' from tb;')
tdSql.error('select 1.0 between true and \'cde\'') tdSql.error('select 1.0 between true and \'cde\' from tb;')
tdSql.error('select true between 1 and \'cde\'') tdSql.error('select true between 1 and \'cde\' from tb;')
tdSql.error('select 1 between \'abc\' and 1.0') tdSql.error('select 1 between \'abc\' and 1.0 from tb;')
tdSql.error('select 1.0 between \'abc\' and true') tdSql.error('select 1.0 between \'abc\' and true from tb;')
tdSql.error('select true between \'abc\' and 1') tdSql.error('select true between \'abc\' and 1 from tb;')
##operator: and ##operator: and
tdSql.query('select 10 and 10 from tb;') tdSql.query('select 10 and 10 from tb;')
...@@ -988,26 +988,26 @@ class TDTestCase: ...@@ -988,26 +988,26 @@ class TDTestCase:
tdSql.checkRows(1) tdSql.checkRows(1)
tdSql.checkData(0, 0, 0) tdSql.checkData(0, 0, 0)
tdSql.error('select "abc" and "def"') tdSql.error('select "abc" and "def" from tb;')
tdSql.error('select "abc" and 1') tdSql.error('select "abc" and 1 from tb;')
tdSql.error('select 1 and "abc"') tdSql.error('select 1 and "abc" from tb;')
tdSql.error('select "abc" and 1.0') tdSql.error('select "abc" and 1.0 from tb;')
tdSql.error('select 1.0 and abc') tdSql.error('select 1.0 and abc from tb;')
tdSql.error('select "abc" and true') tdSql.error('select "abc" and true from tb;')
tdSql.error('select false and "abc"') tdSql.error('select false and "abc" from tb;')
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 true and false and 0 from tb;')
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 0 from tb;')
tdSql.error('select 1 and "abc" and 1.0 and "cde" and false and "fhi"') tdSql.error('select 1 and "abc" and 1.0 and "cde" and false and "fhi" from tb;')
tdSql.error('select \'abc\' and \'def\'') tdSql.error('select \'abc\' and \'def\' from tb;')
tdSql.error('select \'abc\' and 1') tdSql.error('select \'abc\' and 1 from tb;')
tdSql.error('select 1 and \'abc\'') tdSql.error('select 1 and \'abc\' from tb;')
tdSql.error('select \'abc\' and 1.0') tdSql.error('select \'abc\' and 1.0 from tb;')
tdSql.error('select 1.0 and abc') tdSql.error('select 1.0 and abc from tb;')
tdSql.error('select \'abc\' and true') tdSql.error('select \'abc\' and true from tb;')
tdSql.error('select false and \'abc\'') tdSql.error('select false and \'abc\' from tb;')
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 true and false and 0 from tb;')
tdSql.error('select 1 and \'abc\' and 1.0 and \'cde\' and false and "fhi"') tdSql.error('select 1 and \'abc\' and 1.0 and \'cde\' and false and "fhi" from tb;')
##operator: or ##operator: or
...@@ -1051,26 +1051,26 @@ class TDTestCase: ...@@ -1051,26 +1051,26 @@ class TDTestCase:
tdSql.checkRows(1) tdSql.checkRows(1)
tdSql.checkData(0, 0, 1) tdSql.checkData(0, 0, 1)
tdSql.error('select "abc" or "def"') tdSql.error('select "abc" or "def" from tb;')
tdSql.error('select "abc" or 1') tdSql.error('select "abc" or 1 from tb;')
tdSql.error('select 1 or "abc"') tdSql.error('select 1 or "abc" from tb;')
tdSql.error('select "abc" or 1.0') tdSql.error('select "abc" or 1.0 from tb;')
tdSql.error('select 1.0 or abc') tdSql.error('select 1.0 or abc from tb;')
tdSql.error('select "abc" or true') tdSql.error('select "abc" or true from tb;')
tdSql.error('select false or "abc"') tdSql.error('select false or "abc" from tb;')
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 true or false or 0 from tb;')
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 0 from tb;')
tdSql.error('select 1 or "abc" or 1.0 or "cde" or false or "fhi"') tdSql.error('select 1 or "abc" or 1.0 or "cde" or false or "fhi" from tb;')
tdSql.error('select \'abc\' or \'def\'') tdSql.error('select \'abc\' or \'def\' from tb;')
tdSql.error('select \'abc\' or 1') tdSql.error('select \'abc\' or 1 from tb;')
tdSql.error('select 1 or \'abc\'') tdSql.error('select 1 or \'abc\' from tb;')
tdSql.error('select \'abc\' or 1.0') tdSql.error('select \'abc\' or 1.0 from tb;')
tdSql.error('select 1.0 or abc') tdSql.error('select 1.0 or abc from tb;')
tdSql.error('select \'abc\' or true') tdSql.error('select \'abc\' or true from tb;')
tdSql.error('select false or \'abc\'') tdSql.error('select false or \'abc\' from tb;')
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 true or false or 0 from tb;')
tdSql.error('select 1 or \'abc\' or 1.0 or \'cde\' or false or "fhi"') tdSql.error('select 1 or \'abc\' or 1.0 or \'cde\' or false or "fhi" from tb;')
##operator: multiple operations ##operator: multiple operations
tdSql.query('select 1 and 1 != 2 and 1 < 2 and 2 between 1 and 3 from tb;') tdSql.query('select 1 and 1 != 2 and 1 < 2 and 2 between 1 and 3 from tb;')
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册