[td-225] fix bugs in restore from core dump
This commit is contained in:
parent
315fa74042
commit
e65be1be0d
|
@ -84,8 +84,11 @@ static int32_t mnodeDbActionDelete(SSdbOper *pOper) {
|
||||||
mnodeDropAllChildTables(pDb);
|
mnodeDropAllChildTables(pDb);
|
||||||
mnodeDropAllSuperTables(pDb);
|
mnodeDropAllSuperTables(pDb);
|
||||||
mnodeDropAllDbVgroups(pDb);
|
mnodeDropAllDbVgroups(pDb);
|
||||||
mnodeDropDbFromAcct(pAcct, pDb);
|
|
||||||
mnodeDecAcctRef(pAcct);
|
if (pAcct) {
|
||||||
|
mnodeDropDbFromAcct(pAcct, pDb);
|
||||||
|
mnodeDecAcctRef(pAcct);
|
||||||
|
}
|
||||||
|
|
||||||
return TSDB_CODE_SUCCESS;
|
return TSDB_CODE_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
|
@ -157,10 +157,12 @@ static int32_t mnodeChildTableActionDelete(SSdbOper *pOper) {
|
||||||
if (pDb != NULL) pAcct = mnodeGetAcct(pDb->acct);
|
if (pDb != NULL) pAcct = mnodeGetAcct(pDb->acct);
|
||||||
|
|
||||||
if (pTable->info.type == TSDB_CHILD_TABLE) {
|
if (pTable->info.type == TSDB_CHILD_TABLE) {
|
||||||
grantRestore(TSDB_GRANT_TIMESERIES, pTable->superTable->numOfColumns - 1);
|
if (pTable->superTable) {
|
||||||
if (pAcct != NULL) pAcct->acctInfo.numOfTimeSeries -= (pTable->superTable->numOfColumns - 1);
|
grantRestore(TSDB_GRANT_TIMESERIES, pTable->superTable->numOfColumns - 1);
|
||||||
mnodeRemoveTableFromStable(pTable->superTable, pTable);
|
if (pAcct != NULL) pAcct->acctInfo.numOfTimeSeries -= (pTable->superTable->numOfColumns - 1);
|
||||||
mnodeDecTableRef(pTable->superTable);
|
mnodeRemoveTableFromStable(pTable->superTable, pTable);
|
||||||
|
mnodeDecTableRef(pTable->superTable);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
grantRestore(TSDB_GRANT_TIMESERIES, pTable->numOfColumns - 1);
|
grantRestore(TSDB_GRANT_TIMESERIES, pTable->numOfColumns - 1);
|
||||||
if (pAcct != NULL) pAcct->acctInfo.numOfTimeSeries -= (pTable->numOfColumns - 1);
|
if (pAcct != NULL) pAcct->acctInfo.numOfTimeSeries -= (pTable->numOfColumns - 1);
|
||||||
|
|
Loading…
Reference in New Issue