未验证 提交 b467bad4 编写于 作者: H Hui Li 提交者: GitHub

Merge pull request #17568 from taosdata/test/td-19625

test: add cachemodel for last
...@@ -17,6 +17,7 @@ class TDTestCase: ...@@ -17,6 +17,7 @@ class TDTestCase:
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: ...@@ -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: ...@@ -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: ...@@ -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,6 +247,8 @@ class TDTestCase: ...@@ -244,6 +247,8 @@ class TDTestCase:
tdSql.execute(f'drop database {dbname}') tdSql.execute(f'drop database {dbname}')
def run(self): def run(self):
for cachemodel in ["None", "last_row", "last_value", "both"]:
self.cachemodel = cachemodel
self.last_check_stb_tb_base() self.last_check_stb_tb_base()
self.last_check_ntb_base() self.last_check_ntb_base()
self.last_check_stb_distribute() self.last_check_stb_distribute()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册