提交 2830fb52 编写于 作者: wmmhello's avatar wmmhello

fix var data problems in unique function

上级 6ff602ca
...@@ -5201,7 +5201,7 @@ static bool unique_function_setup(SQLFunctionCtx *pCtx, SResultRowCellInfo* pRes ...@@ -5201,7 +5201,7 @@ static bool unique_function_setup(SQLFunctionCtx *pCtx, SResultRowCellInfo* pRes
static void do_unique_function(SQLFunctionCtx *pCtx, SUniqueFuncInfo *pInfo, TSKEY timestamp, char *pData, char *tag, int32_t bytes, int16_t type){ static void do_unique_function(SQLFunctionCtx *pCtx, SUniqueFuncInfo *pInfo, TSKEY timestamp, char *pData, char *tag, int32_t bytes, int16_t type){
int32_t hashKeyBytes = bytes; int32_t hashKeyBytes = bytes;
if(IS_VAR_DATA_TYPE(type)){ if(IS_VAR_DATA_TYPE(type)){ // for var data, we can not use bytes, because there are dirty data in the back of var data
hashKeyBytes = varDataTLen(pData); hashKeyBytes = varDataTLen(pData);
} }
UniqueUnit **unique = taosHashGet(*pCtx->pUniqueSet, pData, hashKeyBytes); UniqueUnit **unique = taosHashGet(*pCtx->pUniqueSet, pData, hashKeyBytes);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册