Skip to content

Commit 058e572

Browse files
committed
fix bug
1 parent 4dc810c commit 058e572

File tree

4 files changed

+12
-13
lines changed

4 files changed

+12
-13
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,7 @@ private BatchOperationResult executeWithNormalBatchOp() throws Exception {
197197
throw new IllegalArgumentException("table name is null");
198198
}
199199
TableBatchOps batchOps = client.batch(tableName);
200+
batchOps.setEntityType(entityType);
200201
boolean hasSetRowkeyElement = false;
201202

202203
for (Object operation : operations) {
@@ -276,7 +277,6 @@ private BatchOperationResult executeWithNormalBatchOp() throws Exception {
276277
throw new ObTableException("unknown operation " + operation);
277278
}
278279
}
279-
batchOps.setEntityType(entityType);
280280
batchOps.setAtomicOperation(isAtomic);
281281
batchOps.setReturnOneResult(returnOneResult);
282282
return new BatchOperationResult(batchOps.executeWithResult());
@@ -292,6 +292,7 @@ private BatchOperationResult executeWithLSBatchOp() throws Exception {
292292

293293
if (client instanceof ObTableClient) {
294294
batchOps = new ObTableClientLSBatchOpsImpl(tableName, (ObTableClient) client);
295+
batchOps.setEntityType(entityType);
295296
for (Object operation : operations) {
296297
if (operation instanceof CheckAndInsUp) {
297298
checkAndInsUpCnt++;
@@ -342,7 +343,6 @@ private BatchOperationResult executeWithLSBatchOp() throws Exception {
342343
batchOps.setReturningAffectedEntity(withResult);
343344
batchOps.setReturnOneResult(returnOneResult);
344345
batchOps.setAtomicOperation(isAtomic);
345-
batchOps.setEntityType(entityType);
346346
return new BatchOperationResult(batchOps.executeWithResult());
347347
}
348348

src/main/java/com/alipay/oceanbase/rpc/protocol/payload/impl/execute/ObTableOperationType.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public enum ObTableOperationType {
3434

3535
private int value;
3636
private static Map<Integer, ObTableOperationType> map = new HashMap<Integer, ObTableOperationType>();
37-
private static final List<Boolean> needEncodeQuery = Arrays.asList(false, // GET
37+
private static final List<Boolean> needEncodeQuery = Arrays.asList(true, // GET
3838
false, // INSERT
3939
false, // DEL
4040
false, // UPDATE

src/main/java/com/alipay/oceanbase/rpc/protocol/payload/impl/execute/ObTableSingleOpQuery.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -242,8 +242,10 @@ public void adjustScanRangeColumns(Map<String, Long> columnNameIdxMap) {
242242
adjustStartKey.add(startKey.get((int) pair.origin_idx));
243243
adjustEndtKey.add(endKey.get((int) pair.origin_idx));
244244
}
245-
range.getStartKey().setObjs(adjustStartKey);
246-
range.getEndKey().setObjs(adjustEndtKey);
245+
if (!adjustStartKey.isEmpty() && !adjustEndtKey.isEmpty()) {
246+
range.getStartKey().setObjs(adjustStartKey);
247+
range.getEndKey().setObjs(adjustEndtKey);
248+
}
247249
}
248250

249251
this.scanRangeBitMap = byteArray;

src/main/java/com/alipay/oceanbase/rpc/table/ObTableClientLSBatchOpsImpl.java

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -200,14 +200,11 @@ public void addOperation(TableQuery query) throws Exception {
200200
ObTableSingleOp singleOp = new ObTableSingleOp();
201201
if (entityType == ObTableEntityType.HKV) {
202202
ObTableQuery obTableQuery = query.getObTableQuery();
203-
ObTableSingleOpQuery singleOpQuery = ObTableSingleOpQuery.getInstance(obTableQuery.getIndexName(),
204-
obTableQuery.getKeyRanges(),
205-
obTableQuery.getSelectColumns(),
206-
obTableQuery.getScanOrder(),
207-
obTableQuery.isHbaseQuery(),
208-
obTableQuery.gethTableFilter(),
209-
obTableQuery.getObKVParams(),
210-
obTableQuery.getFilterString());
203+
ObTableSingleOpQuery singleOpQuery = ObTableSingleOpQuery.getInstance(
204+
obTableQuery.getIndexName(), obTableQuery.getKeyRanges(),
205+
obTableQuery.getSelectColumns(), obTableQuery.getScanOrder(),
206+
obTableQuery.isHbaseQuery(), obTableQuery.gethTableFilter(),
207+
obTableQuery.getObKVParams(), obTableQuery.getFilterString());
211208
singleOp.setQuery(singleOpQuery);
212209
}
213210
singleOp.setSingleOpType(ObTableOperationType.GET);

0 commit comments

Comments
 (0)