Skip to content

Commit 7cff386

Browse files
authored
Merge pull request #21 from JLY2015/master
bugfix: query async next need init before using resultSet
2 parents b3e1042 + a2fed49 commit 7cff386

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/main/java/com/alipay/oceanbase/rpc/stream/async/ObTableQueryAsyncClientResultSet.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ public ObTableQueryAsyncClientResultSet(ObTableClientQueryAsyncImpl obTableClien
5252
public boolean next() throws Exception {
5353
boolean res = false;
5454
// 对于分区/非分区表,从第一个分区0开始,在每个分区内都执行init和next;如此迭代每一个分区。直到isHasMore=false且分区都遍历完
55-
if (cur < partitionIndex || resultSet.isHasMore() || partitionIndex == 0) {
55+
if (cur < partitionIndex || partitionIndex == 0 || resultSet == null
56+
|| resultSet.isHasMore()) {
5657
if (resultSet == null) {
5758
resultSet = this.obTableClientQueryAsync.getTableQuery()
5859
.executeInit(lists.get(cur));
@@ -124,4 +125,4 @@ public void init() throws Exception {
124125
public void close() throws Exception {
125126
resultSet.getQueryStreamResult().close();
126127
}
127-
}
128+
}

0 commit comments

Comments
 (0)