Skip to content

Commit 49e2e73

Browse files
committed
Fix Feature test.
1 parent 2a7ffa1 commit 49e2e73

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

web/pgadmin/tools/sqleditor/__init__.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1258,8 +1258,10 @@ def fetch_window(trans_id, from_rownum=0, to_rownum=0):
12581258
# rownums start from 0 but UI will ask from 1
12591259
# to_rownum: Fetch 1 extra row to check whether next
12601260
# recordset is available or not, this is required for server cursor.
1261+
12611262
status, result = conn.async_fetchmany_2darray(
1262-
records=None, from_rownum=from_rownum - 1, to_rownum=to_rownum)
1263+
records=None, from_rownum=from_rownum - 1, to_rownum=to_rownum if
1264+
trans_obj.server_cursor else to_rownum - 1)
12631265
if not status:
12641266
status = 'Error'
12651267
else:
@@ -1279,9 +1281,10 @@ def fetch_window(trans_id, from_rownum=0, to_rownum=0):
12791281

12801282
# Check whether the next recordset/page is available or not
12811283
next_page = 0
1282-
if len(result) > 0 and len(result) > page_size:
1284+
if trans_obj.server_cursor and len(result) > 0 and len(result) > page_size:
12831285
result = result[0:len(result) - 1]
12841286
next_page = 1
1287+
rows_fetched_to = rows_fetched_to - 1
12851288

12861289
pagination = {
12871290
'page_size': page_size,

0 commit comments

Comments
 (0)