Skip to content

Commit 4ce9751

Browse files
committed
pick fix 3.x null exception
1 parent 7693544 commit 4ce9751

File tree

2 files changed

+17
-5
lines changed

2 files changed

+17
-5
lines changed

src/main/java/com/alipay/oceanbase/rpc/ObTableClient.java

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1642,11 +1642,21 @@ public ObPair<Long, ObTableParam> getTable(String tableName, ObTableQuery query,
16421642
Object[] start = new Object[startKeySize];
16431643
Object[] end = new Object[endKeySize];
16441644
for (int i = 0; i < startKeySize; i++) {
1645-
start[i] = startKey.getObj(i).getValue();
1645+
ObObj curStart = startKey.getObj(i);
1646+
if (curStart.isMinObj()) {
1647+
start[i] = curStart;
1648+
} else {
1649+
start[i] = curStart.getValue();
1650+
}
16461651
}
16471652

16481653
for (int i = 0; i < endKeySize; i++) {
1649-
end[i] = endKey.getObj(i).getValue();
1654+
ObObj curEnd = endKey.getObj(i);
1655+
if (curEnd.isMaxObj()) {
1656+
end[i] = curEnd;
1657+
} else {
1658+
end[i] = curEnd.getValue();
1659+
}
16501660
}
16511661
ObBorderFlag borderFlag = rang.getBorderFlag();
16521662
List<ObPair<Long, ObTableParam>> pairList = getTables(tableName, query, start,

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
import com.alipay.oceanbase.rpc.protocol.payload.impl.execute.ObTableEntityType;
3434
import com.alipay.oceanbase.rpc.protocol.payload.impl.execute.ObTableStreamRequest;
3535
import com.alipay.oceanbase.rpc.protocol.payload.impl.execute.QueryStreamResult;
36+
import com.alipay.oceanbase.rpc.protocol.payload.impl.execute.syncquery.ObTableQueryAsyncRequest;
3637
import com.alipay.oceanbase.rpc.protocol.payload.impl.execute.syncquery.ObTableQueryAsyncResult;
3738
import com.alipay.oceanbase.rpc.table.ObTable;
3839
import com.alipay.oceanbase.rpc.table.ObTableParam;
@@ -230,9 +231,10 @@ protected ObPayload commonExecute(ObTableClient client, Logger logger,
230231
}
231232
} else if (e instanceof ObTableException) {
232233
if ((((ObTableException) e).getErrorCode() == ResultCodes.OB_TABLE_NOT_EXIST.errorCode || ((ObTableException) e)
233-
.getErrorCode() == ResultCodes.OB_NOT_SUPPORTED.errorCode)
234-
&& ((ObTableQueryRequest) request).getTableQuery().isHbaseQuery()
235-
&& client.getTableGroupInverted().get(indexTableName) != null) {
234+
.getErrorCode() == ResultCodes.OB_NOT_SUPPORTED.errorCode)
235+
&& ((request instanceof ObTableQueryAsyncRequest && ((ObTableQueryAsyncRequest) request).getObTableQueryRequest().getTableQuery().isHbaseQuery())
236+
|| (request instanceof ObTableQueryRequest && ((ObTableQueryRequest) request).getTableQuery().isHbaseQuery()))
237+
&& client.getTableGroupInverted().get(indexTableName) != null) {
236238
// table not exists && hbase mode && table group exists , three condition both
237239
client.eraseTableGroupFromCache(tableName);
238240
}

0 commit comments

Comments
 (0)