HBASE-2928 Fault in logic in BinaryPrefixComparator leads to ArrayIndexOutOfBoundsException (pranav via jgray)
git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@986969 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
0e481c64e8
commit
5e9f6d1528
|
@ -480,6 +480,8 @@ Release 0.21.0 - Unreleased
|
|||
(Libor Dener via Stack)
|
||||
HBASE-2923 Deadlock between HRegion.internalFlushCache and close
|
||||
HBASE-2927 BaseScanner gets stale HRegionInfo in some race cases
|
||||
HBASE-2928 Fault in logic in BinaryPrefixComparator leads to
|
||||
ArrayIndexOutOfBoundsException (pranav via jgray)
|
||||
|
||||
IMPROVEMENTS
|
||||
HBASE-1760 Cleanup TODOs in HTable
|
||||
|
|
|
@ -42,8 +42,12 @@ public class BinaryPrefixComparator extends WritableByteArrayComparable {
|
|||
|
||||
@Override
|
||||
public int compareTo(byte [] value) {
|
||||
return Bytes.compareTo(this.value, 0, this.value.length, value, 0,
|
||||
this.value.length);
|
||||
if (this.value.length <= value.length) {
|
||||
return Bytes.compareTo(this.value, 0, this.value.length, value, 0,
|
||||
this.value.length);
|
||||
} else {
|
||||
return Bytes.compareTo(this.value, value);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -20,9 +20,7 @@
|
|||
|
||||
package org.apache.hadoop.hbase.filter;
|
||||
|
||||
import org.apache.hadoop.hbase.HConstants;
|
||||
import org.apache.hadoop.hbase.KeyValue;
|
||||
import org.apache.hadoop.hbase.KeyValue.Type;
|
||||
import org.apache.hadoop.hbase.util.Bytes;
|
||||
|
||||
import java.io.DataOutput;
|
||||
|
|
Loading…
Reference in New Issue