fix case
This commit is contained in:
parent
a08fdbb42f
commit
aab9c55db4
|
@ -20,7 +20,7 @@ class TDTestCase:
|
|||
__sql = f"select cast({col_name} as bigint), {col_name} from {tbname}"
|
||||
tdSql.query(sql=__sql)
|
||||
data_tb_col = [result[1] for result in tdSql.queryResult]
|
||||
for i in range(len(tdSql.queryRows)):
|
||||
for i in range(tdSql.queryRows):
|
||||
tdSql.checkData( i, 0, None ) if data_tb_col[i] is None else tdSql.checkData( i, 0, int(data_tb_col[i]) )
|
||||
|
||||
def __range_to_bigint(self,cols,tables):
|
||||
|
@ -32,7 +32,7 @@ class TDTestCase:
|
|||
__sql = f"select cast({col_name} as timestamp), {col_name} from {tbname}"
|
||||
tdSql.query(sql=__sql)
|
||||
data_tb_col = [result[1] for result in tdSql.queryResult]
|
||||
for i in range(len(tdSql.queryRows)):
|
||||
for i in range(tdSql.queryRows):
|
||||
if data_tb_col[i] is None:
|
||||
tdSql.checkData( i, 0 , None )
|
||||
if col_name not in ["c2", "double"] or tbname != "t1" or i != 10:
|
||||
|
@ -597,37 +597,37 @@ class TDTestCase:
|
|||
|
||||
tdLog.printNoPrefix("==========step39: cast constant operation to bigint, expect change to int ")
|
||||
tdSql.query("select cast(12121.23323131 as bigint) as b from ct4")
|
||||
( tdSql.checkData(i, 0, 12121) for i in range(len(tdSql.queryRows) ) )
|
||||
( tdSql.checkData(i, 0, 12121) for i in range(tdSql.queryRows) )
|
||||
tdSql.query("select cast(12121.23323131 as binary(16)) as b from ct4")
|
||||
( tdSql.checkData(i, 0, '12121.233231') for i in range(len(tdSql.queryRows)) )
|
||||
( tdSql.checkData(i, 0, '12121.233231') for i in range(tdSql.queryRows) )
|
||||
tdSql.query("select cast(12121.23323131 as binary(2)) as b from ct4")
|
||||
( tdSql.checkData(i, 0, '12') for i in range(len(tdSql.queryRows) ) )
|
||||
( tdSql.checkData(i, 0, '12') for i in range(tdSql.queryRows) )
|
||||
tdSql.query("select cast(12121.23323131 as nchar(16)) as b from ct4")
|
||||
( tdSql.checkData(i, 0, '12121.233231') for i in range(len(tdSql.queryRows) ) )
|
||||
( tdSql.checkData(i, 0, '12121.233231') for i in range(tdSql.queryRows) )
|
||||
tdSql.query("select cast(12121.23323131 as nchar(2)) as b from ct4")
|
||||
( tdSql.checkData(i, 0, '12') for i in range(len(tdSql.queryRows) ) )
|
||||
( tdSql.checkData(i, 0, '12') for i in range(tdSql.queryRows) )
|
||||
|
||||
tdSql.query("select cast(12121.23323131 + 321.876897998 as bigint) as b from ct4")
|
||||
( tdSql.checkData(i, 0, 12443) for i in range(len(tdSql.queryRows) ) )
|
||||
( tdSql.checkData(i, 0, 12443) for i in range(tdSql.queryRows) )
|
||||
tdSql.query("select cast(12121.23323131 + 321.876897998 as binary(16)) as b from ct4")
|
||||
( tdSql.checkData(i, 0, '12443.110129') for i in range(len(tdSql.queryRows)) )
|
||||
( tdSql.checkData(i, 0, '12443.110129') for i in range(tdSql.queryRows) )
|
||||
tdSql.query("select cast(12121.23323131 + 321.876897998 as binary(3)) as b from ct4")
|
||||
( tdSql.checkData(i, 0, '124') for i in range(len(tdSql.queryRows) ) )
|
||||
( tdSql.checkData(i, 0, '124') for i in range(tdSql.queryRows) )
|
||||
tdSql.query("select cast(12121.23323131 + 321.876897998 as nchar(16)) as b from ct4")
|
||||
( tdSql.checkData(i, 0, '12443.110129') for i in range(len(tdSql.queryRows)) )
|
||||
( tdSql.checkData(i, 0, '12443.110129') for i in range(tdSql.queryRows) )
|
||||
tdSql.query("select cast(12121.23323131 + 321.876897998 as nchar(3)) as b from ct4")
|
||||
( tdSql.checkData(i, 0, '124') for i in range(len(tdSql.queryRows) ) )
|
||||
( tdSql.checkData(i, 0, '124') for i in range(tdSql.queryRows) )
|
||||
|
||||
tdSql.query("select cast(12121.23323131 + 'test~!@`#$%^&*()}{][;><.,' as bigint) as b from ct4")
|
||||
( tdSql.checkData(i, 0, 12121) for i in range(len(tdSql.queryRows) ) )
|
||||
( tdSql.checkData(i, 0, 12121) for i in range(tdSql.queryRows) )
|
||||
tdSql.query("select cast(12121.23323131 + 'test~!@`#$%^&*()}{][;><.,' as binary(16)) as b from ct4")
|
||||
( tdSql.checkData(i, 0, '12121.233231') for i in range(len(tdSql.queryRows)) )
|
||||
( tdSql.checkData(i, 0, '12121.233231') for i in range(tdSql.queryRows) )
|
||||
tdSql.query("select cast(12121.23323131 + 'test~!@`#$%^&*()}{][;><.,' as binary(2)) as b from ct4")
|
||||
( tdSql.checkData(i, 0, '12') for i in range(len(tdSql.queryRows) ) )
|
||||
( tdSql.checkData(i, 0, '12') for i in range(tdSql.queryRows) )
|
||||
tdSql.query("select cast(12121.23323131 + 'test~!@`#$%^&*()}{][;><.,' as nchar(16)) as b from ct4")
|
||||
( tdSql.checkData(i, 0, '12121.233231') for i in range(len(tdSql.queryRows) ) )
|
||||
( tdSql.checkData(i, 0, '12121.233231') for i in range(tdSql.queryRows) )
|
||||
tdSql.query("select cast(12121.23323131 + 'test~!@`#$%^&*()}{][;><.,' as nchar(2)) as b from ct4")
|
||||
( tdSql.checkData(i, 0, '12') for i in range(len(tdSql.queryRows) ) )
|
||||
( tdSql.checkData(i, 0, '12') for i in range(tdSql.queryRows) )
|
||||
|
||||
tdLog.printNoPrefix("==========step40: error cast condition, should return error ")
|
||||
tdSql.error("select cast(c1 as int) as b from ct4")
|
||||
|
|
|
@ -232,13 +232,13 @@ class TDTestCase:
|
|||
tdLog.printNoPrefix("==========step3:all check")
|
||||
self.all_test()
|
||||
|
||||
# tdDnodes.stop(1)
|
||||
# tdDnodes.start(1)
|
||||
tdDnodes.stop(1)
|
||||
tdDnodes.start(1)
|
||||
|
||||
# tdSql.execute("use db")
|
||||
tdSql.execute("use db")
|
||||
|
||||
# tdLog.printNoPrefix("==========step4:after wal, all check again ")
|
||||
# self.all_test()
|
||||
tdLog.printNoPrefix("==========step4:after wal, all check again ")
|
||||
self.all_test()
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
|
|
|
@ -14,6 +14,9 @@ python3 ./test.py -f 2-query/varchar.py
|
|||
python3 ./test.py -f 2-query/ltrim.py
|
||||
python3 ./test.py -f 2-query/rtrim.py
|
||||
python3 ./test.py -f 2-query/length.py
|
||||
python3 ./test.py -f 2-query/char_length.py
|
||||
python3 ./test.py -f 2-query/upper.py
|
||||
python3 ./test.py -f 2-query/lower.py
|
||||
|
||||
python3 ./test.py -f 2-query/timezone.py
|
||||
python3 ./test.py -f 2-query/Now.py
|
||||
|
|
Loading…
Reference in New Issue