On Wed, Nov 12, 2003 at 09:28:54AM -0000, Martin J. Evans wrote:
> Hi,
> 
> I have:
> 
> [EMAIL PROTECTED] DBD-ODBC-1.06]$ perl -MDBI -e 'DBI->installed_versions'
>   Perl            : 5.008
>   OS              : linux
>   DBI             : 1.38
>   DBD::mysql      : 2.9002
>   DBD::Sponge     : 11.09
>   DBD::Proxy      : 0.2004
>   DBD::ODBC       : 1.05
>   DBD::Multiplex  : 0.9
>   DBD::ExampleP   : 11.10
> 
> 
> I was upgrading DBD::ODBC to 1.06 when tests 02simple 13 onwards failed. I've
> reduced this to the following simple perl and output:
> 
> use DBI;
> 
> my @data_sources = DBI->data_sources('ODBC');
> print "Data sources:\n\t", join("\n\t",@data_sources),"\n\n";
> 
> [EMAIL PROTECTED] DBD-ODBC-1.06]$ perl x.pl 
> Usage: DBD::ODBC::dr::data_sources(drh, attr = NULL) at
> /usr/local/lib/perl5/site_perl/5.8.0/i686-linux/DBI.pm line 964.

sub data_sources {
    my ($class, $driver, @other) = @_;
    my $drh = $class->install_driver($driver);
    my @ds = $drh->data_sources(@other);
    return @ds;
}

So $class would be "DBI", $driver would be "ODBC" and @other would be empty.
So then data_sources should be called with only the $drh as a parameter
and that shouldn't cause an error.

Could you post a level 2 trace so we can see what's going on?

> perldoc DBI appears to say:
>          @data_sources = DBI->data_sources($driver_name, \%attr, $dbh);
> under SYNOPSIS and:
>              @ary = DBI->data_sources($driver);
>              @ary = DBI->data_sources($driver, \%attr);
> under "data_sources"
> 
> The above code works fine with DBI 1.13 and DBD::ODBC 0.28.

It would be more helpful if you could narrow it down to one changed
module instead of two. Also note that although the code that's failing
is 'in' the driver, it's actually supplied by the DBI that's installed
at the time the driver is compiled and installed.

Tim.

Reply via email to