enh: support drop table with uid
This commit is contained in:
parent
58985a122e
commit
812f3a04d9
|
@ -14572,6 +14572,15 @@ static int32_t rewriteDropTableWithOpt(STranslateContext* pCxt, SQuery* pQuery)
|
|||
"Cannot drop table of system database: `%s`.`%s`", pClause->dbName,
|
||||
pClause->tableName);
|
||||
}
|
||||
for (int32_t i = 0; i < TSDB_TABLE_NAME_LEN; i++) {
|
||||
if (pClause->tableName[i] == '\0') {
|
||||
break;
|
||||
}
|
||||
if (!isdigit(pClause->tableName[i])) {
|
||||
return generateSyntaxErrMsgExt(&pCxt->msgBuf, TSDB_CODE_PAR_TABLE_NOT_EXIST, "Table does not exist: `%s`.`%s`",
|
||||
pClause->dbName, pClause->tableName);
|
||||
}
|
||||
}
|
||||
SName name = {0};
|
||||
toName(pCxt->pParseCxt->acctId, pClause->dbName, pClause->tableName, &name);
|
||||
int32_t code = getTargetName(pCxt, &name, pTableName);
|
||||
|
@ -14687,6 +14696,16 @@ static int32_t rewriteDropSuperTablewithOpt(STranslateContext* pCxt, SQuery* pQu
|
|||
"Cannot drop table of system database: `%s`.`%s`", pStmt->dbName, pStmt->tableName);
|
||||
}
|
||||
|
||||
for (int32_t i = 0; i < TSDB_TABLE_NAME_LEN; i++) {
|
||||
if (pStmt->tableName[i] == '\0') {
|
||||
break;
|
||||
}
|
||||
if (!isdigit(pStmt->tableName[i])) {
|
||||
return generateSyntaxErrMsgExt(&pCxt->msgBuf, TSDB_CODE_PAR_TABLE_NOT_EXIST, "Table does not exist: `%s`.`%s`",
|
||||
pStmt->dbName, pStmt->tableName);
|
||||
}
|
||||
}
|
||||
|
||||
char pTableName[TSDB_TABLE_NAME_LEN] = {0};
|
||||
SName name = {0};
|
||||
toName(pCxt->pParseCxt->acctId, pStmt->dbName, pStmt->tableName, &name);
|
||||
|
|
Loading…
Reference in New Issue