Skip to content

Commit

Permalink
Fix hdbc#14
Browse files Browse the repository at this point in the history
@derrickturk has identified (derrickturk@99cbefb) that, in the case of the MS Access driver, the `BufferLength` argument of function `SQLGetInfo` cannot be ignored (set to 0), despite what is implied by the Microsoft documentation (https://docs.microsoft.com/en-us/sql/odbc/reference/syntax/sqlgetinfo-function?view=sql-server-2017).

`InfoType` `SQL_TXN_CAPABLE` returns a `SQLUSMALLINT` value and the `BufferLength` must be set accordingly.
  • Loading branch information
derrickturk authored and mpilgrem committed Aug 31, 2019
1 parent 06833d7 commit b3f2786
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Database/HDBC/ODBC/Connection.hsc
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ mkConn args iconn = withDbcOrDie iconn $ \cconn ->
clientname <- peekCStringLen (pbuf, fromIntegral len)

sqlGetInfo cconn #{const SQL_TXN_CAPABLE} (castPtr psqlusmallint)
0 nullPtr
#{size SQLUSMALLINT} nullPtr
>>= checkError "sqlGetInfo SQL_TXN_CAPABLE" (DbcHandle cconn)
txninfo <- ((peek psqlusmallint)::IO (#{type SQLUSMALLINT}))
let txnsupport = txninfo /= #{const SQL_TC_NONE}
Expand Down

0 comments on commit b3f2786

Please sign in to comment.