As the title says, the driver fails connecting on a RHEL 5-64bit system in a custom directory, running tdxodbc64, and gives the above error, like so:
Enter Data Source Name: DSNtest
Enter UserID: jkoenes
Connecting with SQLConnect(DSN=DSNtest,UID=jkoenes,PWD=*)...
adhoc: (SQL Diagnostics) STATE=IM004, CODE=0, MSG=[DataDirect][ODBC lib] Driver's SQLAllocHandle on SQL_HANDLE_ENV failed
ODBC connection closed.
The same with a simple Perl script, using dbi and DBD::ODBC
$connection = DBI->connect('dbi:ODBC:DSNtest','jkoenes','*******
My odbc.ini file looks like so:
13 Description=Teradata Test Database with Teradata ODBC 15.10
14 DBCName=<ip address>
And my odbcinst.ini like so:
1 [ODBC DRIVERS]
6 Description=Teradata ODBC 15.10
Both are located in my home directory, with a preceding dot, and my LD_LIBRARY_PATH is already set to look at the install directory for tdodbc.
Doing an strace of these, and I ran into two interesting parts:
472 5512 open("H\215\203\370\20/15.10/odbc_64/msg/tdodbc", O_RDONLY) = -1 ENOENT (No such file or directory)
473 5512 open("H\215\203\370\20/15.10/odbc_64/msg/tdodbc.ca
t", O_RDONLY) = -1 ENOENT (No such file or directory)
and the log error with it that could be a hint:
480 5512 sendto(3, "<12>Aug 13 13:55:16 tdodbc: connect.cpp SQLAllocEnv 1 : Could not open message filetdodbc", 96, MSG_NOSIGNAL, NULL, 0) = 96
In hindsight, the tdxodbc64 program was throwing "free() invalid pointer" errors until I set MALLOC_CHECK_=0, and I realized it was because the above tdodbc files couldn't be found. I don't know what is causing the SQLAllocHandle error, but the above lines seem to be a good start. I've tried setting NSLPATH to the directory where the .cat files are, but it had no affect on the above lines. I've also double checked that all dependencies were satisfied, so I am 99.9999999% sure it's not a dependency issue. Any help at all on this matter would be wonderful.
Were you ever able to determine the source of this issue? I am getting the same error on an installation for CentOS 7 with the 15.10 driver.
I'm interested as well -- I get this error trying to conenct with PHP/IIS. The DSN works file for SQL Assistant and Excel can connect to it :(