[erlang-questions] odbc problem (revived from 2005-04, archive)

Ingela Anderton Andin ingela@REDACTED
Mon Dec 18 17:58:00 CET 2006

> Any news about odbc:param_query on windows? (Beyond the obvious "don't use
> it" that is) 
> That 20 months and several releases (and more if we take Ingela's response
> to mean that it had been known to be broken for some time before Anders
> actually reported it) hasn't solved this elusive mystery yet is a worry of
> note.

Well yes, I actually found that bug now :). It was a week ago or so when it finally made the
top of the priority list, after my return from parental leave (which I am afraid prolonged the process).
So now you can go ahead and us it. Well as soon as you get the next open source release that is ;)  

> By the looks of it the problem relates not to the odbc code itself but to
> the socket communication between port driver and erlang, the likes of which
> are used far and wide. Finding the cause of this might help many drivers
> that essentially used odbcserver.c as a reference for implementing a port
> driver (like I oh-so-nearly did) or maybe someone did just that and
> subsequently ran into the same bug has already identified and resolved the
> cause of the problem in which case fixing odbcserver.c might become a
> doddle.

Well pointer errors are nasty things that may seem to relate the problem to things
that are not at all related. It had nothing to do with the socket communication. 
Maybe I should point out that the reason the odbc-portprogram uses socket communication at
all and not uses the normal erlang-port-mechanism, except for initially, is that some odbc-drivers have done
unexpected things with stdin/stdout causing unexpected messages to be received by the erlang side.

Regards Ingela - OTP team

One year and eight months ago Ingela Anderton wrote:

> > One year and eight months ago Anders Nygren wrote:
>> > > Hi 
>> > > I am trying to use odbc and have run into a strange problem.
>> > > Using R10B-2 on Windows XP, with Microsoft SQL Server2000.
> > The data is inserted in the table on the sql server but for some
> > reason the connection is lost.
> > Well you must be the first one that tried to use parameterized queries
> > on a windows platform. Our automated test cases for parameterized
> > queries have failed on windows for some time (works fine on solaris),
> > but before I wrote the new configure script I could not reproduce the
> > fault. When I built only the odbc application the old way it always
> > worked. Now I can reproduce it but if I try to debug compile it to
> > get some more information it starts working again. All efforts so far
> > has alas led nowhere. The exit code indicates that the c function
> > send/4 that sends a message on a socket has failed returning -1 which
> > suggest something else has gone wrong and somehow messes up the input to
> > send. I was hoping we would have found the problem by now but as it
> > does not have top priority it might be time to at least document it
> > as an known problem!
> > 
>> > > I have tried to trace the odbc driver with {trace_driver,on}
>> > > but it does not look very interesting, (but what do I know),
>> > > I have attatched it anyway.
> > Well thank you I am not sure it will help but I will take a look at
> > it you never know! A problem though is that I have many other things to
> > do the are higher prioritized so it might take a while before I have
> > time to really investigate this further.
> > 
> > [...]
>> > > ** {port_exit,socket_send_message_body_failed}
> > [...]
> > 
> > -- 
> > /Ingela - OTP team

More information about the erlang-questions mailing list