提交 06bb551b 编写于 作者: X Xiaoyu Wang

enh: query information_schema.ins_tags optimize

上级 48c93736
...@@ -407,6 +407,10 @@ static int32_t collectMetaKeyFromShowTags(SCollectMetaKeyCxt* pCxt, SShowStmt* p ...@@ -407,6 +407,10 @@ static int32_t collectMetaKeyFromShowTags(SCollectMetaKeyCxt* pCxt, SShowStmt* p
if (TSDB_CODE_SUCCESS == code) { if (TSDB_CODE_SUCCESS == code) {
code = reserveDbVgInfoInCache(pCxt->pParseCxt->acctId, ((SValueNode*)pStmt->pDbName)->literal, pCxt->pMetaCache); code = reserveDbVgInfoInCache(pCxt->pParseCxt->acctId, ((SValueNode*)pStmt->pDbName)->literal, pCxt->pMetaCache);
} }
if (TSDB_CODE_SUCCESS == code && NULL != pStmt->pTbName) {
code = reserveTableVgroupInCache(pCxt->pParseCxt->acctId, ((SValueNode*)pStmt->pDbName)->literal,
((SValueNode*)pStmt->pTbName)->literal, pCxt->pMetaCache);
}
return code; return code;
} }
......
...@@ -2143,7 +2143,7 @@ static bool sysTableFromDnode(const char* pTable) { return 0 == strcmp(pTable, T ...@@ -2143,7 +2143,7 @@ static bool sysTableFromDnode(const char* pTable) { return 0 == strcmp(pTable, T
static int32_t getTagsTableVgroupListImpl(STranslateContext* pCxt, SName* pTargetName, SName* pName, static int32_t getTagsTableVgroupListImpl(STranslateContext* pCxt, SName* pTargetName, SName* pName,
SArray** pVgroupList) { SArray** pVgroupList) {
if (0 == pTargetName->acctId) { if (0 == pTargetName->type) {
return getDBVgInfoImpl(pCxt, pName, pVgroupList); return getDBVgInfoImpl(pCxt, pName, pVgroupList);
} }
...@@ -2208,6 +2208,9 @@ static int32_t getTagsTableTargetNameFromCond(STranslateContext* pCxt, SLogicCon ...@@ -2208,6 +2208,9 @@ static int32_t getTagsTableTargetNameFromCond(STranslateContext* pCxt, SLogicCon
SNode* pNode = NULL; SNode* pNode = NULL;
FOREACH(pNode, pCond->pParameterList) { getTagsTableTargetObjName(pCxt, pNode, pName); } FOREACH(pNode, pCond->pParameterList) { getTagsTableTargetObjName(pCxt, pNode, pName); }
if ('\0' == pName->dbname[0]) {
pName->type = 0;
}
return TSDB_CODE_SUCCESS; return TSDB_CODE_SUCCESS;
} }
......
...@@ -196,6 +196,12 @@ TEST_F(ParserShowToUseTest, showTableDistributed) { ...@@ -196,6 +196,12 @@ TEST_F(ParserShowToUseTest, showTableDistributed) {
run("SHOW TABLE DISTRIBUTED st1"); run("SHOW TABLE DISTRIBUTED st1");
} }
TEST_F(ParserShowToUseTest, showTags) {
useDb("root", "test");
run("SHOW TAGS FROM st1s1");
}
// todo SHOW topics // todo SHOW topics
TEST_F(ParserShowToUseTest, showUsers) { TEST_F(ParserShowToUseTest, showUsers) {
...@@ -213,9 +219,9 @@ TEST_F(ParserShowToUseTest, showVariables) { ...@@ -213,9 +219,9 @@ TEST_F(ParserShowToUseTest, showVariables) {
TEST_F(ParserShowToUseTest, showVgroups) { TEST_F(ParserShowToUseTest, showVgroups) {
useDb("root", "test"); useDb("root", "test");
run("SHOW vgroups"); run("SHOW VGROUPS");
run("SHOW test.vgroups"); run("SHOW test.VGROUPS");
} }
TEST_F(ParserShowToUseTest, showVnodes) { TEST_F(ParserShowToUseTest, showVnodes) {
......
...@@ -86,6 +86,7 @@ static void parseArg(int argc, char* argv[]) { ...@@ -86,6 +86,7 @@ static void parseArg(int argc, char* argv[]) {
{"dump", no_argument, NULL, 'd'}, {"dump", no_argument, NULL, 'd'},
{"async", required_argument, NULL, 'a'}, {"async", required_argument, NULL, 'a'},
{"skipSql", required_argument, NULL, 's'}, {"skipSql", required_argument, NULL, 's'},
{"log", required_argument, NULL, 'l'},
{0, 0, 0, 0} {0, 0, 0, 0}
}; };
// clang-format on // clang-format on
...@@ -100,6 +101,9 @@ static void parseArg(int argc, char* argv[]) { ...@@ -100,6 +101,9 @@ static void parseArg(int argc, char* argv[]) {
case 's': case 's':
setSkipSqlNum(optarg); setSkipSqlNum(optarg);
break; break;
case 'l':
setLogLevel(optarg);
break;
default: default:
break; break;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册