Skip to content

Commit b2cc94a

Browse files
committed
[fix][fe] Inconsistent behavior for string comparison in FE and BE
Signed-off-by: nextdreamblue <[email protected]>
1 parent 57e248e commit b2cc94a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

fe/fe-core/src/main/java/org/apache/doris/analysis/StringLiteral.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,9 @@ public int compareLiteral(LiteralExpr expr) {
9696
int minLength = Math.min(thisBytes.length, otherBytes.length);
9797
int i = 0;
9898
for (i = 0; i < minLength; i++) {
99-
if (thisBytes[i] < otherBytes[i]) {
99+
if (Byte.toUnsignedInt(thisBytes[i]) < Byte.toUnsignedInt(otherBytes[i])) {
100100
return -1;
101-
} else if (thisBytes[i] > otherBytes[i]) {
101+
} else if (Byte.toUnsignedInt(thisBytes[i]) > Byte.toUnsignedInt(otherBytes[i])) {
102102
return 1;
103103
}
104104
}

0 commit comments

Comments
 (0)