check db
This commit is contained in:
parent
b38d5a2492
commit
90222531e7
|
@ -395,10 +395,10 @@ typedef enum ENodeType {
|
||||||
QUERY_NODE_SHOW_TSMAS_STMT,
|
QUERY_NODE_SHOW_TSMAS_STMT,
|
||||||
QUERY_NODE_SHOW_ANODES_STMT,
|
QUERY_NODE_SHOW_ANODES_STMT,
|
||||||
QUERY_NODE_SHOW_ANODES_FULL_STMT,
|
QUERY_NODE_SHOW_ANODES_FULL_STMT,
|
||||||
|
QUERY_NODE_SHOW_USAGE_STMT,
|
||||||
QUERY_NODE_CREATE_TSMA_STMT,
|
QUERY_NODE_CREATE_TSMA_STMT,
|
||||||
QUERY_NODE_SHOW_CREATE_TSMA_STMT,
|
QUERY_NODE_SHOW_CREATE_TSMA_STMT,
|
||||||
QUERY_NODE_DROP_TSMA_STMT,
|
QUERY_NODE_DROP_TSMA_STMT,
|
||||||
QUERY_NODE_SHOW_USAGE_STMT,
|
|
||||||
|
|
||||||
// logic plan node
|
// logic plan node
|
||||||
QUERY_NODE_LOGIC_PLAN_SCAN = 1000,
|
QUERY_NODE_LOGIC_PLAN_SCAN = 1000,
|
||||||
|
|
|
@ -3878,6 +3878,11 @@ _err:
|
||||||
}
|
}
|
||||||
SNode* createShowDiskUsageStmt(SAstCreateContext* pCxt, SNode* dbName, ENodeType type) {
|
SNode* createShowDiskUsageStmt(SAstCreateContext* pCxt, SNode* dbName, ENodeType type) {
|
||||||
CHECK_PARSER_STATUS(pCxt);
|
CHECK_PARSER_STATUS(pCxt);
|
||||||
|
if (NULL == dbName) {
|
||||||
|
snprintf(pCxt->pQueryCxt->pMsg, pCxt->pQueryCxt->msgLen, "database not specified");
|
||||||
|
pCxt->errCode = TSDB_CODE_PAR_SYNTAX_ERROR;
|
||||||
|
CHECK_PARSER_STATUS(pCxt);
|
||||||
|
}
|
||||||
|
|
||||||
SShowStmt* pStmt = NULL;
|
SShowStmt* pStmt = NULL;
|
||||||
pCxt->errCode = nodesMakeNode(type, (SNode**)&pStmt);
|
pCxt->errCode = nodesMakeNode(type, (SNode**)&pStmt);
|
||||||
|
|
|
@ -1904,7 +1904,7 @@ static EDealRes translateColumn(STranslateContext* pCxt, SColumnNode** pCol) {
|
||||||
|
|
||||||
if (pCxt->pParseCxt->biMode) {
|
if (pCxt->pParseCxt->biMode) {
|
||||||
SNode** ppNode = (SNode**)pCol;
|
SNode** ppNode = (SNode**)pCol;
|
||||||
bool ret;
|
bool ret;
|
||||||
pCxt->errCode = biRewriteToTbnameFunc(pCxt, ppNode, &ret);
|
pCxt->errCode = biRewriteToTbnameFunc(pCxt, ppNode, &ret);
|
||||||
if (TSDB_CODE_SUCCESS != pCxt->errCode) return DEAL_RES_ERROR;
|
if (TSDB_CODE_SUCCESS != pCxt->errCode) return DEAL_RES_ERROR;
|
||||||
if (ret) {
|
if (ret) {
|
||||||
|
@ -10041,7 +10041,7 @@ static int32_t translateCreateIndex(STranslateContext* pCxt, SCreateIndexStmt* p
|
||||||
|
|
||||||
static int32_t translateDropIndex(STranslateContext* pCxt, SDropIndexStmt* pStmt) {
|
static int32_t translateDropIndex(STranslateContext* pCxt, SDropIndexStmt* pStmt) {
|
||||||
SMDropSmaReq dropSmaReq = {0};
|
SMDropSmaReq dropSmaReq = {0};
|
||||||
SName name = {0};
|
SName name = {0};
|
||||||
toName(pCxt->pParseCxt->acctId, pStmt->indexDbName, pStmt->indexName, &name);
|
toName(pCxt->pParseCxt->acctId, pStmt->indexDbName, pStmt->indexName, &name);
|
||||||
int32_t code = tNameExtractFullName(&name, dropSmaReq.name);
|
int32_t code = tNameExtractFullName(&name, dropSmaReq.name);
|
||||||
if (TSDB_CODE_SUCCESS != code) return code;
|
if (TSDB_CODE_SUCCESS != code) return code;
|
||||||
|
@ -11788,7 +11788,7 @@ static int32_t translateDropView(STranslateContext* pCxt, SDropViewStmt* pStmt)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
SCMDropViewReq dropReq = {0};
|
SCMDropViewReq dropReq = {0};
|
||||||
SName name = {0};
|
SName name = {0};
|
||||||
int32_t code = tNameSetDbName(&name, pCxt->pParseCxt->acctId, pStmt->dbName, strlen(pStmt->dbName));
|
int32_t code = tNameSetDbName(&name, pCxt->pParseCxt->acctId, pStmt->dbName, strlen(pStmt->dbName));
|
||||||
if (TSDB_CODE_SUCCESS == code) {
|
if (TSDB_CODE_SUCCESS == code) {
|
||||||
(void)tNameGetFullDbName(&name, dropReq.dbFName);
|
(void)tNameGetFullDbName(&name, dropReq.dbFName);
|
||||||
|
|
Loading…
Reference in New Issue