But your queries will be cached.
-You need at least version C<1.09> of L<DBD::Sybase> for placeholder support.
-Otherwise your storage will be automatically reblessed into C<::NoBindVars>.
+You need a version of L<DBD::Sybase> compiled with the Sybase OpenClient
+libraries, B<NOT> FreeTDS, for placeholder support. Otherwise your storage will
+be automatically reblessed into C<::NoBindVars>.
A recommended L<DBIx::Class::Storage::DBI/connect_info> settings:
$self->_rebless;
}
- if ($DBD::Sybase::VERSION < 1.09) {
+ if ($self->_using_freetds) {
carp <<'EOF';
Your version of Sybase potentially supports placeholders and query caching,
-however your version of DBD::Sybase is too old to do this properly. Please
-upgrade to at least version 1.09 if you want this feature.
+however you seem to be using FreeTDS which does not (yet?) support this.
-TEXT/IMAGE column support will also not work in older versions of DBD::Sybase.
+Please recompile DBD::Sybase with the Sybase OpenClient libraries if you want
+these features.
+
+TEXT/IMAGE column support will also not work under FreeTDS.
See perldoc DBIx::Class::Storage::DBI::Sybase for more details.
EOF
}
}
+{
+ my $using_freetds = undef;
+
+ sub _using_freetds {
+ my $self = shift;
+ my $dbh = $self->_dbh;
+
+ return $using_freetds if defined $using_freetds;
+
+ local $dbh->{syb_rowcount} = 1; # this is broken in freetds
+ $using_freetds = @{ $dbh->selectall_arrayref('sp_help') } != 1;
+
+ return $using_freetds;
+ }
+}
+
sub _set_maxConnect {
my $self = shift;
=head1 IMAGE AND TEXT COLUMNS
-You need at least version C<1.09> of L<DBD::Sybase> for C<TEXT/IMAGE> column
-support.
+L<DBD::Sybase> compiled with FreeTDS will B<NOT> work with C<TEXT/IMAGE>
+columns.
See L</connect_call_blob_setup> for a L<DBIx::Class::Storage::DBI/connect_info>
setting you need to work with C<IMAGE> columns.
=head1 DESCRIPTION
If you're using this driver than your version of Sybase does not support
-placeholders, or your version of L<DBD::Sybase> is too old (you need at least
-C<1.09>. You can check with:
+placeholders, or your version of L<DBD::Sybase> was compiled with FreeTDS rather
+than the Sybase OpenClient libraries. You can check with:
$dbh->{syb_dynamic_supported}
+To see if you are using FreeTDS, run:
+
+ perl -MDBD::Sybase -le 'print grep /Sybase\./, @DynaLoader::dl_shared_objects' | xargs ldd
+
+If you see C<libct.so> or similar, rather than C<libsybct.so> then you are using
+FreeTDS.
+
You can also enable this driver explicitly using:
my $schema = SchemaClass->clone;
if ($storage_idx == 0 &&
$schema->storage->isa('DBIx::Class::Storage::DBI::Sybase::NoBindVars')) {
-# no placeholders in this version of Sybase or DBD::Sybase
+# no placeholders in this version of Sybase or DBD::Sybase (or using FreeTDS)
my $tb = Test::More->builder;
$tb->skip('no placeholders') for 1..$TESTS;
next;
# mostly stolen from the blob stuff Nniuq wrote for t/73oracle.t
SKIP: {
- skip 'Need at least version 1.09 of DBD::Sybase to test TEXT/IMAGE', 12
- unless $DBD::Sybase::VERSION >= 1.09;
+ skip 'TEXT/IMAGE support does not work with FreeTDS', 12
+ if $schema->storage->_using_freetds;
my $dbh = $schema->storage->dbh;
{