Merge pull request #24615 from taosdata/fix/TD-28025
fix:[TD-28025]return 0 if create table failed if stable not exist
This commit is contained in:
commit
75946f8bd1
|
@ -955,7 +955,6 @@ static int32_t taosCreateTable(TAOS* taos, void* meta, int32_t metaLen) {
|
||||||
if (code != TSDB_CODE_SUCCESS) {
|
if (code != TSDB_CODE_SUCCESS) {
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
taosArrayPush(pRequest->tableList, &pName);
|
|
||||||
|
|
||||||
pCreateReq->flags |= TD_CREATE_IF_NOT_EXISTS;
|
pCreateReq->flags |= TD_CREATE_IF_NOT_EXISTS;
|
||||||
// change tag cid to new cid
|
// change tag cid to new cid
|
||||||
|
@ -966,6 +965,12 @@ static int32_t taosCreateTable(TAOS* taos, void* meta, int32_t metaLen) {
|
||||||
// pCreateReq->ctb.suid = processSuid(pCreateReq->ctb.suid, pRequest->pDb);
|
// pCreateReq->ctb.suid = processSuid(pCreateReq->ctb.suid, pRequest->pDb);
|
||||||
toName(pTscObj->acctId, pRequest->pDb, pCreateReq->ctb.stbName, &sName);
|
toName(pTscObj->acctId, pRequest->pDb, pCreateReq->ctb.stbName, &sName);
|
||||||
code = catalogGetTableMeta(pCatalog, &conn, &sName, &pTableMeta);
|
code = catalogGetTableMeta(pCatalog, &conn, &sName, &pTableMeta);
|
||||||
|
if (code == TSDB_CODE_PAR_TABLE_NOT_EXIST) {
|
||||||
|
code = TSDB_CODE_SUCCESS;
|
||||||
|
taosMemoryFreeClear(pTableMeta);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if (code != TSDB_CODE_SUCCESS) {
|
if (code != TSDB_CODE_SUCCESS) {
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
@ -983,6 +988,7 @@ static int32_t taosCreateTable(TAOS* taos, void* meta, int32_t metaLen) {
|
||||||
}
|
}
|
||||||
taosMemoryFreeClear(pTableMeta);
|
taosMemoryFreeClear(pTableMeta);
|
||||||
}
|
}
|
||||||
|
taosArrayPush(pRequest->tableList, &pName);
|
||||||
|
|
||||||
SVgroupCreateTableBatch* pTableBatch = taosHashGet(pVgroupHashmap, &pInfo.vgId, sizeof(pInfo.vgId));
|
SVgroupCreateTableBatch* pTableBatch = taosHashGet(pVgroupHashmap, &pInfo.vgId, sizeof(pInfo.vgId));
|
||||||
if (pTableBatch == NULL) {
|
if (pTableBatch == NULL) {
|
||||||
|
@ -999,6 +1005,9 @@ static int32_t taosCreateTable(TAOS* taos, void* meta, int32_t metaLen) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (taosHashGetSize(pVgroupHashmap) == 0) {
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
SArray* pBufArray = serializeVgroupsCreateTableBatch(pVgroupHashmap);
|
SArray* pBufArray = serializeVgroupsCreateTableBatch(pVgroupHashmap);
|
||||||
if (NULL == pBufArray) {
|
if (NULL == pBufArray) {
|
||||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
code = TSDB_CODE_OUT_OF_MEMORY;
|
||||||
|
|
Loading…
Reference in New Issue