[Bast-commits] r8550 - DBIx-Class/0.08/branches/storage-interbase/lib/DBIx/Class/Storage/DBI

caelum at dev.catalyst.perl.org caelum at dev.catalyst.perl.org
Fri Feb 5 09:46:32 GMT 2010


Author: caelum
Date: 2010-02-05 09:46:31 +0000 (Fri, 05 Feb 2010)
New Revision: 8550

Modified:
   DBIx-Class/0.08/branches/storage-interbase/lib/DBIx/Class/Storage/DBI/InterBase.pm
Log:
check for both NULL and null, rename _fb_auto_incs to _auto_incs

Modified: DBIx-Class/0.08/branches/storage-interbase/lib/DBIx/Class/Storage/DBI/InterBase.pm
===================================================================
--- DBIx-Class/0.08/branches/storage-interbase/lib/DBIx/Class/Storage/DBI/InterBase.pm	2010-02-05 09:26:03 UTC (rev 8549)
+++ DBIx-Class/0.08/branches/storage-interbase/lib/DBIx/Class/Storage/DBI/InterBase.pm	2010-02-05 09:46:31 UTC (rev 8550)
@@ -9,7 +9,7 @@
 use List::Util();
 
 __PACKAGE__->mk_group_accessors(simple => qw/
-  _fb_auto_incs
+  _auto_incs
 /);
 
 sub _prep_for_execute {
@@ -25,7 +25,7 @@
       $ident->column_info($_)->{is_auto_increment} && (
         (not defined $inserting)
         ||
-        (ref $inserting eq 'SCALAR' && $$inserting eq 'NULL')
+        (ref $inserting eq 'SCALAR' && $$inserting =~ /^null\z/i)
       )
     } $ident->columns;
 
@@ -36,8 +36,8 @@
 
       $sql .= " RETURNING ($auto_inc_cols)";
 
-      $self->_fb_auto_incs([]);
-      $self->_fb_auto_incs->[0] = \@auto_inc_cols;
+      $self->_auto_incs([]);
+      $self->_auto_incs->[0] = \@auto_inc_cols;
     }
   }
 
@@ -56,13 +56,13 @@
 
   my ($rv, $sth, @bind) = $self->dbh_do($self->can('_dbh_execute'), @_);
 
-  if ($op eq 'insert' && $self->_fb_auto_incs) {
+  if ($op eq 'insert' && $self->_auto_incs) {
     local $@;
     my (@auto_incs) = eval {
       local $SIG{__WARN__} = sub {};
       $sth->fetchrow_array
     };
-    $self->_fb_auto_incs->[1] = \@auto_incs;
+    $self->_auto_incs->[1] = \@auto_incs;
     $sth->finish;
   }
 
@@ -74,8 +74,8 @@
   my @result;
 
   my %auto_incs;
-  @auto_incs{ @{ $self->_fb_auto_incs->[0] } } =
-    @{ $self->_fb_auto_incs->[1] };
+  @auto_incs{ @{ $self->_auto_incs->[0] } } =
+    @{ $self->_auto_incs->[1] };
 
   push @result, $auto_incs{$_} for @cols;
 




More information about the Bast-commits mailing list