提交 1d98fdbf 编写于 作者: X xywang

[TS-821]<fix>: reverted some changes

上级 c59f0674
...@@ -184,16 +184,7 @@ bool likeOperator(SColumnFilterElem *pFilter, const char *minval, const char *ma ...@@ -184,16 +184,7 @@ bool likeOperator(SColumnFilterElem *pFilter, const char *minval, const char *ma
} else if (type == TSDB_DATA_TYPE_NCHAR) { } else if (type == TSDB_DATA_TYPE_NCHAR) {
SPatternCompareInfo info = PATTERN_COMPARE_INFO_INITIALIZER; SPatternCompareInfo info = PATTERN_COMPARE_INFO_INITIALIZER;
size_t size = (size_t)(pFilter->filterInfo.len/TSDB_NCHAR_SIZE); size_t size = (size_t)(pFilter->filterInfo.len/TSDB_NCHAR_SIZE);
void *pz = calloc(size + 1, TSDB_NCHAR_SIZE); return WCSPatternMatch((uint32_t *) pFilter->filterInfo.pz, size, (uint32_t *) varDataVal(minval), varDataLen(minval)/TSDB_NCHAR_SIZE, &info) == TSDB_PATTERN_MATCH;
if (pz == NULL) {
return false;
}
memcpy(pz, (void *) pFilter->filterInfo.pz, size * TSDB_NCHAR_SIZE);
int32_t ret = WCSPatternMatch((uint32_t *) pz, size, (uint32_t *) varDataVal(minval), varDataLen(minval)/TSDB_NCHAR_SIZE, &info);
free(pz);
return ret == TSDB_PATTERN_MATCH;
} else { } else {
return false; return false;
} }
......
...@@ -44,7 +44,7 @@ typedef struct SPatternCompareInfo { ...@@ -44,7 +44,7 @@ typedef struct SPatternCompareInfo {
int patternMatch(const char *pattern, const char *str, size_t size, const SPatternCompareInfo *pInfo); int patternMatch(const char *pattern, const char *str, size_t size, const SPatternCompareInfo *pInfo);
int WCSPatternMatch(uint32_t *pattern, size_t paSize, uint32_t *str, size_t size, const SPatternCompareInfo *pInfo); int WCSPatternMatch(const uint32_t *pattern, size_t paSize, const uint32_t *str, size_t size, const SPatternCompareInfo *pInfo);
int32_t doCompare(const char* a, const char* b, int32_t type, size_t size); int32_t doCompare(const char* a, const char* b, int32_t type, size_t size);
......
...@@ -386,7 +386,7 @@ taosWcscspn (const uint32_t *wcs, const uint32_t *reject) ...@@ -386,7 +386,7 @@ taosWcscspn (const uint32_t *wcs, const uint32_t *reject)
return count; return count;
} }
int WCSPatternMatch(uint32_t *patterStr, size_t paSize, uint32_t *str, size_t size, const SPatternCompareInfo *pInfo) { int WCSPatternMatch(const uint32_t *patterStr, size_t paSize, const uint32_t *str, size_t size, const SPatternCompareInfo *pInfo) {
wchar_t c, c1; wchar_t c, c1;
wchar_t matchOne = L'_'; // "_" wchar_t matchOne = L'_'; // "_"
wchar_t matchAll = L'%'; // "%" wchar_t matchAll = L'%'; // "%"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册