提交 c859b1ff 编写于 作者: G Ganlin Zhao

[TD-6054]<fix>: Filtered by tag with nchar value not as expected

上级 c86bda4a
...@@ -156,14 +156,16 @@ int32_t compareLenPrefixedWStr(const void *pLeft, const void *pRight) { ...@@ -156,14 +156,16 @@ int32_t compareLenPrefixedWStr(const void *pLeft, const void *pRight) {
if (len1 != len2) { if (len1 != len2) {
return len1 > len2? 1:-1; return len1 > len2? 1:-1;
} else { } else {
char pLeftTerm[len1 + 1]; char *pLeftTerm = (char *)tcalloc(len1 + 1, sizeof(char));
char pRightTerm[len2 + 1]; char *pRightTerm = (char *)tcalloc(len1 + 1, sizeof(char));
memset(pLeftTerm, 0, len1 + 1);
memset(pRightTerm, 0, len2 + 1);
memcpy(pLeftTerm, varDataVal(pLeft), len1); memcpy(pLeftTerm, varDataVal(pLeft), len1);
memcpy(pRightTerm, varDataVal(pRight), len2); memcpy(pRightTerm, varDataVal(pRight), len2);
int32_t ret = wcsncmp((void *)pLeftTerm, (void *)pRightTerm, len1/TSDB_NCHAR_SIZE); int32_t ret = wcsncmp((void *)pLeftTerm, (void *)pRightTerm, len1/TSDB_NCHAR_SIZE);
tfree(pLeftTerm);
tfree(pRightTerm);
if (ret == 0) { if (ret == 0) {
return 0; return 0;
} else { } else {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册