Merge remote-tracking branch 'origin/3.0' into feature/3.0_liaohj
This commit is contained in:
commit
59de47a714
|
@ -97,8 +97,8 @@ int tsdbMemTableInsert(STsdb *pTsdb, STsdbMemTable *pMemTable, SSubmitReq *pMsg,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pRsp != NULL) {
|
if (pRsp != NULL) {
|
||||||
pRsp->affectedRows = htonl(affectedrows);
|
pRsp->affectedRows = affectedrows;
|
||||||
pRsp->numOfRows = htonl(numOfRows);
|
pRsp->numOfRows = numOfRows;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -18,6 +18,7 @@
|
||||||
static int vnodeProcessCreateStbReq(SVnode *pVnode, void *pReq);
|
static int vnodeProcessCreateStbReq(SVnode *pVnode, void *pReq);
|
||||||
static int vnodeProcessCreateTbReq(SVnode *pVnode, SRpcMsg *pMsg, void *pReq, SRpcMsg **pRsp);
|
static int vnodeProcessCreateTbReq(SVnode *pVnode, SRpcMsg *pMsg, void *pReq, SRpcMsg **pRsp);
|
||||||
static int vnodeProcessAlterStbReq(SVnode *pVnode, void *pReq);
|
static int vnodeProcessAlterStbReq(SVnode *pVnode, void *pReq);
|
||||||
|
static int vnodeProcessSubmitReq(SVnode *pVnode, SSubmitReq *pSubmitReq, SRpcMsg *pRsp);
|
||||||
|
|
||||||
void vnodePreprocessWriteReqs(SVnode *pVnode, SArray *pMsgs) {
|
void vnodePreprocessWriteReqs(SVnode *pVnode, SArray *pMsgs) {
|
||||||
SNodeMsg *pMsg;
|
SNodeMsg *pMsg;
|
||||||
|
@ -79,9 +80,10 @@ int vnodeProcessWriteReq(SVnode *pVnode, SRpcMsg *pMsg, SRpcMsg **pRsp) {
|
||||||
case TDMT_VND_SUBMIT:
|
case TDMT_VND_SUBMIT:
|
||||||
/*printf("vnode %d write data %ld\n", pVnode->vgId, ver);*/
|
/*printf("vnode %d write data %ld\n", pVnode->vgId, ver);*/
|
||||||
if (pVnode->config.streamMode == 0) {
|
if (pVnode->config.streamMode == 0) {
|
||||||
if (tsdbInsertData(pVnode->pTsdb, (SSubmitReq *)ptr, NULL) < 0) {
|
*pRsp = taosMemoryCalloc(1, sizeof(SRpcMsg));
|
||||||
// TODO: handle error
|
(*pRsp)->handle = pMsg->handle;
|
||||||
}
|
(*pRsp)->ahandle = pMsg->ahandle;
|
||||||
|
return vnodeProcessSubmitReq(pVnode, ptr, *pRsp);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case TDMT_VND_MQ_SET_CONN: {
|
case TDMT_VND_MQ_SET_CONN: {
|
||||||
|
@ -300,3 +302,23 @@ static int vnodeProcessAlterStbReq(SVnode *pVnode, void *pReq) {
|
||||||
taosMemoryFree(vAlterTbReq.name);
|
taosMemoryFree(vAlterTbReq.name);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int vnodeProcessSubmitReq(SVnode *pVnode, SSubmitReq *pSubmitReq, SRpcMsg *pRsp) {
|
||||||
|
SSubmitRsp rsp = {0};
|
||||||
|
|
||||||
|
pRsp->code = 0;
|
||||||
|
|
||||||
|
// handle the request
|
||||||
|
if (tsdbInsertData(pVnode->pTsdb, pSubmitReq, &rsp) < 0) {
|
||||||
|
pRsp->code = terrno;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
// encode the response (TODO)
|
||||||
|
pRsp->msgType = TDMT_VND_SUBMIT_RSP;
|
||||||
|
pRsp->pCont = rpcMallocCont(sizeof(SSubmitRsp));
|
||||||
|
memcpy(pRsp->pCont, &rsp, sizeof(rsp));
|
||||||
|
pRsp->contLen = sizeof(SSubmitRsp);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
|
@ -31,7 +31,7 @@
|
||||||
./test.sh -f tsim/query/interval.sim
|
./test.sh -f tsim/query/interval.sim
|
||||||
./test.sh -f tsim/query/interval-offset.sim
|
./test.sh -f tsim/query/interval-offset.sim
|
||||||
./test.sh -f tsim/query/scalarFunction.sim
|
./test.sh -f tsim/query/scalarFunction.sim
|
||||||
#./test.sh -f tsim/query/charScalarFunction.sim
|
./test.sh -f tsim/query/charScalarFunction.sim
|
||||||
./test.sh -f tsim/query/explain.sim
|
./test.sh -f tsim/query/explain.sim
|
||||||
./test.sh -f tsim/query/session.sim
|
./test.sh -f tsim/query/session.sim
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue