This commit is contained in:
cpwu 2022-04-21 15:30:05 +08:00
parent c4d80dd596
commit 61ef5c7d88
1 changed files with 4 additions and 4 deletions

View File

@ -580,21 +580,21 @@ class TDTestCase:
tdSql.query("select cast(c10 as nchar(32)) as b from ct4") tdSql.query("select cast(c10 as nchar(32)) as b from ct4")
for i in range(len(data_ct4_c10)): for i in range(len(data_ct4_c10)):
time2str = str(int(datetime.datetime.timestamp(datetime.datetime.strptime(data_ct4_c10[i],'%Y-%m-%d %H:%M:%S.%f'))*1000)) time2str = str(int(datetime.datetime.timestamp(datetime.datetime.strptime(data_ct4_c10[i],'%Y-%m-%d %H:%M:%S.%f'))*1000))
tdSql.checkData( i, 0, time2str ) tdSql.checkData( i, 0, None ) if data_ct4_c10[i] is None else tdSql.checkData( i, 0, time2str )
tdSql.query("select cast(c10 as nchar(32)) as b from t1") tdSql.query("select cast(c10 as nchar(32)) as b from t1")
for i in range(len(data_t1_c10)): for i in range(len(data_t1_c10)):
time2str = str(int(datetime.datetime.timestamp(datetime.datetime.strptime(data_t1_c10[i],'%Y-%m-%d %H:%M:%S.%f'))*1000)) time2str = str(int(datetime.datetime.timestamp(datetime.datetime.strptime(data_t1_c10[i],'%Y-%m-%d %H:%M:%S.%f'))*1000))
tdSql.checkData( i, 0, time2str ) tdSql.checkData( i, 0, None ) if data_t1_c10[i] is None else tdSql.checkData( i, 0, time2str )
tdLog.printNoPrefix("==========step38: cast timestamp to binary, expect no changes ") tdLog.printNoPrefix("==========step38: cast timestamp to binary, expect no changes ")
tdSql.query("select cast(c10 as binary(32)) as b from ct4") tdSql.query("select cast(c10 as binary(32)) as b from ct4")
for i in range(len(data_ct4_c10)): for i in range(len(data_ct4_c10)):
time2str = str(int(datetime.datetime.timestamp(datetime.datetime.strptime(data_ct4_c10[i],'%Y-%m-%d %H:%M:%S.%f'))*1000)) time2str = str(int(datetime.datetime.timestamp(datetime.datetime.strptime(data_ct4_c10[i],'%Y-%m-%d %H:%M:%S.%f'))*1000))
tdSql.checkData( i, 0, time2str ) tdSql.checkData( i, 0, None ) if data_ct4_c10[i] is None else tdSql.checkData( i, 0, time2str )
tdSql.query("select cast(c10 as binary(32)) as b from t1") tdSql.query("select cast(c10 as binary(32)) as b from t1")
for i in range(len(data_t1_c10)): for i in range(len(data_t1_c10)):
time2str = str(int(datetime.datetime.timestamp(datetime.datetime.strptime(data_t1_c10[i],'%Y-%m-%d %H:%M:%S.%f'))*1000)) time2str = str(int(datetime.datetime.timestamp(datetime.datetime.strptime(data_t1_c10[i],'%Y-%m-%d %H:%M:%S.%f'))*1000))
tdSql.checkData( i, 0, time2str ) tdSql.checkData( i, 0, None ) if data_t1_c10[i] is None else tdSql.checkData( i, 0, time2str )
tdSql.error("select cast(c1 as int) as b from ct4") tdSql.error("select cast(c1 as int) as b from ct4")