[Bast-commits] r8668 - in DBIx-Class/0.08/branches/storage-interbase: lib/DBIx/Class/Storage t

caelum at dev.catalyst.perl.org caelum at dev.catalyst.perl.org
Fri Feb 12 19:43:20 GMT 2010


Author: caelum
Date: 2010-02-12 19:43:20 +0000 (Fri, 12 Feb 2010)
New Revision: 8668

Modified:
   DBIx-Class/0.08/branches/storage-interbase/lib/DBIx/Class/Storage/DBI.pm
   DBIx-Class/0.08/branches/storage-interbase/t/750firebird.t
Log:
special bind_param_array move to make DBD::InterBase happy (RT#54561)

Modified: DBIx-Class/0.08/branches/storage-interbase/lib/DBIx/Class/Storage/DBI.pm
===================================================================
--- DBIx-Class/0.08/branches/storage-interbase/lib/DBIx/Class/Storage/DBI.pm	2010-02-12 17:05:11 UTC (rev 8667)
+++ DBIx-Class/0.08/branches/storage-interbase/lib/DBIx/Class/Storage/DBI.pm	2010-02-12 19:43:20 UTC (rev 8668)
@@ -1518,7 +1518,11 @@
 
     my @data = map { $_->[$data_index] } @$data;
 
-    $sth->bind_param_array( $placeholder_index, [@data], $attributes );
+    $sth->bind_param_array(
+      $placeholder_index,
+      [@data],
+      (%$attributes ?  $attributes : ()),
+    );
     $placeholder_index++;
   }
 

Modified: DBIx-Class/0.08/branches/storage-interbase/t/750firebird.t
===================================================================
--- DBIx-Class/0.08/branches/storage-interbase/t/750firebird.t	2010-02-12 17:05:11 UTC (rev 8667)
+++ DBIx-Class/0.08/branches/storage-interbase/t/750firebird.t	2010-02-12 19:43:20 UTC (rev 8668)
@@ -116,18 +116,17 @@
     for (1..2) {
       push @pop, { name => "Artist_expkey_$_", artistid => 100 + $_ };
     }
-    # XXX why does insert_bulk not work here?
-    my @foo = $ars->populate (\@pop);
+    $ars->populate (\@pop);
   });
 
 # count what we did so far
   is ($ars->count, 6, 'Simple count works');
 
 # test UPDATE
-  lives_ok {
-    $schema->resultset('Artist')
-           ->search({name => 'foo'})
-           ->update({rank => 4 });
+  lives_and {
+    $ars->search({ name => 'foo' })->update({ rank => 4 });
+
+    is $ars->search({ name => 'foo' })->first->rank, 4;
   } 'Can update a column';
 
   my ($updated) = $schema->resultset('Artist')->search({name => 'foo'});
@@ -151,6 +150,15 @@
   is( $lim->next->artistid, 102, "iterator->next ok" );
   is( $lim->next, undef, "next past end of resultset ok" );
 
+# test multiple executing cursors
+  {
+    my $rs1 = $ars->search({}, { order_by => { -asc  => 'artistid' }});
+    my $rs2 = $ars->search({}, { order_by => { -desc => 'artistid' }});
+
+    is $rs1->first->artistid, 1,   'multiple cursors';
+    is $rs2->first->artistid, 102, 'multiple cursors';
+  }
+
 # test empty insert
   {
     local $ars->result_source->column_info('artistid')->{is_auto_increment} = 0;




More information about the Bast-commits mailing list