提交 5ffaaeba 编写于 作者: H Hongze Cheng

more code

上级 a2350445
......@@ -34,7 +34,8 @@ typedef struct {
};
// Integer ----
struct {
/* data */
int8_t i_copy;
int32_t i_n;
};
// Float ----
struct {
......@@ -52,6 +53,10 @@ typedef struct {
struct {
int32_t bool_n;
};
// Binary ----
struct {
int32_t b_n;
};
};
} SCompressor;
......@@ -337,9 +342,13 @@ static int32_t tCompBinary(SCompressor *pCmprsor, const uint8_t *pData, int32_t
int32_t code = 0;
if (nData) {
code = tRealloc(&pCmprsor->aBuf[0], pCmprsor->nBuf[0] + nData);
if (code) return code;
memcpy(pCmprsor->aBuf[0] + pCmprsor->nBuf[0], pData, nData);
pCmprsor->nBuf[0] += nData;
}
pCmprsor->b_n++;
return code;
}
......@@ -419,6 +428,9 @@ int32_t tCompressorReset(SCompressor *pCmprsor, int8_t type, int8_t cmprAlg) {
pCmprsor->bool_n = 0;
pCmprsor->aBuf[0][0] = 0;
break;
case TSDB_DATA_TYPE_BINARY:
pCmprsor->b_n = 0;
break;
default:
break;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册