From: Peter Rabbitson Date: Fri, 8 May 2009 08:13:30 +0000 (+0000) Subject: Throw away some debugging code X-Git-Tag: v0.08103~113 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=2007929b1d9c679e67f85a9ab37c804111e66311;p=dbsrgits%2FDBIx-Class.git Throw away some debugging code --- diff --git a/lib/DBIx/Class/CDBICompat/LiveObjectIndex.pm b/lib/DBIx/Class/CDBICompat/LiveObjectIndex.pm index 445282c..a461a13 100644 --- a/lib/DBIx/Class/CDBICompat/LiveObjectIndex.pm +++ b/lib/DBIx/Class/CDBICompat/LiveObjectIndex.pm @@ -51,15 +51,15 @@ sub clear_object_index { sub insert { my ($self, @rest) = @_; $self->next::method(@rest); - + return $self if $self->nocache; - # Because the insert will die() if it can't insert into the db (or should) - # we can be sure the object *was* inserted if we got this far. In which - # case, given primary keys are unique and ID only returns a - # value if the object has all its primary keys, we can be sure there - # isn't a real one in the object index already because such a record - # cannot have existed without the insert failing. + # Because the insert will die() if it can't insert into the db (or should) + # we can be sure the object *was* inserted if we got this far. In which + # case, given primary keys are unique and ID only returns a + # value if the object has all its primary keys, we can be sure there + # isn't a real one in the object index already because such a record + # cannot have existed without the insert failing. if (my $key = $self->ID) { my $live = $self->live_object_index; weaken($live->{$key} = $self); @@ -67,7 +67,7 @@ sub insert { if ++$self->live_object_init_count->{count} % $self->purge_object_index_every == 0; } - #use Data::Dumper; warn Dumper($self); + return $self; } diff --git a/lib/DBIx/Class/ResultSet.pm b/lib/DBIx/Class/ResultSet.pm index e231107..00fc70c 100644 --- a/lib/DBIx/Class/ResultSet.pm +++ b/lib/DBIx/Class/ResultSet.pm @@ -796,19 +796,16 @@ sub _collapse_query { if (ref $query eq 'ARRAY') { foreach my $subquery (@$query) { next unless ref $subquery; # -or -# warn "ARRAY: " . Dumper $subquery; $collapsed = $self->_collapse_query($subquery, $collapsed); } } elsif (ref $query eq 'HASH') { if (keys %$query and (keys %$query)[0] eq '-and') { foreach my $subquery (@{$query->{-and}}) { -# warn "HASH: " . Dumper $subquery; $collapsed = $self->_collapse_query($subquery, $collapsed); } } else { -# warn "LEAF: " . Dumper $query; foreach my $col (keys %$query) { my $value = $query->{$col}; $collapsed->{$col}{$value}++; @@ -1760,19 +1757,16 @@ sub _collapse_cond { if (ref $cond eq 'ARRAY') { foreach my $subcond (@$cond) { next unless ref $subcond; # -or -# warn "ARRAY: " . Dumper $subcond; $collapsed = $self->_collapse_cond($subcond, $collapsed); } } elsif (ref $cond eq 'HASH') { if (keys %$cond and (keys %$cond)[0] eq '-and') { foreach my $subcond (@{$cond->{-and}}) { -# warn "HASH: " . Dumper $subcond; $collapsed = $self->_collapse_cond($subcond, $collapsed); } } else { -# warn "LEAF: " . Dumper $cond; foreach my $col (keys %$cond) { my $value = $cond->{$col}; $collapsed->{$col} = $value; diff --git a/lib/DBIx/Class/ResultSource.pm b/lib/DBIx/Class/ResultSource.pm index 0094fa4..9e67e66 100644 --- a/lib/DBIx/Class/ResultSource.pm +++ b/lib/DBIx/Class/ResultSource.pm @@ -1110,7 +1110,6 @@ sub resolve_join { $self->throw_exception("No idea how to resolve join reftype ".ref $join); } else { my $count = ++$seen->{$join}; - #use Data::Dumper; warn Dumper($seen); my $as = ($count > 1 ? "${join}_${count}" : $join); my $rel_info = $self->relationship_info($join); $self->throw_exception("No such relationship ${join}") unless $rel_info; @@ -1287,8 +1286,6 @@ in the supplied relationships. Examples: sub resolve_prefetch { my ($self, $pre, $alias, $seen, $order, $collapse) = @_; $seen ||= {}; - #$alias ||= $self->name; - #warn $alias, Dumper $pre; if( ref $pre eq 'ARRAY' ) { return map { $self->resolve_prefetch( $_, $alias, $seen, $order, $collapse ) } @@ -1301,7 +1298,6 @@ sub resolve_prefetch { $self->related_source($_)->resolve_prefetch( $pre->{$_}, "${alias}.$_", $seen, $order, $collapse) } keys %$pre; - #die Dumper \@ret; return @ret; } elsif( ref $pre ) { @@ -1354,8 +1350,6 @@ sub resolve_prefetch { return map { [ "${as}.$_", "${as_prefix}${pre}.$_", ] } $rel_source->columns; - #warn $alias, Dumper (\@ret); - #return @ret; } } diff --git a/lib/DBIx/Class/Row.pm b/lib/DBIx/Class/Row.pm index c6fd923..0746ad3 100644 --- a/lib/DBIx/Class/Row.pm +++ b/lib/DBIx/Class/Row.pm @@ -347,7 +347,6 @@ sub insert { $self->throw_exception( "Can't get last insert id" ) unless (@ids == @auto_pri); $self->store_column($auto_pri[$_] => $ids[$_]) for 0 .. $#ids; -#use Data::Dumper; warn Dumper($self); } diff --git a/lib/DBIx/Class/Schema/Versioned.pm b/lib/DBIx/Class/Schema/Versioned.pm index 2c29e0e..39ea774 100644 --- a/lib/DBIx/Class/Schema/Versioned.pm +++ b/lib/DBIx/Class/Schema/Versioned.pm @@ -182,7 +182,6 @@ use strict; use warnings; use base 'DBIx::Class'; use POSIX 'strftime'; -use Data::Dumper; __PACKAGE__->mk_classdata('_filedata'); __PACKAGE__->mk_classdata('upgrade_directory'); diff --git a/lib/DBIx/Class/Storage/DBI.pm b/lib/DBIx/Class/Storage/DBI.pm index 7987c40..e4f5c49 100644 --- a/lib/DBIx/Class/Storage/DBI.pm +++ b/lib/DBIx/Class/Storage/DBI.pm @@ -62,8 +62,6 @@ sub new { sub _strip_outer_paren { my ($self, $arg) = @_; -use Data::Dumper; - return $self->_SWITCH_refkind ($arg, { ARRAYREFREF => sub { $$arg->[0] = __strip_outer_paren ($$arg->[0]); @@ -1375,13 +1373,7 @@ sub insert_bulk { # @bind = map { ref $_ ? ''.$_ : $_ } @bind; # stringify args ## This must be an arrayref, else nothing works! - my $tuple_status = []; - - ##use Data::Dumper; - ##print STDERR Dumper( $data, $sql, [@bind] ); - - my $time = time(); ## Get the bind_attributes, if any exist my $bind_attributes = $self->source_bind_attributes($source); diff --git a/lib/DBIx/Class/Storage/DBI/Cursor.pm b/lib/DBIx/Class/Storage/DBI/Cursor.pm index 60df379..0fe570f 100644 --- a/lib/DBIx/Class/Storage/DBI/Cursor.pm +++ b/lib/DBIx/Class/Storage/DBI/Cursor.pm @@ -36,8 +36,8 @@ Returns a new L object. sub new { my ($class, $storage, $args, $attrs) = @_; - #use Data::Dumper; warn Dumper(@_); $class = ref $class if ref $class; + my $new = { storage => $storage, args => $args, diff --git a/lib/SQL/Translator/Parser/DBIx/Class.pm b/lib/SQL/Translator/Parser/DBIx/Class.pm index 57dad33..58db779 100644 --- a/lib/SQL/Translator/Parser/DBIx/Class.pm +++ b/lib/SQL/Translator/Parser/DBIx/Class.pm @@ -13,7 +13,6 @@ $VERSION = '1.10'; $DEBUG = 0 unless defined $DEBUG; use Exporter; -use Data::Dumper; use SQL::Translator::Utils qw(debug normalize_name); use base qw(Exporter); diff --git a/lib/SQL/Translator/Producer/DBIx/Class/File.pm b/lib/SQL/Translator/Producer/DBIx/Class/File.pm index 300ce50..4132c73 100644 --- a/lib/SQL/Translator/Producer/DBIx/Class/File.pm +++ b/lib/SQL/Translator/Producer/DBIx/Class/File.pm @@ -25,6 +25,7 @@ $DEBUG = 0 unless defined $DEBUG; use SQL::Translator::Schema::Constants; use SQL::Translator::Utils qw(header_comment); +use Data::Dumper (); ## Skip all column type translation, as we want to use whatever the parser got.