[CP] [to #42455410] fixed ref_cursor initial position in fetch

This commit is contained in:
LiuYoung00
2023-02-07 17:06:09 +08:00
committed by ob-robot
parent e17b3a08ab
commit 8cf30417c2

View File

@ -397,6 +397,12 @@ int ObMPStmtFetch::response_result(pl::ObPLCursorInfo &cursor,
LOG_WARN("cursor result set is null.", K(ret), K(cursor.get_id()));
} else {
ObSPICursor *spi_cursor = cursor.get_spi_cursor();
// ps cursor position is be record in current_position
// ref cursor position is be record in get_spi_cursor()->cur_
if (!cursor.is_ps_cursor() && cursor.get_spi_cursor()->cur_ > 0
&& cursor.get_current_position() != cursor.get_spi_cursor()->cur_) {
cursor.set_current_position(cursor.get_spi_cursor()->cur_ - 1);
}
cur = cursor.get_current_position();
max_count = spi_cursor->row_store_.get_row_cnt();
if (max_count > 0) {