test: error message when execute DDL under system databases

This commit is contained in:
Haolin Wang 2025-01-07 12:34:24 +08:00
parent 04dbca44ab
commit da76034eb9
2 changed files with 44 additions and 0 deletions

View File

@ -490,6 +490,7 @@
,,y,system-test,./pytest.sh python3 ./test.py -f 1-insert/test_td29793.py
,,y,system-test,./pytest.sh python3 ./test.py -f 1-insert/insert_timestamp.py
,,y,system-test,./pytest.sh python3 ./test.py -f 1-insert/test_td29157.py
,,y,system-test,./pytest.sh python3 ./test.py -f 1-insert/ddl_in_sysdb.py
,,y,system-test,./pytest.sh python3 ./test.py -f 0-others/show.py
,,y,system-test,./pytest.sh python3 ./test.py -f 0-others/show_tag_index.py
,,y,system-test,./pytest.sh python3 ./test.py -f 0-others/information_schema.py

View File

@ -0,0 +1,43 @@
import taos
import sys
import datetime
import inspect
import random
from util.dnodes import TDDnode
from util.dnodes import tdDnodes
from util.log import *
from util.sql import *
from util.cases import *
class TDTestCase:
def init(self, conn, logSql, replicaVar=1):
self.replicaVar = int(replicaVar)
tdLog.debug(f"start to excute {__file__}")
tdSql.init(conn.cursor(), True)
self.testcasePath = os.path.split(__file__)[0]
self.testcasePath = self.testcasePath.replace('\\', '//')
self.sysdb = "information_schema"
def test_ddl(self):
tdSql.execute(f"use {self.sysdb}")
tdSql.error(f'create stable ins_test (ts timestamp, a int) tags (b int);', expectErrInfo="Cannot create table of system database", fullMatched=False)
tdSql.error(f'create table ins_test (ts timestamp, a int);', expectErrInfo="Cannot create table of system database", fullMatched=False)
tdSql.error(f'drop table ins_users;', expectErrInfo="Cannot drop table of system database", fullMatched=False)
def run(self):
tdSql.prepare()
startTime_all = time.time()
self.test_ddl()
endTime_all = time.time()
print("total time %ds" % (endTime_all - startTime_all))
def stop(self):
tdSql.close()
tdLog.success("%s successfully executed" % __file__)
tdCases.addWindows(__file__, TDTestCase())
tdCases.addLinux(__file__, TDTestCase())