assume that storage attributes can be set per-RS
[dbsrgits/DBIx-Class.git] / t / 72pg_cursors.t
index a2cca05..4141999 100644 (file)
@@ -11,7 +11,7 @@ my ($dsn, $dbuser, $dbpass) = @ENV{map { "DBICTEST_PG_${_}" } qw/DSN USER PASS/}
 plan skip_all => 'Set $ENV{DBICTEST_PG_DSN}, _USER and _PASS to run this test'
   unless ($dsn && $dbuser);
 
-plan tests => 14;
+plan tests => 16;
 
 sub create_test_schema {
     my ($schema)=@_;
@@ -110,6 +110,16 @@ is (
 
 {
     $called=0;
+    my $rs=$schema->resultset('Artist')->search({});
+    $schema->storage->set_use_dbms_capability('server_cursors',0);
+    my @rows=$rs->all;
+    is(scalar(@rows),$rows,'get all the rows (all)');
+    is($called,0,'Pg::Sth *not* called');
+    $schema->storage->set_use_dbms_capability('server_cursors',1);
+}
+
+{
+    $called=0;
     my $rs=$schema->resultset('Artist')->search({},{server_cursors=>0});
     my @rows=$rs->all;
     is(scalar(@rows),$rows,'get all the rows (all)');