11# ------------------------------------------------------------------------------
2- # Copyright (c) 2020, 2024 , Oracle and/or its affiliates.
2+ # Copyright (c) 2020, 2025 , Oracle and/or its affiliates.
33#
44# This software is dual-licensed to you under the Universal Permissive License
55# (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl and Apache License
@@ -269,13 +269,30 @@ cdef class AsyncThinCursorImpl(BaseThinCursorImpl):
269269 message = self ._create_message(FetchMessage, cursor)
270270 await self ._conn_impl._protocol._process_single_message(message)
271271
272+ async def _preprocess_execute_async(self , object conn):
273+ """
274+ Performs the necessary steps required before actually executing the
275+ statement associated with the cursor.
276+ """
277+ cdef:
278+ ThinVarImpl var_impl
279+ BindInfo bind_info
280+ ssize_t idx
281+ self ._preprocess_execute(conn)
282+ for bind_info in self ._statement._bind_info_list:
283+ var_impl = bind_info._bind_var_impl
284+ if var_impl._coroutine_indexes is not None :
285+ for idx in var_impl._coroutine_indexes:
286+ var_impl._values[idx] = await var_impl._values[idx]
287+ var_impl._coroutine_indexes = None
288+
272289 async def execute(self , cursor):
273290 cdef:
274291 object conn = cursor.connection
275292 BaseAsyncProtocol protocol
276293 MessageWithData message
277294 protocol = < BaseAsyncProtocol> self ._conn_impl._protocol
278- self ._preprocess_execute (conn)
295+ await self ._preprocess_execute_async (conn)
279296 message = self ._create_message(ExecuteMessage, cursor)
280297 message.num_execs = 1
281298 await protocol._process_single_message(message)
@@ -294,7 +311,7 @@ cdef class AsyncThinCursorImpl(BaseThinCursorImpl):
294311
295312 # set up message to send
296313 protocol = < BaseAsyncProtocol> self ._conn_impl._protocol
297- self ._preprocess_execute (cursor.connection)
314+ await self ._preprocess_execute_async (cursor.connection)
298315 message = self ._create_message(ExecuteMessage, cursor)
299316 message.num_execs = num_execs
300317 message.batcherrors = batcherrors
0 commit comments