[Bast-commits] r7072 - in DBIx-Class/0.08/branches/sybase: lib/DBIx/Class/Storage/DBI lib/DBIx/Class/Storage/DBI/Sybase t

caelum at dev.catalyst.perl.org caelum at dev.catalyst.perl.org
Sun Jul 19 23:02:20 GMT 2009


Author: caelum
Date: 2009-07-19 23:02:19 +0000 (Sun, 19 Jul 2009)
New Revision: 7072

Modified:
   DBIx-Class/0.08/branches/sybase/lib/DBIx/Class/Storage/DBI/Sybase.pm
   DBIx-Class/0.08/branches/sybase/lib/DBIx/Class/Storage/DBI/Sybase/NoBindVars.pm
   DBIx-Class/0.08/branches/sybase/t/746sybase.t
Log:
minor cleanups

Modified: DBIx-Class/0.08/branches/sybase/lib/DBIx/Class/Storage/DBI/Sybase/NoBindVars.pm
===================================================================
--- DBIx-Class/0.08/branches/sybase/lib/DBIx/Class/Storage/DBI/Sybase/NoBindVars.pm	2009-07-19 21:57:11 UTC (rev 7071)
+++ DBIx-Class/0.08/branches/sybase/lib/DBIx/Class/Storage/DBI/Sybase/NoBindVars.pm	2009-07-19 23:02:19 UTC (rev 7072)
@@ -66,7 +66,8 @@
 =head1 DESCRIPTION
 
 If you're using this driver than your version of Sybase does not support
-placeholders. You can check with:
+placeholders, or your version of L<DBD::Sybase> is too old (you need at least
+C<1.09>. You can check with:
 
   $dbh->{syb_dynamic_supported}
 

Modified: DBIx-Class/0.08/branches/sybase/lib/DBIx/Class/Storage/DBI/Sybase.pm
===================================================================
--- DBIx-Class/0.08/branches/sybase/lib/DBIx/Class/Storage/DBI/Sybase.pm	2009-07-19 21:57:11 UTC (rev 7071)
+++ DBIx-Class/0.08/branches/sybase/lib/DBIx/Class/Storage/DBI/Sybase.pm	2009-07-19 23:02:19 UTC (rev 7072)
@@ -322,8 +322,11 @@
   my ($self, $dbh, $source, $col) = @_;
 
   # sorry, there's no other way!
-  my $sth = $dbh->prepare_cached("select max($col) from ".$source->from);
-  return ($dbh->selectrow_array($sth))[0];
+  my $sth = $self->sth("select max($col) from ".$source->from);
+  my ($id) = $dbh->selectrow_array($sth);
+  $sth->finish;
+
+  return $id;
 }
 
 1;
@@ -355,12 +358,6 @@
 See L</connect_call_blob_setup> for a L<DBIx::Class::Storage::DBI/connect_info>
 setting you need to work with C<IMAGE> columns.
 
-Due to limitations in L<DBD::Sybase> and this driver, it is only possible to
-select one C<TEXT> or C<IMAGE> column at a time. This is handled automatically
-for tables with only one such column, if you have more than one, supply a
-C<< select => [qw/col list .../] >> key to your C<< ->search >> calls, with the
-single desired C<TEXT/IMAGE> column at the end of the list.
-
 =head1 AUTHORS
 
 See L<DBIx::Class/CONTRIBUTORS>.

Modified: DBIx-Class/0.08/branches/sybase/t/746sybase.t
===================================================================
--- DBIx-Class/0.08/branches/sybase/t/746sybase.t	2009-07-19 21:57:11 UTC (rev 7071)
+++ DBIx-Class/0.08/branches/sybase/t/746sybase.t	2009-07-19 23:02:19 UTC (rev 7072)
@@ -171,7 +171,7 @@
         $last_id = $created->id if $created;
 
         my $got = eval {
-          $rs->search({ id => $last_id }, { select => [$type] })->single->$type
+          $rs->find($last_id)->$type
         };
         diag $@ if $@;
         ok($got eq $binstr{$size}, "verified inserted $size $type");
@@ -187,7 +187,7 @@
       ok !$@, 'updated blob successfully';
       diag $@ if $@;
       ok(eval {
-        $rs->search({ id => $last_id }, { select => ['blob'] })->single->blob
+        $rs->find($last_id)->blob
       } eq $new_str, "verified updated blob" );
       diag $@ if $@;
     }
@@ -212,7 +212,7 @@
     diag $@ if $@;
 
     my $got = eval {
-      $rs->search({ id => 1 }, { select => ['blob'] })->single->blob
+      $rs->find(1)->blob
     };
     diag $@ if $@;
     ok($got eq $binstr{large}, "verified inserted large blob");




More information about the Bast-commits mailing list