diff --git a/source/libs/parser/src/parAstParser.c b/source/libs/parser/src/parAstParser.c index 68c9684c97ac8eba986a339b7618e51bc02d7d79..18c1341da86bb2306cc6cb2e5b1036e9bbba7a8e 100644 --- a/source/libs/parser/src/parAstParser.c +++ b/source/libs/parser/src/parAstParser.c @@ -124,6 +124,10 @@ static EDealRes collectMetaKeyFromRealTable(SCollectMetaKeyFromExprCxt* pCxt, SR pCxt->errCode = reserveUserAuthInCache(pCxt->pComCxt->pParseCxt->acctId, pCxt->pComCxt->pParseCxt->pUser, pRealTable->table.dbName, AUTH_TYPE_READ, pCxt->pComCxt->pMetaCache); } + if (TSDB_CODE_SUCCESS == pCxt->errCode) { + pCxt->errCode = + reserveDbVgInfoInCache(pCxt->pComCxt->pParseCxt->acctId, pRealTable->table.dbName, pCxt->pComCxt->pMetaCache); + } return TSDB_CODE_SUCCESS == pCxt->errCode ? DEAL_RES_CONTINUE : DEAL_RES_ERROR; } diff --git a/source/libs/parser/test/parSelectTest.cpp b/source/libs/parser/test/parSelectTest.cpp index a5192595f0be83afa459429748dab3d8e9b65c4e..e61b060682679d526d47fe8b607573b68b45cb38 100644 --- a/source/libs/parser/test/parSelectTest.cpp +++ b/source/libs/parser/test/parSelectTest.cpp @@ -33,6 +33,8 @@ TEST_F(ParserSelectTest, basic) { run("SELECT ts, t.c1 FROM (SELECT * FROM t1) t"); run("SELECT * FROM t1 tt1, t1 tt2 WHERE tt1.c1 = tt2.c1"); + + run("SELECT * FROM st1"); } TEST_F(ParserSelectTest, constant) {