ODBC problem with R13B01 in OpenBSD 4.5 amd64

Nikolay Epifanov nik.epifanov@REDACTED
Thu Aug 6 10:23:57 CEST 2009


Hi,

while trying to connect I get:

Erlang R13B01 (erts-5.7.2) [source] [64-bit] [smp:4:4] [rq:4]
[async-threads:0] [kernel-poll:false]

Eshell V5.7.2  (abort with ^G)
1> odbc:start().
ok
2> {ok, Ref} = odbc:connect("DSN=pc-backend", [{scrollable_cursors,off}]).

=ERROR REPORT==== 6-Aug-2009::11:20:21 ===
** Generic server <0.39.0> terminating
** Last message in was {<0.32.0>,
                        {connect,[1,1,2,2,1,"DSN=pc-backend"],on,off},
                        infinity}
** When Server state == {state,#Port<0.546>,
                               {<0.32.0>,#Ref<0.0.0.35>},

<0.32.0>,undefined,on,undefined,undefined,off,
                               connecting,undefined,0,
                               [#Port<0.544>,#Port<0.545>],
                               undefined,undefined}
** Reason for termination ==
** timeout
** exception error: no match of right hand side value
{error,connection_closed}

Same error for both iodbc and unixODBC.
Actually odbcserver exits in (lib/odbc/c_src/odbcserver.c:1646)  WIN32
version of connect_to_erlang after receiving ECONNREFUSED for "connect(sock,
(struct sockaddr*)&sin, sizeof(sin)". This WIN32 function enforced with
#define USE_IPV4. I switched to UNIX one and at least connects and queries
started working. The patch that made this change is
http://www1.erlang.org/pipermail/erlang-bugs/2007-October/000486.html
Why does the WIN32 function have to be used? Is it ok to use UNIX version?


More information about the erlang-bugs mailing list