mihaibudiu commented on code in PR #5141:
URL: https://github.com/apache/calcite/pull/5141#discussion_r3700090321
##########
core/src/main/java/org/apache/calcite/util/NlsString.java:
##########
@@ -185,10 +186,42 @@ private NlsString(@Nullable String stringValue, @Nullable
ByteString bytesValue,
}
@Override public int compareTo(NlsString other) {
+ // String content: ("abc",X) vs ("xyz",Y) -> not equal, return
+ int cmp;
if (collation != null && collation.getCollator() != null) {
- return collation.getCollator().compare(getValue(), other.getValue());
+ cmp = collation.getCollator().compare(getValue(), other.getValue());
+ } else {
+ cmp = getValue().compareTo(other.getValue());
+ }
+ if (cmp != 0) {
+ return cmp;
+ }
+
+ // Charset: ("hello","LATIN1") vs ("hello","UTF-8") -> not equal
Review Comment:
Please no such comments about past bugs. They will make no sense to future
readers.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]