Message from discussion
Help please with DBD::ODBC on SUSE-Linux
Received: by 10.180.103.197 with SMTP id fy5mr1210237wib.1.1345335574246;
Sat, 18 Aug 2012 17:19:34 -0700 (PDT)
Newsgroups: perl.dbi.users
Path: n2ni200539376win.0!nntp.google.com!feeder3.cambriumusenet.nl!feed.tweaknews.nl!85.12.40.138.MISMATCH!xlned.com!feeder5.xlned.com!feed.xsnews.nl!border-1.ams.xsnews.nl!plix.pl!newsfeed2.plix.pl!news.mi.ras.ru!goblin2!goblin1!goblin.stu.neva.ru!feeds.phibee-telecom.net!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!nntp.develooper.com!nntp.perl.org
Return-Path: <jt...@mindspring.com>
Mailing-List: contact dbi-users-h...@perl.org; run by ezmlm
Delivered-To: mailing list dbi-us...@perl.org
Received: (qmail 5836 invoked from network); 15 Aug 2012 14:33:12 -0000
Received: from x1.develooper.com (207.171.7.70)
by x6.develooper.com with SMTP; 15 Aug 2012 14:33:12 -0000
Received: (qmail 6765 invoked by uid 225); 15 Aug 2012 14:33:11 -0000
Delivered-To: dbi-us...@perl.org
Received: (qmail 6760 invoked by alias); 15 Aug 2012 14:33:11 -0000
X-Spam-Status: No, hits=-2.0 required=8.0
tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HTML_MESSAGE,RCVD_IN_DNSWL_NONE
X-Spam-Check-By: la.mx.develooper.com
Received: from elasmtp-curtail.atl.sa.earthlink.net (HELO elasmtp-curtail.atl.sa.earthlink.net) (209.86.89.64)
by la.mx.develooper.com (qpsmtpd/0.28) with ESMTP; Wed, 15 Aug 2012 07:33:06 -0700
DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws;
s=dk20050327; d=mindspring.com;
b=YueQqtYJQiY+19ZHF24BQZRmQCgxR0xMlaMLYJK37owbtfXGA3xGX7nGMjGHqyyG;
h=Received:From:To:Cc:References:In-Reply-To:Subject:Date:Message-ID:MIME-Version:Content-Type:X-Mailer:Thread-Index:Content-Language:X-ELNK-Trace:X-Originating-IP;
Received: from [76.200.161.15] (helo=hun)
by elasmtp-curtail.atl.sa.earthlink.net with esmtpa (Exim 4.67)
(envelope-from <jt...@mindspring.com>)
id 1T1eeb-0006X7-DT; Wed, 15 Aug 2012 10:33:01 -0400
To: "'Martin J. Evans'" <martin.ev...@easysoft.com>
Cc: <dbi-us...@perl.org>
References: <006e01cd7a47$60ca4db0$225ee910$@mindspring.com> <502B587C.3090...@easysoft.com>
In-Reply-To: <502B587C.3090...@easysoft.com>
Subject: RE: Help please with DBD::ODBC on SUSE-Linux
Date: Wed, 15 Aug 2012 10:32:50 -0400
Message-ID: <005e01cd7af2$d9cb8340$8d6289...@mindspring.com>
MIME-Version: 1.0
X-Mailer: Microsoft Outlook 14.0
Thread-Index: AQHX5Su1WvCDt9iWNJIB3+LgZ/B+ZwF5RxFolzpPgoA=
X-ELNK-Trace: 2d9826978d942958d4c20f6b8d69d888b7f3a87d4e9c50f1e40cecdd2c26b072d2b61e4ff06a2935350badd9bab72f9c350badd9bab72f9c350badd9bab72f9c
X-Originating-IP: 76.200.161.15
X-Virus-Checked: Checked
Approved: n...@nntp.perl.org
From: jt...@mindspring.com ("Jeff Tate")
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: 7bit
Couldn't find odbcinst. Compiled test code as instructed. Result of a.out
is:
size of SQLLEN is 8
As for decision to install Teradata odbc rather than SUSE odbc, that was
made by the sysadmin team. I am just a user. I will however ask them if
there is the possibility to install unixodbc - is that target neutral or is
there some additional work they would have to do to enable a Teradata
connection.
Thanx
-----Original Message-----
From: Martin J. Evans [mailto:martin.ev...@easysoft.com]
Sent: Wednesday, August 15, 2012 4:06 AM
To: Jeff Tate
Cc: dbi-us...@perl.org
Subject: Re: Help please with DBD::ODBC on SUSE-Linux
On 14/08/12 19:05, Jeff Tate wrote:
> I am trying to build a private perl with ODBC connection to a Teradata
> database on SUSE-Linux. Perl build with no errors, DBI installed
> clean, DBD::ODBC compiles seemingly cleanly, but fails almost all the
> tests. So, help will be gratefully accepted.
>
> The attached shows:
>
> .Relevant environment
Out of interest, why did you choose to use the ODBC driver manager in
/opt//teradata/client/ODBC_64 instead of unixODBC installed from a suse
package?
> .Results of ODBC adhoc connect test
>
> oSuccessful
>
> oDeliberately not successful, as it shows driver identification tags
>
> .cpan results
>
> oget
>
> omake
>
> otest
>
> I installed CPAN::Reporter, so I expect (though am not sure as this is
> new to me) that reports have been posted.
> Thanx in advance for any and all insights (per the admonition, I
> looked for a README.linux to review, but there wasn't one)
>
> Jeff Tate
So running make test results in a segfault. You have a 64 bit machine and
from the names of the dirs where teradata is installed I'm guessing it too
is 64 bit shared objects. However, there is nothing in the c compilation
which sets the size of SQLLEN and SQLULEN which are /usually/ 64 bits on 64
bit linux and 32 bits on 32 bit linux. If DBD::ODBC was built with 32 bit
SQLLEN/SQLULEN and teradata and the driver manager were built with 64 bit
SQLLEN/SQLULEN I can well imagine it would end up seg faulting - this is my
guess.
Does the /opt/teradata tree contain an odbcinst binary? If it does run
/path/odbcinst -j and post the output. If it does not, compile and run the
following C code and post the output:
put the following in x.c file:
#include <stdio.h>
#include <sql.h>
main() {
printf("size of SQLLEN is %d\n", sizeof(SQLLEN)); }
compile with:
cc -I/opt/teradata/client/ODBC_64/include x.c
run with ./a.out
What does it output?
The background is that MS changed the ODBC spec when they released 64 bit
windows and changed some ODBC APIs to use SQLLEN/SQLULEN when before they
used SQLINTEGER/SQLUINTEGER. The former are 32/64 bit depending on
architecture and the later are always 32 bit. Before they did this 64 bit
Unix existed for ages and stuck to the existing API which was using
SQLINTEGERs. This led to confusion and situations like I expect you've hit.
Basically, DBD::ODBC needs to know the size of SQLLEN and it normally does
this by running:
odbc_config --cflags
-DHAVE_UNISTD_H -DHAVE_PWD_H -DHAVE_SYS_TYPES_H -DHAVE_LONG_LONG
-DSIZEOF_LONG_INT=4 -I/home/martin/unixODBC-2.3.1/include
and adding those flags to the cc line (note the above came from a 32bit
machine). However, I cannot know you are really using unixODBC as I've no
idea what came with teradata in those dirs.
Martin
--
Martin J. Evans
Easysoft Limited
<http://www.easysoft.com> http://www.easysoft.com