From: Rafael Kitover Date: Thu, 4 Jun 2009 17:07:48 +0000 (+0000) Subject: minor sybase count fix X-Git-Tag: v0.08112~14^2~152 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=aa56ff9a9024085a54833d427505e0f57937731d;p=dbsrgits%2FDBIx-Class.git minor sybase count fix --- diff --git a/lib/DBIx/Class/Storage/DBI/Sybase.pm b/lib/DBIx/Class/Storage/DBI/Sybase.pm index b0aef93..b471275 100644 --- a/lib/DBIx/Class/Storage/DBI/Sybase.pm +++ b/lib/DBIx/Class/Storage/DBI/Sybase.pm @@ -61,7 +61,8 @@ sub _dbh_last_insert_id { } sub count { - my ($self, $source, $attrs) = @_; + my $self = shift; + my ($source, $attrs) = @_; if (not exists $attrs->{rows}) { return $self->next::method(@_); diff --git a/t/746sybase.t b/t/746sybase.t index ec5e53e..aa6f4a9 100644 --- a/t/746sybase.t +++ b/t/746sybase.t @@ -11,7 +11,7 @@ my ($dsn, $user, $pass) = @ENV{map { "DBICTEST_SYBASE_${_}" } qw/DSN USER PASS/} plan skip_all => 'Set $ENV{DBICTEST_SYBASE_DSN}, _USER and _PASS to run this test' unless ($dsn && $user); -plan tests => (16 + 4*2)*2; +plan tests => (17 + 4*2)*2; my @storage_types = ( 'DBI::Sybase', @@ -55,13 +55,17 @@ SQL $seen_id{$new->artistid}++; -# test LIMIT support for (1..6) { $new = $schema->resultset('Artist')->create({ name => 'Artist ' . $_ }); is ( $seen_id{$new->artistid}, undef, "id for Artist $_ is unique" ); $seen_id{$new->artistid}++; } +# test simple count + is ($schema->resultset('Artist')->count, 7, 'count(*) of whole table ok'); + +# test LIMIT support + ## avoid quoting bug with NoBindVars for now # my $it = $schema->resultset('Artist')->search({artistid => { '>' => 0 }}, {