Skip to content

Commit 325e25a

Browse files
committed
fix LSBatch in HBase mode, pass getPartition self-testing
1 parent 4bf91e3 commit 325e25a

File tree

4 files changed

+268
-10
lines changed

4 files changed

+268
-10
lines changed

src/main/java/com/alipay/oceanbase/rpc/mutation/BatchOperation.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -319,8 +319,9 @@ private void negateHbaseTimestamp(Mutation mutation) {
319319
if (rowKey == null || rowKey.size() != 3) {
320320
throw new IllegalArgumentException("hbase rowkey length must be 3");
321321
} else {
322-
long ts = ((long) ((ObObj) mutation.getRowKeyValues().get(2)).getValue());
323-
((ObObj) mutation.getRowKeyValues().get(2)).setValue(-ts);
322+
long ts = (long) mutation.getRowKeyValues().get(2);
323+
ObObj mutationObObj = new ObObj();
324+
mutationObObj.setValue(-ts);
324325
}
325326
}
326327
}

src/main/java/com/alipay/oceanbase/rpc/protocol/payload/impl/column/ObGeneratedColumnSubStrFunc.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
package com.alipay.oceanbase.rpc.protocol.payload.impl.column;
1919

2020
import com.alipay.oceanbase.rpc.protocol.payload.impl.ObCollationType;
21+
import com.alipay.oceanbase.rpc.util.ObVString;
2122
import com.alipay.oceanbase.rpc.util.Serialization;
2223

2324
import java.util.ArrayList;
@@ -154,6 +155,8 @@ public Object evalValue(ObCollationType collationType, Object... refs)
154155
evalBytes = ((String) ref).getBytes(UTF_8);
155156
} else if (ref instanceof byte[]) {
156157
evalBytes = (byte[]) ref;
158+
} else if (ref instanceof ObVString) {
159+
evalBytes = (((ObVString) ref).getStringVal()).getBytes(UTF_8);
157160
} else {
158161
throw new IllegalArgumentException(
159162
"Object ["

src/test/java/com/alipay/oceanbase/rpc/ODPGetPartitionMetaTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,7 @@ public void testReFetchPartitionMeta() throws Exception {
556556
.addScanRange(new Object[] { 1, "c2_val1" },
557557
new Object[] { 2000, "c2_val1" })
558558
.select("c1", "c2", "c3", "c4").execute();
559-
Assert.assertEquals(rowCnt + 1, result.cacheSize());
559+
Assert.assertEquals(rowCnt, result.cacheSize());
560560
// need to manually breakpoint here to change table schema in database
561561
result = client.query("testRange")
562562
.addScanRange(new Object[] { 1, "c2_val1" },

0 commit comments

Comments
 (0)