switch to DateTime::Format::Sybase
[dbsrgits/DBIx-Class.git] / lib / DBIx / Class / Storage / DBI / Sybase.pm
index 385ac30..e60b5e2 100644 (file)
@@ -81,9 +81,11 @@ sub count {
   my $offset = $attrs->{offset} || 0;
   my $total  = $attrs->{rows} + $offset;
 
-  my $new_attrs = $self->_trim_attributes_for_count($source, $attrs);
-  $new_attrs->{select} = '1';
-  $new_attrs->{as}     = ['dummy'];
+  my $new_attrs = $self->_copy_attributes_for_count($source, $attrs);
+
+  my $first_pk = ($source->primary_columns)[0];
+
+  $new_attrs->{select} = $first_pk ? "me.$first_pk" : 1;
 
   my $tmp_rs = $source->resultset_class->new($source, $new_attrs);
 
@@ -97,7 +99,7 @@ sub count {
   return $count - $offset;
 }
 
-sub datetime_parser_type { "DBIx::Class::Storage::DBI::Sybase::DateTime" }
+sub datetime_parser_type { "DateTime::Format::Sybase" }
 
 1;
 
@@ -131,7 +133,7 @@ C<08/13/1979 18:08:55.080>.
 This works for both C<DATETIME> and C<SMALLDATETIME> columns, although
 C<SMALLDATETIME> columns only have minute precision.
 
-You will need the L<DateTime::Format::Strptime> module if you are going to use
+You will need the L<DateTime::Format::Sybase> module if you are going to use
 L<DBIx::Class::InflateColumn::DateTime>.
 
 =head1 AUTHORS