Merge pull request #22937 from taosdata/case/TS-3895-MAIN

case: add keepColumnName option case
This commit is contained in:
Alex Duan 2023-09-16 13:40:04 +08:00 committed by GitHub
commit 554b943727
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 22 additions and 0 deletions

View File

@ -210,6 +210,27 @@ class TDTestCase:
licences_info = tdSql.queryResult
tdSql.checkEqual(grants_info,licences_info)
def show_column_name(self):
tdSql.execute("create database db;")
tdSql.execute("use db;")
tdSql.execute("create table ta(ts timestamp, name nchar(16), age int , address int);")
tdSql.execute("insert into ta values(now, 'jack', 19, 23);")
colName1 = ["ts","name","age","address"]
colName2 = tdSql.getColNameList("select last(*) from ta;")
for i in range(len(colName1)):
if colName2[i] != f"last({colName1[i]})":
tdLog.exit(f"column name is different. {colName2} != last({colName1[i]} ")
return
# alter option
tdSql.execute("alter local 'keepColumnName' '1';")
colName3 = tdSql.getColNameList("select last(*) from ta;")
for col in colName3:
if colName1 != colName3:
tdLog.exit(f"column name is different. colName1= {colName1} colName2={colName3}")
return
def run(self):
self.check_gitinfo()
self.show_base()
@ -218,6 +239,7 @@ class TDTestCase:
self.show_create_sql()
self.show_create_sysdb_sql()
self.show_create_systb_sql()
self.show_column_name()
def stop(self):
tdSql.close()