sashapolo commented on code in PR #5792:
URL: https://github.com/apache/ignite-3/pull/5792#discussion_r2081210199


##########
modules/schema/src/main/java/org/apache/ignite/internal/schema/BinaryTupleComparatorUtils.java:
##########
@@ -122,6 +122,12 @@ static int compareAsString(BinaryTupleReader tuple, int 
colIndex, String cmp, bo
         byte[] bytes = tuple.bytesValue(begin, begin + trimmedSize);
         char[] cmpArray = cmp.toCharArray();
 
+        if (bytes.length < trimmedSize) {
+            assert bytes.length == trimmedSize - 1 : "Only one first byte can 
have a special value.";
+
+            fullSrtLength--;

Review Comment:
   What's "srt"?



##########
modules/schema/src/test/java/org/apache/ignite/internal/schema/BinaryTupleComparatorTest.java:
##########
@@ -348,8 +352,16 @@ public void partialComparatorAsciiTest() {
         assertTrue(partialBinaryTupleMatcher.match(tuple3, tupleReference) > 
0);
         assertEquals(0, 
partialBinaryTupleMatcher.match(tuple1.limit(8).slice().order(ByteOrder.LITTLE_ENDIAN),
 tupleReference));
         
assertTrue(partialBinaryTupleMatcher.match(tuple2.limit(8).slice().order(ByteOrder.LITTLE_ENDIAN),
 tupleReference) > 0);
+        assertTrue(partialBinaryTupleMatcher.match(
+                tuple2.limit(8).slice().order(ByteOrder.LITTLE_ENDIAN),

Review Comment:
   Where do these limit values come from?



##########
modules/schema/src/main/java/org/apache/ignite/internal/schema/BinaryTupleComparatorUtils.java:
##########
@@ -122,6 +122,12 @@ static int compareAsString(BinaryTupleReader tuple, int 
colIndex, String cmp, bo
         byte[] bytes = tuple.bytesValue(begin, begin + trimmedSize);
         char[] cmpArray = cmp.toCharArray();
 
+        if (bytes.length < trimmedSize) {

Review Comment:
   Please add a comment that this "if" does and why it is needed



-- 
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: notifications-unsubscr...@ignite.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to