[TD-362] fix crash while auto create table
This commit is contained in:
parent
998ad42399
commit
6a3043753d
|
@ -1415,7 +1415,7 @@ static SChildTableObj* mgmtDoCreateChildTable(SCMCreateTableMsg *pCreate, SVgObj
|
||||||
char *pTagData = (char *) pCreate->schema; // it is a tag key
|
char *pTagData = (char *) pCreate->schema; // it is a tag key
|
||||||
SSuperTableObj *pSuperTable = mgmtGetSuperTable(pTagData);
|
SSuperTableObj *pSuperTable = mgmtGetSuperTable(pTagData);
|
||||||
if (pSuperTable == NULL) {
|
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);
|
free(pTable);
|
||||||
terrno = TSDB_CODE_INVALID_TABLE;
|
terrno = TSDB_CODE_INVALID_TABLE;
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -1505,6 +1505,11 @@ static void mgmtProcessCreateChildTableMsg(SQueuedMsg *pMsg) {
|
||||||
}
|
}
|
||||||
|
|
||||||
pMsg->pTable = (STableObj *)mgmtDoCreateChildTable(pCreate, pVgroup, sid);
|
pMsg->pTable = (STableObj *)mgmtDoCreateChildTable(pCreate, pVgroup, sid);
|
||||||
|
if (pMsg->pTable == NULL) {
|
||||||
|
mgmtSendSimpleResp(pMsg->thandle, terrno);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
mgmtIncTableRef(pMsg->pTable);
|
mgmtIncTableRef(pMsg->pTable);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -43,9 +43,6 @@ endi
|
||||||
if $data01 != 4 then
|
if $data01 != 4 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
if $data02 != ready then
|
|
||||||
return -1
|
|
||||||
endi
|
|
||||||
|
|
||||||
print =============== drop database
|
print =============== drop database
|
||||||
sql drop database d1
|
sql drop database d1
|
||||||
|
|
Loading…
Reference in New Issue