DBI FETCH called on non-referenced attribute

"Martin J. Evans" <[email protected]>
Newsgroups gmane.comp.lang.perl.modules.dbi.sybase.devel
Message-ID <[email protected]>
  Hi,

Hoping someone can help me identify what might be going on here but it 
looks to me like something in DBI has changed.

use strict;
use DBI;

my $attrs = { RaiseError => 1, PrintError => 0, AutoCommit => 1 };
my $h = DBI->connect("dbi:ODBC:DSN=xxx","xx","xx", {odbc_SQL_ROWSET_SIZE 
=> 2});

This code used to work fine but now it fails with:

Option type out of range (SQL-HY092) at 
/home/martin/perl5/lib/perl5/i486-linux-gnu-thread-multi/DBI.pm line
720.

It appears FETCH is being called on odbc_SQL_ROWSET_SIZE (just my 
example, could just as easily have been 9 for the actual ODBC 
SQL_ROWSET_SIZE attribute) and this ends up calling SQLGetConnectOption 
which says you cannot fetch SQL_ROWSET_SIZE. It is permissible to set 
SQL_ROWSET_SIZE with SQLSetConnectOption but not to retrieve it back.

Why does DBI do a FETCH on the attribute when it is never retrieved in 
the script? I don't think it used to (perhaps a long time ago).

Martin
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.