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);
return $count - $offset;
}
-sub datetime_parser_type { "DBIx::Class::Storage::DBI::Sybase::DateTime" }
+sub datetime_parser_type { "DateTime::Format::Sybase" }
1;
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