Martin,
Using PERL_DL_NONLAZY=1.....works! And with or without having the autocommit commented out. So apparently that was a non-issue. (And for the record setting the Impala ODBC parameter EnableSimulatedTransactions=1 wasn't necessary).
The source for the ODBC drivers I'm using is at:
http://www.cloudera.com/content/cloudera/en/downloads/connectors/impala/odbc/impala-odbc-v2-5-26.html
and according to its documentation it compiles with ODBC 3.80 along with unicode and 32/64 support.
As to the rest of our environment, we're testing on a 64bit CentOS 5 system. We installed the 64bit versions for RHEL5 Impala drivers. And instead of using the stock Perl where using Perl 5.14.2 built with the following options:
config_args='-Dprefix=/tools'
hint=recommended, useposix=true, d_sigaction=define
useithreads=define, usemultiplicity=define
useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
use64bitint=define, use64bitall=define, uselongd
For the ODBC manager we've installed the stock CentOS 5 unixODBC64 and unixODBC64-devel, versions 2.2.14. We then added a link /usr/lib64/libodbc.so => libodbc.so.2.0.0 as the CentOS rpms have a link /usr/lib64/libodbc64.so => libodbc.so.2.0.0, but not the former and DBD::ODBC wasn't picking up odbc64. LD_LIBRARY_PATH is left unassigned, and we edited the cloudera.impalaodbc.ini file to use DriverManagerEncoding=UTF-16 and ODBCInstLib=libodbcinst.so as suggested by the comments in the template.
Don't know if a description of our environment helps.
-Joe
From: Martin J Evans via RT <bug-DBD-ODBC@rt.cpan.org>
To: slagelwa@yahoo.com
Sent: Saturday, May 16, 2015 1:42 AM
Subject: [rt.cpan.org #104416] Problems using Impala ODBC library with Perl
<URL:
https://rt.cpan.org/Ticket/Display.html?id=104416 >
On Fri May 15 13:37:13 2015, JSLAGEL wrote:
Show quoted text> Here's the next pass at the logs. I commented out the call to
> SQLSetConnectAttr() in the post_connect function of dbdimp.c. The
> logs show that the subsequent SQLGetInfo() calls all seem to fail. I
> checked on the server side and I do see the connection come in and it
> executes a "SHOW DATABASES" (I've included this log too).
These logs make little sense unless unixODBC is being bypassed and some calls are going straight to the driver - hence the invalid handles and the SQLError calls in the unixODBC log with no other calls logged.
Show quoted text> Oh, I should also say I can connect using isql packaged with
> unixODBC64 and everything seems to function correctly.
Firstly, isql opens an ODBC 2 connection and DBD::ODBC opens an ODBC 3 one.
Secondly, isql does not do anything other than allocate 2 handles and call SQLConnect.
I don't think it makes any SQLSetConnectAttr calls or SQLGetInfo calls at all.
DBD::ODBC moved to ODBC 3 probably more than 10 years ago. It is next to impossible to support ODBC 2 drivers now and still support ODBC 3 functionality in ODBC 3 drivers.
Show quoted text> And lastly, I got pinged back on the impala-users mailing list and was
> told there's an option, EnableSimulatedTransactions=1, which should
> help with the AutoCommit. Unfortunately that didn't seem to help the
> problem. I'm concerned that the driver log messages keep saying
> Invalid Connection handle on the subsequent SQLGetInfo() calls...
>
> -Joe
Can you try running a small connect script in Perl again (with the autocommit still commented out) but first set and export
PERL_DL_NONLAZY=1
I think what is happening is the dynamic linker is resolving SQLxxx symbols in libunixodbc.so until the ODBC driver is loaded and then SQLxxx symbols are pointing directly to the driver. unixODBC and your driver contain the same SQLxxx entry points and it is important the linker resolves them in unixodbc first.
I also note you have a non unicode build of DBD::ODBC but changing that right now might add to the complications.
I haven't got the driver you are using, does it say it supports ODBC 3? Can you point me at some documentation for the driver?
Martin
--
Martin J. Evans
Wetherby, UK