HBASE-2920 HTable.checkAndPut/Delete doesn't handle null values
git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@989296 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
6e72b3cef3
commit
7abfcbc22c
|
@ -487,6 +487,7 @@ Release 0.21.0 - Unreleased
|
|||
code, ensure we log and rethrow as IOE
|
||||
(Karthik Ranganathan via Stack)
|
||||
HBASE-2915 Deadlock between HRegion.ICV and HRegion.close
|
||||
HBASE-2920 HTable.checkAndPut/Delete doesn't handle null values
|
||||
|
||||
IMPROVEMENTS
|
||||
HBASE-1760 Cleanup TODOs in HTable
|
||||
|
|
|
@ -1473,7 +1473,8 @@ public class HRegion implements HeapSize { // , Writable{
|
|||
result = get(get);
|
||||
|
||||
boolean matches = false;
|
||||
if (result.size() == 0 && expectedValue.length == 0) {
|
||||
if (result.size() == 0 &&
|
||||
(expectedValue == null || expectedValue.length == 0)) {
|
||||
matches = true;
|
||||
} else if (result.size() == 1) {
|
||||
//Compare the expected value with the actual value
|
||||
|
|
|
@ -489,6 +489,14 @@ public class TestHRegion extends HBaseTestCase {
|
|||
res = region.checkAndMutate(row1, fam1, qf1, emptyVal, delete, lockId,
|
||||
true);
|
||||
assertTrue(res);
|
||||
|
||||
//checkAndPut looking for a null value
|
||||
put = new Put(row1);
|
||||
put.add(fam1, qf1, val1);
|
||||
|
||||
res = region.checkAndMutate(row1, fam1, qf1, null, put, lockId, true);
|
||||
assertTrue(res);
|
||||
|
||||
}
|
||||
|
||||
public void testCheckAndMutate_WithWrongValue() throws IOException{
|
||||
|
|
Loading…
Reference in New Issue