提交 2317c5ff 编写于 作者: H Hongze Cheng

adjust more code

上级 05eb8dfe
...@@ -77,34 +77,58 @@ int32_t vnodePreProcessWriteMsg(SVnode *pVnode, SRpcMsg *pMsg) { ...@@ -77,34 +77,58 @@ int32_t vnodePreProcessWriteMsg(SVnode *pVnode, SRpcMsg *pMsg) {
tDecoderClear(&dc); tDecoderClear(&dc);
} break; } break;
case TDMT_VND_SUBMIT: { case TDMT_VND_SUBMIT: {
int64_t ctime = taosGetTimestampMs();
tDecoderInit(&dc, (uint8_t *)pMsg->pCont + sizeof(SMsgHead), pMsg->contLen - sizeof(SMsgHead)); tDecoderInit(&dc, (uint8_t *)pMsg->pCont + sizeof(SMsgHead), pMsg->contLen - sizeof(SMsgHead));
tStartDecode(&dc); tStartDecode(&dc);
int32_t flag; uint64_t nSubmitTbData;
tDecodeI32v(&dc, &flag); if (tDecodeU64v(&dc, &nSubmitTbData) < 0) {
code = TSDB_CODE_INVALID_MSG;
goto _err;
}
if (flag & SUBMIT_REQ_AUTO_CREATE_TABLE) { for (int32_t i = 0; i < nSubmitTbData; i++) {
int64_t ctime = taosGetTimestampMs(); if (tStartDecode(&dc) < 0) {
int64_t nReq; code = TSDB_CODE_INVALID_MSG;
int64_t uid; goto _err;
}
tDecodeI64v(&dc, &nReq); int32_t flags;
for (int64_t iReq; iReq < nReq; iReq++) { if (tDecodeI32v(&dc, &flags) < 0) {
char *name = NULL; code = TSDB_CODE_INVALID_MSG;
goto _err;
}
if (flags & SUBMIT_REQ_AUTO_CREATE_TABLE) {
if (tStartDecode(&dc) < 0) {
code = TSDB_CODE_INVALID_MSG;
goto _err;
}
tStartDecode(&dc); if (tDecodeI32v(&dc, NULL) < 0) {
tDecodeI32v(&dc, NULL); code = TSDB_CODE_INVALID_MSG;
tDecodeCStr(&dc, &name); goto _err;
}
uid = metaGetTableEntryUidByName(pVnode->pMeta, name); char *name = NULL;
if (tDecodeCStr(&dc, &name) < 0) {
code = TSDB_CODE_INVALID_MSG;
goto _err;
}
int64_t uid = metaGetTableEntryUidByName(pVnode->pMeta, name);
if (uid == 0) { if (uid == 0) {
uid = tGenIdPI64(); uid = tGenIdPI64();
} }
*(int64_t *)(dc.data + dc.pos) = uid; *(int64_t *)(dc.data + dc.pos) = uid;
*(int64_t *)(dc.data + dc.pos + 8) = ctime; *(int64_t *)(dc.data + dc.pos + 8) = ctime;
tEndDecode(&dc); tEndDecode(&dc);
} }
tEndDecode(&dc);
} }
tEndDecode(&dc); tEndDecode(&dc);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册