From 83ea175df208fb30ed3932370018918d97a2373f Mon Sep 17 00:00:00 2001 From: hjxilinx Date: Sat, 21 Mar 2020 23:29:56 +0800 Subject: [PATCH] [td-32] fix bugs in inserting data --- src/client/src/tscServer.c | 6 ++++-- src/dnode/src/dnodeWrite.c | 4 +++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/client/src/tscServer.c b/src/client/src/tscServer.c index a0136a570c..8fb3df94d5 100644 --- a/src/client/src/tscServer.c +++ b/src/client/src/tscServer.c @@ -541,11 +541,13 @@ int tscBuildSubmitMsg(SSqlObj *pSql, SSqlInfo *pInfo) { pMsg = pStart; pShellMsg = (SShellSubmitMsg *)pMsg; - + + pShellMsg->desc.numOfVnodes = htonl(1); + pShellMsg->import = htons(TSDB_QUERY_HAS_TYPE(pQueryInfo->type, TSDB_QUERY_TYPE_INSERT) ? 0 : 1); pShellMsg->header.vgId = htonl(pTableMeta->vgId); + pShellMsg->header.contLen = htonl(pSql->cmd.payloadLen); - pShellMsg->header.contLen = pSql->cmd.payloadLen; pShellMsg->numOfTables = htonl(pSql->cmd.numOfTablesInSubmit); // number of meters to be inserted // pSql->cmd.payloadLen is set during parse sql routine, so we do not use it here diff --git a/src/dnode/src/dnodeWrite.c b/src/dnode/src/dnodeWrite.c index 1deefd4f53..7ed731c953 100644 --- a/src/dnode/src/dnodeWrite.c +++ b/src/dnode/src/dnodeWrite.c @@ -275,7 +275,9 @@ static void dnodeProcessSubmitMsg(SWriteMsg *pMsg) { pRsp->numOfRows = htonl(1); pRsp->affectedRows = htonl(1); pRsp->numOfFailedBlocks = 0; - + + // todo write to tsdb + SRpcMsg rpcRsp = { .handle = pMsg->rpcMsg.handle, .pCont = pRsp, -- GitLab