[td-11818] add more check.
This commit is contained in:
parent
01cde7cfb1
commit
284e794315
|
@ -310,12 +310,12 @@ int32_t ctgGetVgInfoFromHashValue(SDBVgroupInfo *dbInfo, const SName *pTableName
|
||||||
}
|
}
|
||||||
|
|
||||||
if (NULL == vgInfo) {
|
if (NULL == vgInfo) {
|
||||||
ctgError("no hash range found for hashvalue[%u]", hashValue);
|
ctgError("no hash range found for hashvalue [%u], numOfVgId:%d", hashValue, taosHashGetSize(dbInfo->vgInfo));
|
||||||
|
|
||||||
void *pIter1 = taosHashIterate(dbInfo->vgInfo, NULL);
|
void *pIter1 = taosHashIterate(dbInfo->vgInfo, NULL);
|
||||||
while (pIter1) {
|
while (pIter1) {
|
||||||
vgInfo = pIter1;
|
vgInfo = pIter1;
|
||||||
ctgError("valid range:[%d, %d], vgId:%d", vgInfo->hashBegin, vgInfo->hashEnd, vgInfo->vgId);
|
ctgError("valid range:[%u, %u], vgId:%d", vgInfo->hashBegin, vgInfo->hashEnd, vgInfo->vgId);
|
||||||
pIter1 = taosHashIterate(dbInfo->vgInfo, pIter1);
|
pIter1 = taosHashIterate(dbInfo->vgInfo, pIter1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -325,7 +325,6 @@ int32_t ctgGetVgInfoFromHashValue(SDBVgroupInfo *dbInfo, const SName *pTableName
|
||||||
*pVgroup = *vgInfo;
|
*pVgroup = *vgInfo;
|
||||||
|
|
||||||
_return:
|
_return:
|
||||||
|
|
||||||
CTG_RET(TSDB_CODE_SUCCESS);
|
CTG_RET(TSDB_CODE_SUCCESS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -626,11 +626,12 @@ static int32_t doBuildSingleTableBatchReq(SName* pTableName, SArray* pColumns, S
|
||||||
|
|
||||||
int32_t doCheckAndBuildCreateTableReq(SCreateTableSql* pCreateTable, SParseBasicCtx* pCtx, SMsgBuf* pMsgBuf, char** pOutput, int32_t* len) {
|
int32_t doCheckAndBuildCreateTableReq(SCreateTableSql* pCreateTable, SParseBasicCtx* pCtx, SMsgBuf* pMsgBuf, char** pOutput, int32_t* len) {
|
||||||
SArray* pBufArray = NULL;
|
SArray* pBufArray = NULL;
|
||||||
|
int32_t code = 0;
|
||||||
|
|
||||||
// it is a sql statement to create a normal table
|
// it is a sql statement to create a normal table
|
||||||
if (pCreateTable->childTableInfo == NULL) {
|
if (pCreateTable->childTableInfo == NULL) {
|
||||||
assert(taosArrayGetSize(pCreateTable->colInfo.pColumns) > 0 && pCreateTable->colInfo.pTagColumns == NULL);
|
assert(taosArrayGetSize(pCreateTable->colInfo.pColumns) > 0 && pCreateTable->colInfo.pTagColumns == NULL);
|
||||||
int32_t code = doCheckForCreateTable(pCreateTable, pMsgBuf);
|
code = doCheckForCreateTable(pCreateTable, pMsgBuf);
|
||||||
if (code != TSDB_CODE_SUCCESS) {
|
if (code != TSDB_CODE_SUCCESS) {
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
@ -659,7 +660,10 @@ int32_t doCheckAndBuildCreateTableReq(SCreateTableSql* pCreateTable, SParseBasic
|
||||||
destroyCreateTbReqBatch(&tbatch);
|
destroyCreateTbReqBatch(&tbatch);
|
||||||
|
|
||||||
} else { // it is a child table, created according to a super table
|
} else { // it is a child table, created according to a super table
|
||||||
doCheckAndBuildCreateCTableReq(pCreateTable, pCtx, pMsgBuf, &pBufArray);
|
code = doCheckAndBuildCreateCTableReq(pCreateTable, pCtx, pMsgBuf, &pBufArray);
|
||||||
|
if (code != 0) {
|
||||||
|
return code;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SVnodeModifOpStmtInfo* pStmtInfo = calloc(1, sizeof(SVnodeModifOpStmtInfo));
|
SVnodeModifOpStmtInfo* pStmtInfo = calloc(1, sizeof(SVnodeModifOpStmtInfo));
|
||||||
|
|
Loading…
Reference in New Issue