Dirk,

Please send me a DBI Trace file.  I don't have debian, but I may have a
machine I can put it on to test all this as it stands.  I just put RH 9 on
that machine, but the HD died.  I'll be calling Dell about the HD (maybe)
later today or on Monday.  In the mean time, a trace file may point me to
the problem. '

I've also CC-ed dbi-users as Nick and Martin lurk there and they might have
some insight related to unixODBC if I get stuck.

Thanks,

Jeff

> -----Original Message-----
> From: Dirk Eddelbuettel [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, November 20, 2003 7:37 AM
> To: Jeff Urlwin
> Cc: Pascal A. Dupuis; [EMAIL PROTECTED]
> Subject: Re: Bug#221811: libdbd-odbc-perl: hangs with a 
> "prepare" statement
> 
> 
>  
> Jeff,
> 
> Here is a fresh Debian bugreport. I can actually replicate it 
> against Pg, so this would not appear to be a MySQL issue. See 
> further below for the original report. Here is what I get 
> similar result with PostgreSQL via ODBC:
> 
> --------------------------------------------------------------
> ---------------
> [EMAIL PROTECTED]:/tmp> cat /tmp/odbc.pl
> #!/usr/bin/perl -w
> 
> use strict;
> use DBI;
> 
> my @ary = DBI->available_drivers;
> print join(", ", @ary), "\n";
> 
> my $dbh = DBI->connect('dbi:ODBC:beantest','edd', '',
>     { RaiseError => 1, AutoCommit => 1 } )
>   or die "Can't connect";
> print "connected!\n";
>       
> my $sth = $dbh->prepare("select * FROM indices")
>   or die "Can't prepare";
>       
> $dbh->disconnect() or die "Cannot disconnect\n";
>       
> which segfaults:
> 
> [EMAIL PROTECTED]:/tmp> /tmp/odbc.pl
> ExampleP, ODBC, Pg, Proxy, Sponge, mysql
> connected!
> Segmentation fault
> [EMAIL PROTECTED]:/tmp>
> --------------------------------------------------------------
> ---------------
> 
> 
> Yet I can connect just fine with another ODBC client: [ line 
> wraps added ]
> 
> --------------------------------------------------------------
> ---------------
> [EMAIL PROTECTED]:/tmp> echo 'library(RODBC); \ 
> db<-odbcConnect("beantest","edd",""); \ Z<-sqlQuery(db, 
> "select * from indices"); \ print(dim(Z)); \ odbcClose(db); 
> cat("All done\n")' | R --slave [1] 30  2 All done
> 
> [EMAIL PROTECTED]:/tmp>
> --------------------------------------------------------------
> ---------------
> 
> which prints the size of the returned structure (here 30x2) 
> and exists.
> 
> So this looks like a real bug. I am using 1.06 here on my 
> box. Debian unstable, all current. Backend is Pg on the 
> localbox. Perl is 5.8.2, unixODBC is 2.2.4. Let me if I can 
> help with something else.
> 
> Regards, Dirk
> 
> 
> On Wed, Nov 19, 2003 at 02:37:17PM +0100, Pascal A. Dupuis wrote:
> > Package: libdbd-odbc-perl
> > Version: 1.05-1
> > Severity: important
> > Tags: experimental
> > 
> > 
> > 
> > -- System Information:
> > Debian Release: testing/unstable
> > Architecture: i386
> > Kernel: Linux tatooine 2.4.22 #16 Wed Sep 3 10:06:36 CEST 2003 i686
> > Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8
> > 
> > Versions of packages libdbd-odbc-perl depends on:
> > ii  libc6                         2.3.2-9    GNU C Library: 
> Shared libraries an
> > ii  libdbi-perl                   1.35-1     The Perl5 
> Database Interface by Ti
> > ii  perl                          5.8.0-18   Larry Wall's 
> Practical Extraction 
> > ii  perl-base [perlapi-5.8.0]     5.8.0-18   The 
> Pathologically Eclectic Rubbis
> > ii  unixodbc                      2.2.4-6    ODBC tools libraries
> > 
> > -- no debconf information
> > 
> > I'm trying to write a Perl script to access a MS-SQL 
> database. To test 
> > the script, I use it locally on a linux machine with mysql 
> installed.
> > 
> > The script is:
> > ------------------
> > #!/usr/bin/perl -w
> > 
> > use strict;
> > use DBI;
> > 
> > my @ary = DBI->available_drivers;
> > print join(", ", @ary), "\n";
> > 
> > my $dbh = DBI->connect('dbi:ODBC:myDSN',
> >                     'user', 'pass',
> >                     { RaiseError => 1, AutoCommit => 1 })
> >         or die "Can't connect";
> > print "connected!\n";
> > 
> > my $sth = $dbh->prepare("SELECT * FROM Measurements;");
> > -------------------
> > 
> > where myDSN exists in ~/.odbc.ini and can be accessed, f.i. using 
> > openoffice. MySQL is used as the underlying driver. The 
> statement can 
> > be executed in isql and returns 4 records.
> > 
> > In perldebug, the 'connect' succeed, then the 'prepare' 
> hangs forever. 
> > A 'strace' on the script ends with :
> > 
> > connect(3, {sa_family=AF_UNIX, 
> path="/var/run/mysqld/mysqld.sock"}, 110) = 0
> > setsockopt(3, SOL_IP, IP_TOS, [8], 4)   = -1 EOPNOTSUPP 
> (Operation not supported)
> > setsockopt(3, SOL_SOCKET, SO_KEEPALIVE, [1], 4) = 0
> > read(3, "+\0\0\0", 4)                   = 4
> > read(3, "\n4.0.13-log\0\33\0\0\0c931=!*O\0, 
> \10\2\0\0\0"..., 43) = 43 
> > open("/usr/share/libmysqlclient/charsets/Index", 
> O_RDONLY|O_LARGEFILE) 
> > = -1 ENOENT (No such file or directory) write(3, 
> "\27\0\0\1\315 \377\377\377root\0\\LJNJIHS\0test", 27) = 27
> > read(3, "\5\0\0\2", 4)                  = 4
> > read(3, "\0\0\0\2\0", 5)                = 5
> > write(1, "connected!\n", 11connected!
> > )            = 11
> > semop(0, 0xbffff4c0, 2)                 = 0
> > semop(0, 0xbffff4c0, 1)                 = 0
> > --- SIGSEGV (Segmentation fault) @ 0 (0) ---
> > 
> > What's wrong with this driver, or is it my setup ? This scripts 
> > succeeds with the mysql driver, i.e. $dbh = 
> > DBI->connect('DBI:mysql:test:localhost.:3306', ...
> > 
> > Greetings
> > 
> > Pascal Dupuis
> > --
> > Dr. ir. Pascal Dupuis
> > K. U. Leuven, ESAT/ELECTA (formerly ELEN):  
> http://www.esat.kuleuven.ac.be/
> > Kasteelpark Arenberg, 10; 
> B-3001 Leuven-Heverlee, Belgium
> > Tel. +32-16-32 10 21 -- Fax +32-16-32 19 85
> > 
> > 
> > 
> 
> -- 
> Those are my principles, and if you don't like them... well, 
> I have others.
>                                                 -- Groucho Marx
> 


Reply via email to