Add ::Exception, and use throw instead of die.
[dbsrgits/DBIx-Class-Historic.git] / lib / DBIx / Class / CDBICompat / LazyLoading.pm
index e991cc0..21bcdcd 100644 (file)
@@ -20,14 +20,15 @@ sub get_column {
 
 sub _flesh {
   my ($self, @groups) = @_;
+  @groups = ('All') unless @groups;
   my %want;
   $want{$_} = 1 for map { keys %{$self->_column_groups->{$_}} } @groups;
   if (my @want = grep { !exists $self->{'_column_data'}{$_} } keys %want) {
-    #warn "@want";
     my $sth = $self->_get_sth('select', \@want, $self->_table_name,
                                 $self->_ident_cond); 
     $sth->execute($self->_ident_values);
     my @val = $sth->fetchrow_array;
+    $sth->finish;
     foreach my $w (@want) {
       $self->{'_column_data'}{$w} = shift @val;
     }