From 7bcf6b051a315be81be864200f721d67096d310a Mon Sep 17 00:00:00 2001 From: Xiaoyu Wang Date: Mon, 1 Aug 2022 16:17:59 +0800 Subject: [PATCH] fix: some problems of parser and planner --- source/libs/parser/src/parAstParser.c | 5 ++++- tests/script/tsim/insert/basic2.sim | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/source/libs/parser/src/parAstParser.c b/source/libs/parser/src/parAstParser.c index cb304dee9e..2d4e29a553 100644 --- a/source/libs/parser/src/parAstParser.c +++ b/source/libs/parser/src/parAstParser.c @@ -244,7 +244,10 @@ static int32_t collectMetaKeyFromDropTable(SCollectMetaKeyCxt* pCxt, SDropTableS } static int32_t collectMetaKeyFromAlterTable(SCollectMetaKeyCxt* pCxt, SAlterTableStmt* pStmt) { - int32_t code = reserveTableMetaInCache(pCxt->pParseCxt->acctId, pStmt->dbName, pStmt->tableName, pCxt->pMetaCache); + int32_t code = reserveDbCfgInCache(pCxt->pParseCxt->acctId, pStmt->dbName, pCxt->pMetaCache); + if (TSDB_CODE_SUCCESS == code) { + code = reserveTableMetaInCache(pCxt->pParseCxt->acctId, pStmt->dbName, pStmt->tableName, pCxt->pMetaCache); + } if (TSDB_CODE_SUCCESS == code) { code = reserveTableVgroupInCache(pCxt->pParseCxt->acctId, pStmt->dbName, pStmt->tableName, pCxt->pMetaCache); } diff --git a/tests/script/tsim/insert/basic2.sim b/tests/script/tsim/insert/basic2.sim index 0bd64b1d02..eca46697f5 100644 --- a/tests/script/tsim/insert/basic2.sim +++ b/tests/script/tsim/insert/basic2.sim @@ -26,8 +26,8 @@ endi print =============== step3-1 insert records into ct1 sql insert into ct1 values('2022-05-03 16:59:00.010', 10, 20, 'n','n',30); -sql insert into ct1 values('2022-05-03 16:59:00.011', 'N', 'n', 'N',"N",30); -sql insert into ct1 values('2022-05-03 16:59:00.012', 'Nu', 'nul', 'Nul','NUL',30); +sql insert into ct1 values('2022-05-03 16:59:00.011', 'null', 'null', 'N',"N",30); +sql insert into ct1 values('2022-05-03 16:59:00.012', 'null', 'null', 'Nul','NUL',30); sql insert into ct1 values('2022-05-03 16:59:00.013', NULL, 'null', 'Null',null,30); sql insert into ct1 values('2022-05-03 16:59:00.014', NULL, 'NuLL', 'Null',NULL,30);