RekTai opened a new issue, #55816:
URL: https://github.com/apache/arrow/issues/55816

   ### Describe the enhancement requested
   
   SQLCancel currently wraps the call in a bare try/catch and returns SQL_ERROR 
without posting anything to the statement's Diagnostics, so 
SQLGetDiagRec/SQLGetDiagField return nothing useful after a failed cancel.
   
   Per the [ODBC 
spec](https://learn.microsoft.com/en-us/sql/odbc/reference/syntax/sqlcancel-function?view=sql-server-ver17#diagnostics),
 when SQLCancel cancels a function running on another thread (our primary use 
case — interrupting a blocked SQLFetch from another thread), no diagnostic 
information is required. But for other failure cases (e.g. a genuine internal 
error), the spec expects a diagnostic record with an appropriate SQLSTATE 
(HY000, HY001, etc.).
   
   SQLCancel was deliberately implemented without ExecuteWithDiagnostics (see 
[dremio/arrow#167](https://github.com/dremio/arrow/pull/167)) to avoid lock 
contention and a shared-diagnostics race with an in-progress SQLFetch. 
Implementing proper diagnostics here needs a way to post to Diagnostics that's 
safe to call concurrently with the statement's normal diagnostics usage, 
without reintroducing that same lock contention.
   
   ### Component(s)
   
   C++, FlightRPC


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to