fix: error msg of show tags from ntb/view
This commit is contained in:
parent
0ae8926e69
commit
ba8d44e49c
|
@ -11875,11 +11875,18 @@ static int32_t checkShowTags(STranslateContext* pCxt, const SShowStmt* pShow) {
|
||||||
toName(pCxt->pParseCxt->acctId, ((SValueNode*)pShow->pDbName)->literal,
|
toName(pCxt->pParseCxt->acctId, ((SValueNode*)pShow->pDbName)->literal,
|
||||||
((SValueNode*)pShow->pTbName)->literal, &name),
|
((SValueNode*)pShow->pTbName)->literal, &name),
|
||||||
&pTableMeta, true);
|
&pTableMeta, true);
|
||||||
taosMemoryFreeClear(pTableMeta);
|
|
||||||
if (TSDB_CODE_SUCCESS != code) {
|
if (TSDB_CODE_SUCCESS != code) {
|
||||||
return generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_GET_META_ERROR, tstrerror(code));
|
code = generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_GET_META_ERROR, tstrerror(code));
|
||||||
|
goto _exit;
|
||||||
|
}
|
||||||
|
if (TSDB_SUPER_TABLE != pTableMeta->tableType && TSDB_CHILD_TABLE != pTableMeta->tableType) {
|
||||||
|
code = generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_INVALID_TAGS_PC,
|
||||||
|
"The _TAGS pseudo column can only be used for child table and super table queries");
|
||||||
|
goto _exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_exit:
|
||||||
|
taosMemoryFreeClear(pTableMeta);
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -121,6 +121,11 @@ class TDTestCase:
|
||||||
tdSql.error(f'show tags from tb_undef from db', expectErrInfo='Fail to get table info, error: Table does not exist')
|
tdSql.error(f'show tags from tb_undef from db', expectErrInfo='Fail to get table info, error: Table does not exist')
|
||||||
tdSql.error(f'show tags from db.tb_undef', expectErrInfo='Fail to get table info, error: Table does not exist')
|
tdSql.error(f'show tags from db.tb_undef', expectErrInfo='Fail to get table info, error: Table does not exist')
|
||||||
tdSql.error(f'show tags from tb_undef', expectErrInfo='Fail to get table info, error: Table does not exist')
|
tdSql.error(f'show tags from tb_undef', expectErrInfo='Fail to get table info, error: Table does not exist')
|
||||||
|
tdSql.error(f'show tags from ntb', expectErrInfo='Tags can only applied to super table and child table')
|
||||||
|
tdSql.error(f'show tags from vtb', expectErrInfo='Tags can only applied to super table and child table')
|
||||||
|
tdSql.error(f'show tags from vtb1', expectErrInfo='Tags can only applied to super table and child table')
|
||||||
|
tdSql.error(f'show tags from vtb2', expectErrInfo='Tags can only applied to super table and child table')
|
||||||
|
tdSql.error(f'show tags from vtbn', expectErrInfo='Tags can only applied to super table and child table')
|
||||||
|
|
||||||
# show table tags
|
# show table tags
|
||||||
tdSql.query(f'show table tags from stb')
|
tdSql.query(f'show table tags from stb')
|
||||||
|
|
Loading…
Reference in New Issue