sp_cursorprepexec may take the AllowDirect fast path: a nonzero prepared
handle, @cursor == 0, and result sets streamed inline during the RPC
response. Previously that response errored ("zero @cursor") and the
inline rows were discarded.
cursor_prep_exec now returns a typed CursorPrepExecOutcome distinguishing
a normal PreparedCursor from owned DirectResults, preserving every direct
result set's metadata and rows in order and retaining correct
prepared-handle cleanup. into_cursor/into_direct are lossless (hand back
the non-matching variant intact so no handle leaks).
Adds a row-preserving RPC collector (collect_rpc_result_sets), unit tests
for the collector and outcome logic, an offline server-smol harness test,
and a live SQL Server multi-result test.
BREAKING CHANGE: cursor_prep_exec now returns CursorPrepExecOutcome
instead of PreparedCursor.
Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
sp_cursorprepexec may take the AllowDirect fast path: a nonzero prepared handle, @cursor == 0, and result sets streamed inline during the RPC response. Previously that response errored ("zero @cursor") and the inline rows were discarded.
cursor_prep_exec now returns a typed CursorPrepExecOutcome distinguishing a normal PreparedCursor from owned DirectResults, preserving every direct result set's metadata and rows in order and retaining correct prepared-handle cleanup. into_cursor/into_direct are lossless (hand back the non-matching variant intact so no handle leaks).
Adds a row-preserving RPC collector (collect_rpc_result_sets), unit tests for the collector and outcome logic, an offline server-smol harness test, and a live SQL Server multi-result test.
BREAKING CHANGE: cursor_prep_exec now returns CursorPrepExecOutcome instead of PreparedCursor.