提交 81d13772 编写于 作者: X xywang

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

上级 1d98fdbf
......@@ -183,8 +183,7 @@ bool likeOperator(SColumnFilterElem *pFilter, const char *minval, const char *ma
return patternMatch((char *)pFilter->filterInfo.pz, varDataVal(minval), varDataLen(minval), &info) == TSDB_PATTERN_MATCH;
} else if (type == TSDB_DATA_TYPE_NCHAR) {
SPatternCompareInfo info = PATTERN_COMPARE_INFO_INITIALIZER;
size_t size = (size_t)(pFilter->filterInfo.len/TSDB_NCHAR_SIZE);
return WCSPatternMatch((uint32_t *) pFilter->filterInfo.pz, size, (uint32_t *) varDataVal(minval), varDataLen(minval)/TSDB_NCHAR_SIZE, &info) == TSDB_PATTERN_MATCH;
return WCSPatternMatch((uint32_t *) pFilter->filterInfo.pz, (uint32_t *) varDataVal(minval), varDataLen(minval)/TSDB_NCHAR_SIZE, &info) == TSDB_PATTERN_MATCH;
} else {
return false;
}
......
......@@ -44,7 +44,7 @@ typedef struct SPatternCompareInfo {
int patternMatch(const char *pattern, const char *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);
int WCSPatternMatch(const uint32_t *pattern, 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);
......
......@@ -386,10 +386,10 @@ taosWcscspn (const uint32_t *wcs, const uint32_t *reject)
return count;
}
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 matchOne = L'_'; // "_"
wchar_t matchAll = L'%'; // "%"
int WCSPatternMatch(const uint32_t *patterStr, const uint32_t *str, size_t size, const SPatternCompareInfo *pInfo) {
uint32_t c, c1;
uint32_t matchOne = (uint32_t) L'_'; // "_"
uint32_t matchAll = (uint32_t) L'%'; // "%"
int32_t i = 0;
int32_t j = 0;
......@@ -415,7 +415,7 @@ int WCSPatternMatch(const uint32_t *patterStr, size_t paSize, const uint32_t *st
break;
}
int32_t ret = WCSPatternMatch(&patterStr[i], paSize - i - 1, ++str, size - n - 1, pInfo);
int32_t ret = WCSPatternMatch(&patterStr[i], ++str, size - n - 1, pInfo);
if (ret != TSDB_PATTERN_NOMATCH) {
return ret;
}
......@@ -530,9 +530,7 @@ int32_t compareWStrPatternComp(const void* pLeft, const void* pRight) {
memcpy(pattern, varDataVal(pRight), varDataLen(pRight));
memcpy(str, varDataVal(pLeft), size * sizeof(wchar_t));
size_t len = varDataLen(pRight)/TSDB_NCHAR_SIZE;
int32_t ret = WCSPatternMatch((uint32_t *)pattern, len, (uint32_t *)str, size, &pInfo);
int32_t ret = WCSPatternMatch((uint32_t *)pattern, (uint32_t *)str, size, &pInfo);
free(pattern);
free(str);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册