fix: conform NCHAR sort order with VARCHAR

This commit is contained in:
Alex Duan 2023-01-03 17:39:00 +08:00
parent 5660199016
commit bb6c875765
1 changed files with 9 additions and 8 deletions

View File

@ -23,6 +23,7 @@
#include "thash.h"
#include "tlog.h"
#include "types.h"
#include "osString.h"
int32_t setChkInBytes1(const void *pLeft, const void *pRight) {
return NULL != taosHashGet((SHashObj *)pRight, pLeft, 1) ? 1 : 0;
@ -208,16 +209,16 @@ int32_t compareLenPrefixedWStr(const void *pLeft, const void *pRight) {
int32_t len1 = varDataLen(pLeft);
int32_t len2 = varDataLen(pRight);
if (len1 != len2) {
return len1 > len2 ? 1 : -1;
} else {
int32_t ret = memcmp((TdUcs4 *)pLeft, (TdUcs4 *)pRight, len1);
int32_t ret = tasoUcs4Compare(varDataVal(pLeft), varDataVal(pRight), len1>len2 ? len2:len1);
if (ret == 0) {
if (len1 > len2)
return 1;
else if(len1 < len2)
return -1;
else
return 0;
} else {
return ret > 0 ? 1 : -1;
}
}
return (ret < 0) ? -1 : 1;
}
int32_t compareLenPrefixedWStrDesc(const void *pLeft, const void *pRight) {