未验证 提交 5942b589 编写于 作者: M Minglei Jin 提交者: GitHub

Merge pull request #13328 from taosdata/fix/TS-1579-V26

fix(delete): delete empty super table core
......@@ -198,6 +198,10 @@ int32_t executeDelete(SSqlObj* pSql, SQueryInfo* pQueryInfo) {
SSubqueryState *pState = &pSql->subState;
int32_t numOfSub = pTableMetaInfo->vgroupList->numOfVgroups;
if(numOfSub == 0) {
tscInfo(":CDEL SQL:%p tablename=%s numOfVgroups is zero, maybe empty table.", pSql, pTableMetaInfo->name.tname);
return TSDB_CODE_FAILED;
}
ret = doInitSubState(pSql, numOfSub);
if (ret != 0) {
......
......@@ -125,7 +125,7 @@ static int tsdbDeleteImplCommon(STsdbRepo *pRepo, SControlDataInfo* pCtlInfo) {
pRepo->deleteState = TSDB_NO_DELETE;
tsem_post(&(pRepo->readyToCommit));
tsdbInfo("vgId:%d :SDEL delete over, no meta or data file", REPO_ID(pRepo));
return -1;
return TSDB_CODE_SUCCESS;
}
SArray* aUpdates = taosArrayInit(10, sizeof(STable *));
......
......@@ -78,10 +78,16 @@ class TDTestCase:
def create_tables(self):
# super table
tdSql.execute("create table st(ts timestamp, i1 int) tags(area int)")
# test delete empty super table
tdSql.execute("delete from st")
# child table
for i in range(10):
sql = "create table t%d using st tags(%d)"%(i, i)
tdSql.execute(sql)
# test delete empty table
tdSql.execute("delete from t0")
return
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册