Open TikhonJelvis opened 7 years ago
I got the same. Tested with GHC 8.0.1
and 7.10.3
.
I got the same using the included stack.yaml and the hdbc-odbc repo as of 00edd61 by following the example in the Readme to test hdbc-odbc using sqlite3.
resolver: lts-3.17
extra-deps:
- HDBC-2.4.0.1
System info:
unixodbc-dev version: 2.3.1-4.1
@TikhonJelvis and @dmvianna I fixed this by ensuring I had DSN=
prepending the DSN name.
λ> connectODBC
connectODBC :: String -> IO Connection
λ> conn <- connectODBC "testsqlite3"
*** Exception: SqlError {seState = "[\"*** Exception: Prelude.chr: bad argument: 5046345
λ> conn <- connectODBC "DSN=testsqlite3"
λ> hdbcDriverName conn
"odbc"
Same with https://github.com/hdbc/hdbc-odbc/issues/25 ? And can you avoid it by https://github.com/hdbc/hdbc-odbc/issues/25#issuecomment-214826460
@igrep It didn't work for me:
λ> odbcTest
*** Exception: SqlError {seState = "[\"08001\",\"01000\"]", seNativeError = -1, seErrorMsg = "connectODBC/sqlDriverConnect: [\"0: [unixODBC][FreeTDS][SQL Server]Unable to connect to data source\",\"20002: [unixODBC][FreeTDS][SQL Server]Adaptive Server connection failed\"]"}
The error I got could be from other things though.
I'm consistently getting the following exception when running code talking to Hive through ODBC both from a binary and from GHCi:
On a different system, we got the same exception with a different number:
This is on GHC 8.0.1 on OS X with the latest version of HDBC and HDBC-odbc. The problem comes up at some initial part of the connection process because I get the exception even if I don't have the ODBC drivers installed or a DSN entry—it's not even trying to connect.
Here's the smallest example that causes the error. (It doesn't work with a correctly configured database either.):
Here's a stack trace: