提交 7791ad5a 编写于 作者: S slzhou

try to modify and failure

上级 6ede012a
...@@ -1574,7 +1574,7 @@ int32_t tSerializeSCreateFuncReq(void *buf, int32_t bufLen, SCreateFuncReq *pReq ...@@ -1574,7 +1574,7 @@ int32_t tSerializeSCreateFuncReq(void *buf, int32_t bufLen, SCreateFuncReq *pReq
} }
if (tEncodeI32(&encoder, codeSize) < 0) return -1; if (tEncodeI32(&encoder, codeSize) < 0) return -1;
if (pReq->pCode != NULL) { if (pReq->pCode != NULL) {
if (tEncodeCStr(&encoder, pReq->pCode) < 0) return -1; if (tEncodeBinary(&encoder, pReq->pCode, codeSize) < 0) return -1;
} }
int32_t commentSize = 0; int32_t commentSize = 0;
......
...@@ -309,10 +309,10 @@ static int32_t mndProcessCreateFuncReq(SNodeMsg *pReq) { ...@@ -309,10 +309,10 @@ static int32_t mndProcessCreateFuncReq(SNodeMsg *pReq) {
goto _OVER; goto _OVER;
} }
if (createReq.pCode[0] == 0) { // if (createReq.pCode[0] == 0) {
terrno = TSDB_CODE_MND_INVALID_FUNC_CODE; // terrno = TSDB_CODE_MND_INVALID_FUNC_CODE;
goto _OVER; // goto _OVER;
} // }
if (createReq.bufSize <= 0 || createReq.bufSize > TSDB_FUNC_BUF_SIZE) { if (createReq.bufSize <= 0 || createReq.bufSize > TSDB_FUNC_BUF_SIZE) {
terrno = TSDB_CODE_MND_INVALID_FUNC_BUFSIZE; terrno = TSDB_CODE_MND_INVALID_FUNC_BUFSIZE;
......
...@@ -453,7 +453,7 @@ TEST_F(MndTestFunc, 05_Actual_code) { ...@@ -453,7 +453,7 @@ TEST_F(MndTestFunc, 05_Actual_code) {
strcpy(createReq.name, "udf1"); strcpy(createReq.name, "udf1");
char code[300] = {0}; char code[300] = {0};
for (int32_t i = 0; i < sizeof(code); ++i) { for (int32_t i = 0; i < sizeof(code); ++i) {
code[i] = i % 20; code[i] = (i+1) % 20;
} }
SetCode(&createReq, code, 300); SetCode(&createReq, code, 300);
SetComment(&createReq, "comment1"); SetComment(&createReq, "comment1");
...@@ -507,7 +507,7 @@ TEST_F(MndTestFunc, 05_Actual_code) { ...@@ -507,7 +507,7 @@ TEST_F(MndTestFunc, 05_Actual_code) {
EXPECT_EQ(pFuncInfo->signature, 5); EXPECT_EQ(pFuncInfo->signature, 5);
EXPECT_STREQ("comment1", pFuncInfo->pComment); EXPECT_STREQ("comment1", pFuncInfo->pComment);
for (int32_t i = 0; i < 300; ++i) { for (int32_t i = 0; i < 300; ++i) {
EXPECT_EQ(pFuncInfo->pCode[i], i % 20); EXPECT_EQ(pFuncInfo->pCode[i], (i+1) % 20);
} }
tFreeSRetrieveFuncRsp(&retrieveRsp); tFreeSRetrieveFuncRsp(&retrieveRsp);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册