fix(query): update the string order policy.
This commit is contained in:
parent
755176d28f
commit
96f21afe8f
|
@ -186,15 +186,12 @@ int32_t compareLenPrefixedStr(const void *pLeft, const void *pRight) {
|
||||||
int32_t len1 = varDataLen(pLeft);
|
int32_t len1 = varDataLen(pLeft);
|
||||||
int32_t len2 = varDataLen(pRight);
|
int32_t len2 = varDataLen(pRight);
|
||||||
|
|
||||||
if (len1 != len2) {
|
int32_t minLen = MIN(len1, len2);
|
||||||
|
int32_t ret = strncmp(varDataVal(pLeft), varDataVal(pRight), minLen);
|
||||||
|
if (ret == 0) {
|
||||||
return len1 > len2 ? 1 : -1;
|
return len1 > len2 ? 1 : -1;
|
||||||
} else {
|
} else {
|
||||||
int32_t ret = strncmp(varDataVal(pLeft), varDataVal(pRight), len1);
|
return ret > 0 ? 1 : -1;
|
||||||
if (ret == 0) {
|
|
||||||
return 0;
|
|
||||||
} else {
|
|
||||||
return ret > 0 ? 1 : -1;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue