enh: support drop table with uid

This commit is contained in:
kailixu 2024-09-19 16:47:08 +08:00
parent 33047e7d7f
commit cac1ce28ad
2 changed files with 8 additions and 12 deletions

View File

@ -377,7 +377,6 @@ static int32_t collectMetaKeyFromCreateSubTableFromFile(SCollectMetaKeyCxt*
static int32_t collectMetaKeyFromDropTable(SCollectMetaKeyCxt* pCxt, SDropTableStmt* pStmt) { static int32_t collectMetaKeyFromDropTable(SCollectMetaKeyCxt* pCxt, SDropTableStmt* pStmt) {
int32_t code = TSDB_CODE_SUCCESS; int32_t code = TSDB_CODE_SUCCESS;
SNode* pNode = NULL; SNode* pNode = NULL;
// char tableName[50] = "aa\u00bf\u200bstb0";
FOREACH(pNode, pStmt->pTables) { FOREACH(pNode, pStmt->pTables) {
SDropTableClause* pClause = (SDropTableClause*)pNode; SDropTableClause* pClause = (SDropTableClause*)pNode;
if (pStmt->withOpt) { if (pStmt->withOpt) {
@ -409,18 +408,8 @@ static int32_t collectMetaKeyFromDropTable(SCollectMetaKeyCxt* pCxt, SDropTableS
} }
static int32_t collectMetaKeyFromDropStable(SCollectMetaKeyCxt* pCxt, SDropSuperTableStmt* pStmt) { static int32_t collectMetaKeyFromDropStable(SCollectMetaKeyCxt* pCxt, SDropSuperTableStmt* pStmt) {
int32_t code = TSDB_CODE_SUCCESS;
if (pStmt->withOpt) { if (pStmt->withOpt) {
code = reserveTableUidInCache(pCxt->pParseCxt->acctId, pStmt->dbName, pStmt->tableName, pCxt->pMetaCache); return reserveTableUidInCache(pCxt->pParseCxt->acctId, pStmt->dbName, pStmt->tableName, pCxt->pMetaCache);
#if 0
if (TSDB_CODE_SUCCESS == code) {
code = reserveDbVgInfoInCache(pCxt->pParseCxt->acctId, pStmt->dbName, pCxt->pMetaCache);
}
if (TSDB_CODE_SUCCESS == code) {
code = reserveDbCfgInCache(pCxt->pParseCxt->acctId, pStmt->dbName, pCxt->pMetaCache);
}
#endif
return code;
} }
return reserveUserAuthInCache(pCxt->pParseCxt->acctId, pCxt->pParseCxt->pUser, pStmt->dbName, pStmt->tableName, return reserveUserAuthInCache(pCxt->pParseCxt->acctId, pCxt->pParseCxt->pUser, pStmt->dbName, pStmt->tableName,
AUTH_TYPE_WRITE, pCxt->pMetaCache); AUTH_TYPE_WRITE, pCxt->pMetaCache);

View File

@ -116,6 +116,12 @@ class TDTestCase:
tdSql.query(f'select * from {stbname} where {k} = {self.ts}') tdSql.query(f'select * from {stbname} where {k} = {self.ts}')
tdSql.checkRows(self.tbnum) tdSql.checkRows(self.tbnum)
tdSql.execute(f'drop database {self.dbname}') tdSql.execute(f'drop database {self.dbname}')
def drop_table_with_check(self):
stb_names = [ f'stb0', f'aa\u00bf\u200bstb0']
ctb_names = [ f'ctb0', f'aa\u00bf\u200bctb0']
ntb_names = [ f'ntb0', f'aa\u00bf\u200bntb0']
tdSql.execute(f'create database {self.dbname} replica {self.replicaVar} wal_retention_period 3600')
tdSql.execute(f'drop database {self.dbname}')
def drop_topic_check(self): def drop_topic_check(self):
tdSql.execute(f'create database {self.dbname} replica {self.replicaVar} wal_retention_period 3600') tdSql.execute(f'create database {self.dbname} replica {self.replicaVar} wal_retention_period 3600')
tdSql.execute(f'use {self.dbname}') tdSql.execute(f'use {self.dbname}')
@ -161,6 +167,7 @@ class TDTestCase:
def run(self): def run(self):
self.drop_ntb_check() self.drop_ntb_check()
self.drop_stb_ctb_check() self.drop_stb_ctb_check()
self.drop_table_with_check()
self.drop_topic_check() self.drop_topic_check()
if platform.system().lower() == 'windows': if platform.system().lower() == 'windows':
self.drop_stream_check() self.drop_stream_check()