@@ -72,7 +72,7 @@ cdef class BaseThinCursorImpl(BaseCursorImpl):
7272 message.num_execs = 1
7373 if self .scrollable:
7474 message.fetch_orientation = TNS_FETCH_ORIENTATION_CURRENT
75- message.fetch_pos = 1
75+ message.fetch_pos = self .rowcount + 1
7676 return message
7777
7878 cdef ExecuteMessage _create_scroll_message(self , object cursor,
@@ -116,7 +116,7 @@ cdef class BaseThinCursorImpl(BaseCursorImpl):
116116
117117 # build message
118118 message = self ._create_message(ExecuteMessage, cursor)
119- message.scroll_operation = self ._more_rows_to_fetch
119+ message.scroll_operation = True
120120 message.fetch_orientation = orientation
121121 message.fetch_pos = < uint32_t> desired_row
122122 return message
@@ -259,8 +259,8 @@ cdef class ThinCursorImpl(BaseThinCursorImpl):
259259 cdef:
260260 Protocol protocol = < Protocol> self ._conn_impl._protocol
261261 MessageWithData message
262- if self ._statement._sql is None :
263- message = self ._create_message(ExecuteMessage, cursor)
262+ if self ._statement._sql is None or self .scrollable :
263+ message = self ._create_execute_message( cursor)
264264 else :
265265 message = self ._create_message(FetchMessage, cursor)
266266 protocol._process_single_message(message)
@@ -357,8 +357,8 @@ cdef class AsyncThinCursorImpl(BaseThinCursorImpl):
357357 Internal method used for fetching rows from the database.
358358 """
359359 cdef MessageWithData message
360- if self ._statement._sql is None :
361- message = self ._create_message(ExecuteMessage, cursor)
360+ if self ._statement._sql is None or self .scrollable :
361+ message = self ._create_execute_message( cursor)
362362 else :
363363 message = self ._create_message(FetchMessage, cursor)
364364 await self ._conn_impl._protocol._process_single_message(message)
0 commit comments