- (No-one apparently tried to install this till Steven Lembark. Thanks!)
- Fixed speed regression with keys in the File backend.
- Introduced in 1.0019_002 to fix #50541
+ - (RT #53575) Recursion failure in STORE (Thanks, SPROUT)
1.0019_002 Jan 05 22:30:00 2010 EST
(This is the second developer release for 1.0020.)
t/52_memory_leak.t
t/53_misc_transactions.t
t/54_output_punct_vars.t
+t/55_recursion.t
t/97_dump_file.t
t/98_pod.t
t/99_pod_coverage.t
my @temp = @$value;
tie @$value, 'DBM::Deep', {
base_offset => $value_sector->offset,
-# staleness => $value_sector->staleness,
+ staleness => $value_sector->staleness,
storage => $self->storage,
engine => $self,
};
my %temp = %$value;
tie %$value, 'DBM::Deep', {
base_offset => $value_sector->offset,
-# staleness => $value_sector->staleness,
+ staleness => $value_sector->staleness,
storage => $self->storage,
engine => $self,
};
sub engine { $_[0]{engine} }
sub offset { $_[0]{offset} }
sub type { $_[0]{type} }
+sub staleness { $_[0]{staleness} }
sub load { die "load must be implemented in a child class" }
return $self;
}
-sub clear {
+sub wipe {
my $self = shift;
$self->engine->storage->print_at( $self->offset + $self->base_size,
chr(0) x ($self->size - $self->base_size), # Zero-fill the data
return;
}
-sub staleness { $_[0]{staleness} }
-
sub get_data_location_for {
my $self = shift;
my ($args) = @_;
return $data;
}
+sub write_blist_loc {
+ my $self = shift;
+ my ($loc) = @_;
+
+ my $engine = $self->engine;
+ $engine->storage->print_at( $self->offset + $self->base_size,
+ pack( $StP{$engine->byte_size}, $loc ),
+ );
+
+}
+
sub get_blist_loc {
my $self = shift;
return unpack( $StP{$e->byte_size}, $blist_loc );
}
+#sub clear {
+# my $self = shift;
+# my ($args) = @_;
+# $args ||= {};
+#
+# my $engine = $self->engine;
+#
+# # If there's nothing pointed to from this reference, there's nothing to do.
+# my $loc = $self->get_blist_loc
+# or return;
+#
+# my $sector = $engine->load_sector( $loc )
+# or DBM::Deep->_throw_error( "Cannot read sector at $loc in clear()" );
+#
+# $sector->clear;
+#
+# $self->write_blist_loc( 0 );
+#
+# return;
+#}
+
sub get_bucket_list {
my $self = shift;
my ($args) = @_;
key_md5 => $args->{key_md5},
});
- $engine->storage->print_at( $self->offset + $self->base_size,
- pack( $StP{$engine->byte_size}, $blist->offset ),
- );
+ $self->write_blist_loc( $blist->offset );
+# $engine->storage->print_at( $self->offset + $self->base_size,
+# pack( $StP{$engine->byte_size}, $blist->offset ),
+# );
return $blist;
}
}),
});
}
-# my $blist = $blist_cache{$idx}
-# ||= DBM::Deep::Sector::File::BucketList->new({
-# engine => $engine,
-# });
-#
-# $new_index->set_entry( $idx => $blist->offset );
-#
-# #XXX THIS IS HACKY!
-# $blist->find_md5( $args->{key_md5} );
-# $blist->write_md5({
-# key => $args->{key},
-# key_md5 => $args->{key_md5},
-# value => DBM::Deep::Sector::File::Null->new({
-# engine => $engine,
-# data => undef,
-# }),
-# });
}
if ( $last_sector ) {
);
}
- $sector->clear;
+ $sector->wipe;
$sector->free;
if ( $redo ) {
--- /dev/null
+use strict;
+use warnings FATAL => 'all';
+
+use Test::More;
+use Test::Exception;
+use t::common qw( new_dbm );
+
+use_ok( 'DBM::Deep' );
+
+my $dbm_factory = new_dbm();
+while ( my $dbm_maker = $dbm_factory->() ) {
+ my $db = $dbm_maker->();
+
+ my $h = {};
+ my $tmp = $h;
+ for (1..4) { # 98 is ok, 99 is bad.
+ %$tmp = ("" => {});
+ $tmp = $tmp->{""};
+ }
+ lives_ok {
+ $db->{""} = $h;
+ } 'deep recursion causes no errors';
+}
+
+done_testing;