After 1.35 DBD::ODBC will disable array operations for execute_for_fetch
by default, and the $dbh attribute is changing from
'odbc_disable_array_operations' to 'odbc_array_operations', but we still
set the new attribute to 0 just in case.
Put the version checks and the setting of the appropriate attribute in
_disable_odbc_array_ops in ODBC.pm, and call it from the 3 drivers where
we currently need to disable them.
return $self->_dbh_get_info('SQL_DRIVER_VER') || 0;
}
+sub _disable_odbc_array_ops {
+ my $self = shift;
+ my $dbh = $self->_get_dbh;
+
+ if (eval { DBD::ODBC->VERSION('1.35_01') }) {
+ $dbh->{odbc_array_operations} = 0;
+ }
+ elsif (eval { DBD::ODBC->VERSION('1.33_01') }) {
+ $dbh->{odbc_disable_array_operations} = 1;
+ }
+}
+
1;
=head1 NAME
}
# batch operations do not work
- $self->_get_dbh->{odbc_disable_array_operations} = 1;
+ $self->_disable_odbc_array_ops;
return $self->next::method(@_);
}
my $self = shift;
if ($self->_dbh_get_info('SQL_DRIVER_NAME') eq 'OdbcFb') {
- $self->_get_dbh->{odbc_disable_array_operations} = 1;
+ $self->_disable_odbc_array_ops;
}
return $self->next::method(@_);
# FreeTDS is too broken wrt execute_for_fetch batching
# just disable it outright until things quiet down
- $self->_get_dbh->{odbc_disable_array_operations} = 1;
+ $self->_disable_odbc_array_ops;
}
}