[TD-362] fix crash while auto create table

This commit is contained in:
Shengliang Guan 2020-05-18 15:34:19 +00:00
parent 998ad42399
commit 6a3043753d
2 changed files with 6 additions and 4 deletions

View File

@ -1415,7 +1415,7 @@ static SChildTableObj* mgmtDoCreateChildTable(SCMCreateTableMsg *pCreate, SVgObj
char *pTagData = (char *) pCreate->schema; // it is a tag key
SSuperTableObj *pSuperTable = mgmtGetSuperTable(pTagData);
if (pSuperTable == NULL) {
mError("table:%s, corresponding super table does not exist", pCreate->tableId);
mError("table:%s, corresponding super table:%s does not exist", pCreate->tableId, pTagData);
free(pTable);
terrno = TSDB_CODE_INVALID_TABLE;
return NULL;
@ -1505,6 +1505,11 @@ static void mgmtProcessCreateChildTableMsg(SQueuedMsg *pMsg) {
}
pMsg->pTable = (STableObj *)mgmtDoCreateChildTable(pCreate, pVgroup, sid);
if (pMsg->pTable == NULL) {
mgmtSendSimpleResp(pMsg->thandle, terrno);
return;
}
mgmtIncTableRef(pMsg->pTable);
}
} else {

View File

@ -43,9 +43,6 @@ endi
if $data01 != 4 then
return -1
endi
if $data02 != ready then
return -1
endi
print =============== drop database
sql drop database d1