microsoft / ODBC-Specification

Microsoft ODBC Specification
Other
121 stars 40 forks source link

Interrupted fetches and shared descriptors #90

Open matthew-wozniczka opened 7 years ago

matthew-wozniczka commented 7 years ago

How does sharing descriptors (as 'explicit ARDs') interact with the new feature of SQLFetch & SQLFetchScroll being interruptible?

For example, if two statements share an ARD, and the first statement calls SQLFetch, which returns SQL_METADATA_CHANGED, and then the second statement calls SQLFetch. The only reasonable option I see (to prevent deadlocks) is to have the second fetch error out.

Another related issue is that since SQLSetDescField is applied on the descriptor handle rather than the containing statement handle, allowing it during an interrupted fetch (to modify bindings/etc) leaves a small window of opportunity for another thread to call it and 'luckily' not see an error. I suppose this is already dangerous in ODBC 3.8 though

mikepizzo commented 7 years ago

Should protect against this in the DM.