From: rkinyon Date: Wed, 27 Dec 2006 03:48:01 +0000 (+0000) Subject: Removed some lava from audit trails X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=7dd04e7629f115e812a5fcf371d4329048e4f884;p=dbsrgits%2FDBM-Deep.git Removed some lava from audit trails --- diff --git a/lib/DBM/Deep.pm b/lib/DBM/Deep.pm index b1441d6..6e917e4 100644 --- a/lib/DBM/Deep.pm +++ b/lib/DBM/Deep.pm @@ -418,8 +418,7 @@ sub STORE { # Store single hash key/value or array element in database. ## my $self = shift->_get_self; - my ($key, $value, $orig_key) = @_; - $orig_key = $key unless defined $orig_key; + my ($key, $value) = @_; if ( !FileHandle::Fmode::is_W( $self->_fh ) ) { $self->_throw_error( 'Cannot write to a readonly filehandle' ); @@ -436,7 +435,7 @@ sub STORE { $value = $self->_storage->{filter_store_value}->( $value ); } - $self->_engine->write_value( $self, $key, $value, $orig_key ); + $self->_engine->write_value( $self, $key, $value); $self->unlock(); @@ -448,15 +447,14 @@ sub FETCH { # Fetch single value or element given plain key or array index ## my $self = shift->_get_self; - my ($key, $orig_key) = @_; - $orig_key = $key unless defined $orig_key; + my ($key) = @_; ## # Request shared lock for reading ## $self->lock( LOCK_SH ); - my $result = $self->_engine->read_value( $self, $key, $orig_key ); + my $result = $self->_engine->read_value( $self, $key); $self->unlock(); @@ -472,8 +470,7 @@ sub DELETE { # Delete single key/value pair or element given plain key or array index ## my $self = shift->_get_self; - my ($key, $orig_key) = @_; - $orig_key = $key unless defined $orig_key; + my ($key) = @_; if ( !FileHandle::Fmode::is_W( $self->_fh ) ) { $self->_throw_error( 'Cannot write to a readonly filehandle' ); @@ -487,7 +484,7 @@ sub DELETE { ## # Delete bucket ## - my $value = $self->_engine->delete_key( $self, $key, $orig_key ); + my $value = $self->_engine->delete_key( $self, $key); if (defined $value && !ref($value) && $self->_storage->{filter_fetch_value}) { $value = $self->_storage->{filter_fetch_value}->($value); diff --git a/lib/DBM/Deep/Array.pm b/lib/DBM/Deep/Array.pm index 17994d6..3b9784d 100644 --- a/lib/DBM/Deep/Array.pm +++ b/lib/DBM/Deep/Array.pm @@ -50,7 +50,6 @@ sub FETCH { $self->lock( $self->LOCK_SH ); - my $orig_key; if ( $key =~ /^-?\d+$/ ) { if ( $key < 0 ) { $key += $self->FETCHSIZE; @@ -59,13 +58,11 @@ sub FETCH { return; } } - $orig_key = $key; } else { - $orig_key = undef; } - my $rv = $self->SUPER::FETCH( $key, $orig_key ); + my $rv = $self->SUPER::FETCH( $key ); $self->unlock; @@ -156,6 +153,9 @@ sub DELETE { return $rv; } +# Now that we have a real Reference sector, we should store arrayzize there. However, +# arraysize needs to be transactionally-aware, so a simple location to store it isn't +# going to work. sub FETCHSIZE { my $self = shift->_get_self; @@ -170,10 +170,6 @@ sub FETCHSIZE { $self->unlock; -# if ($packed_size) { -# return int(unpack($self->_engine->{long_pack}, $packed_size)); -# } - return $size; }