From 6c6259c51b8b398f6868cc90e3aee049cf668698 Mon Sep 17 00:00:00 2001 From: Xiaoyu Wang Date: Tue, 7 Jun 2022 09:27:27 +0800 Subject: [PATCH] fix: a problem of parser async --- source/libs/parser/src/parAstParser.c | 6 ++++++ source/libs/parser/test/parInitialATest.cpp | 2 ++ 2 files changed, 8 insertions(+) diff --git a/source/libs/parser/src/parAstParser.c b/source/libs/parser/src/parAstParser.c index c79820a950..e6a905103a 100644 --- a/source/libs/parser/src/parAstParser.c +++ b/source/libs/parser/src/parAstParser.c @@ -179,6 +179,10 @@ static int32_t collectMetaKeyFromSelect(SCollectMetaKeyCxt* pCxt, SSelectStmt* p return cxt.errCode; } +static int32_t collectMetaKeyFromAlterDatabase(SCollectMetaKeyCxt* pCxt, SAlterDatabaseStmt* pStmt) { + return reserveDbCfgInCache(pCxt->pParseCxt->acctId, pStmt->dbName, pCxt->pMetaCache); +} + static int32_t collectMetaKeyFromCreateTable(SCollectMetaKeyCxt* pCxt, SCreateTableStmt* pStmt) { int32_t code = reserveDbCfgInCache(pCxt->pParseCxt->acctId, pStmt->dbName, pCxt->pMetaCache); if (TSDB_CODE_SUCCESS == code && NULL == pStmt->pTags) { @@ -376,6 +380,8 @@ static int32_t collectMetaKeyFromQuery(SCollectMetaKeyCxt* pCxt, SNode* pStmt) { return collectMetaKeyFromSetOperator(pCxt, (SSetOperator*)pStmt); case QUERY_NODE_SELECT_STMT: return collectMetaKeyFromSelect(pCxt, (SSelectStmt*)pStmt); + case QUERY_NODE_ALTER_DATABASE_STMT: + return collectMetaKeyFromAlterDatabase(pCxt, (SAlterDatabaseStmt*)pStmt); case QUERY_NODE_CREATE_TABLE_STMT: return collectMetaKeyFromCreateTable(pCxt, (SCreateTableStmt*)pStmt); case QUERY_NODE_CREATE_MULTI_TABLE_STMT: diff --git a/source/libs/parser/test/parInitialATest.cpp b/source/libs/parser/test/parInitialATest.cpp index 784586dfb2..595aa049fd 100644 --- a/source/libs/parser/test/parInitialATest.cpp +++ b/source/libs/parser/test/parInitialATest.cpp @@ -39,6 +39,8 @@ TEST_F(ParserInitialATest, alterDatabase) { useDb("root", "test"); run("ALTER DATABASE wxy_db CACHELAST 1 FSYNC 200 WAL 1"); + + run("ALTER DATABASE wxy_db KEEP 2400"); } // todo ALTER local -- GitLab