Re: iodbc and psqlodbc

From: "Thomas G(dot) Lockhart" <lockhart(at)alumni(dot)caltech(dot)edu>
To: Gerald Gryschuk <ggryschuk(at)scf(dot)sk(dot)ca>
Cc: Postgres Interfaces Mailing List <pgsql-interfaces(at)postgresql(dot)org>
Subject: Re: iodbc and psqlodbc
Date: 1998-08-19 15:49:03
Message-ID: 35DAF3EF.69D52B7@alumni.caltech.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces

> Can't help yet on how to solve your problem, but I'll send you the
> source to a test program that I've just started using to track down
> interaction problems with iodbc and psqlodbc. At the moment I'm
> completely confused as to why iodbc seems to call some of its own SQL
> functions when it should be calling the driver manager's functions. A
> version of this problem appeared in the past where the driver would
> make a SQL call thinking it was calling an internal function and by
> some miracle would end up calling the iodbc's function(which it
> shouldn't even know about). Anyway, we "fixed" that by using some
> "stub" calls internally but the problem seems to have reared its ugly
> head again. I don't know exactly how much time I can spend on this so
> I figure if more than one person is working on this than we may fix
> the problem sooner.

Sounds good, and it's pretty clear that this is the problem I'm seeing.
I'm not sure how iodbc and psqlodbc interact, but the fact that some of
the entry points have identical names seems confusing. Are there some
instances where iodbc will try to directly call a psqlodbc routine with
one of these duplicate names, or do the entry points for the interface
between the two layers have unique names? If so, then couldn't I just
rename some of the psqlodbc routines, at least to show how this works?
If it worked at all, it would only be allowable for Unix-specific
installations I suppose.

It may be that my linking step is somehow involved in this. If the iodbc
library is visible to the linker maybe things are getting statically
linked together between the packages rather than being completely
dynamic as one would hope. Will poke at that for a few minutes...

> The source I'm sending ... is simply a command line SQL
> "interpreter", actually it doesn't interpret anything it just allows
> the sending of any type of SQL command to the backend and relays the
> response. Unzip the attached file into any directory and run "make"
> than when you run the program you should get a "SQL>" prompt.

OK, I'll look at it. But I seem to be doing OK using Applix for testing;
I'm getting the startup packet transaction and will now try to find out
why the libraries are getting mixed up.

> Note, that for "full" logging you should compile psqlodbc with
> -DMY_LOG and -DQ_LOG AND you have to set Debug=1 and CommLog=1 in the
> odbcinst.ini file that should be in your /etc directory.

I'm embarrassed to say how long it took me to realize that Debug and
CommLog are _only_ settable from the /etc/odbcinst.ini file, rather than
from the ~/.odbc.ini file. Is there any reason why those flags couldn't
be allowed into the user's configuration file? Also, do these keywords
need to be case-sensitive and start in column 1 as they must now? Seems
a bit restrictive for no gain, but maybe the ODBC standard requires
this...

> I discovered how to turn on tracing in the iodbc driver manager.
> There is a bug in iodbc that makes it so that using the keyword
> "Tracefile" before "Trace" will cause "Trace" to return the value of
> "Tracefile". I've fixed the source to iodbc to not do this but until I
> can find Ke-Jin and have him fix the iodbc package I'm not going to do
> anything with that fix. The obvious work around is to use the "Trace"
> keyword before the "Tracefile" keyword.

Yes, it's pretty clear that the iodbc SQLExecute() is being called
instead of the psqlodbc SQLExecute(), and it didn't occur to me that
this could be happening (didn't even know routines in the two packages
had the same names!). Haven't had a chance to look at your test code,
but will let you know how it goes. Are you on the Postgres "Interfaces"
mailing list, or should I copy you directly on messages??

Thanks for the help!

- Tom

Browse pgsql-interfaces by date

  From Date Subject
Next Message Mateus Cordeiro Inssa 1998-08-19 15:50:52 [INTERFACES] Tcl/Tk-shell pgtksh for NT and/or the Mac
Previous Message Thomas G. Lockhart 1998-08-19 14:59:28 Re: [INTERFACES] iodbc interface on Unix