test: add cachemodel for last
This commit is contained in:
parent
808ae09451
commit
8d757bb2c3
|
@ -10,13 +10,14 @@ import numpy as np
|
||||||
class TDTestCase:
|
class TDTestCase:
|
||||||
def init(self, conn, logSql):
|
def init(self, conn, logSql):
|
||||||
tdLog.debug("start to execute %s" % __file__)
|
tdLog.debug("start to execute %s" % __file__)
|
||||||
tdSql.init(conn.cursor())
|
tdSql.init(conn.cursor(), log=True)
|
||||||
|
|
||||||
self.rowNum = 10
|
self.rowNum = 10
|
||||||
self.tbnum = 20
|
self.tbnum = 20
|
||||||
self.ts = 1537146000000
|
self.ts = 1537146000000
|
||||||
self.binary_str = 'taosdata'
|
self.binary_str = 'taosdata'
|
||||||
self.nchar_str = '涛思数据'
|
self.nchar_str = '涛思数据'
|
||||||
|
self.cachemodel = None
|
||||||
|
|
||||||
def set_create_normaltable_sql(self, ntbname, column_dict):
|
def set_create_normaltable_sql(self, ntbname, column_dict):
|
||||||
column_sql = ''
|
column_sql = ''
|
||||||
|
@ -36,7 +37,8 @@ class TDTestCase:
|
||||||
return create_stb_sql
|
return create_stb_sql
|
||||||
|
|
||||||
def last_check_stb_tb_base(self):
|
def last_check_stb_tb_base(self):
|
||||||
tdSql.prepare()
|
tdSql.execute(
|
||||||
|
f'create database if not exists db cachemodel "{self.cachemodel}"')
|
||||||
stbname = f'db.{tdCom.getLongName(5, "letters")}'
|
stbname = f'db.{tdCom.getLongName(5, "letters")}'
|
||||||
column_dict = {
|
column_dict = {
|
||||||
'col1': 'tinyint',
|
'col1': 'tinyint',
|
||||||
|
@ -112,7 +114,8 @@ class TDTestCase:
|
||||||
tdSql.execute('drop database db')
|
tdSql.execute('drop database db')
|
||||||
|
|
||||||
def last_check_ntb_base(self):
|
def last_check_ntb_base(self):
|
||||||
tdSql.prepare()
|
tdSql.execute(
|
||||||
|
f'create database if not exists db cachemodel "{self.cachemodel}"')
|
||||||
ntbname = f'db.{tdCom.getLongName(5, "letters")}'
|
ntbname = f'db.{tdCom.getLongName(5, "letters")}'
|
||||||
column_dict = {
|
column_dict = {
|
||||||
'col1': 'tinyint',
|
'col1': 'tinyint',
|
||||||
|
@ -191,7 +194,7 @@ class TDTestCase:
|
||||||
}
|
}
|
||||||
|
|
||||||
tdSql.execute(
|
tdSql.execute(
|
||||||
f"create database if not exists {dbname} vgroups {vgroup_num}")
|
f'create database if not exists {dbname} vgroups {vgroup_num} cachemodel "{self.cachemodel}"')
|
||||||
tdSql.execute(f'use {dbname}')
|
tdSql.execute(f'use {dbname}')
|
||||||
|
|
||||||
# build 20 child tables,every table insert 10 rows
|
# build 20 child tables,every table insert 10 rows
|
||||||
|
@ -244,9 +247,11 @@ class TDTestCase:
|
||||||
tdSql.execute(f'drop database {dbname}')
|
tdSql.execute(f'drop database {dbname}')
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
self.last_check_stb_tb_base()
|
for cachemodel in ["None", "last_row", "last_value", "both"]:
|
||||||
self.last_check_ntb_base()
|
self.cachemodel = cachemodel
|
||||||
self.last_check_stb_distribute()
|
self.last_check_stb_tb_base()
|
||||||
|
self.last_check_ntb_base()
|
||||||
|
self.last_check_stb_distribute()
|
||||||
|
|
||||||
def stop(self):
|
def stop(self):
|
||||||
tdSql.close()
|
tdSql.close()
|
||||||
|
|
Loading…
Reference in New Issue