T_dbtdatum
ckFilter($arg, filter_store_value, \"filter_store_value\");
DBT_clear($var) ;
- $var.data = SvPV($arg, PL_na);
- $var.size = (int)PL_na;
+ if (SvOK($arg)) {
+ $var.data = SvPV($arg, PL_na);
+ $var.size = (int)PL_na;
+ }
OUTPUT
GDBM_WRITER
);
-$VERSION = "1.03";
+$VERSION = "1.04";
sub AUTOLOAD {
my($constname);
$var.dsize = (int)PL_na;
T_DATUM_V
ckFilter($arg, filter_store_value, \"filter_store_value\");
- $var.dptr = SvPV($arg, PL_na);
- $var.dsize = (int)PL_na;
+ if (SvOK($arg)) {
+ $var.dptr = SvPV($arg, PL_na);
+ $var.dsize = (int)PL_na;
+ }
+ else {
+ $var.dptr = \"\";
+ $var.dsize = 0;
+ }
OUTPUT
T_DATUM_K
output_datum(aTHX_ $arg, $var.dptr, $var.dsize);
use XSLoader ();
our @ISA = qw(Tie::Hash);
-our $VERSION = "1.03";
+our $VERSION = "1.04";
XSLoader::load 'NDBM_File', $VERSION;
$var.dsize = (int)PL_na;
T_DATUM_V
ckFilter($arg, filter_store_value, \"filter_store_value\");
- $var.dptr = SvPV($arg, PL_na);
- $var.dsize = (int)PL_na;
+ if (SvOK($arg)) {
+ $var.dptr = SvPV($arg, PL_na);
+ $var.dsize = (int)PL_na;
+ }
+ else {
+ $var.dptr = \"\";
+ $var.dsize = 0;
+ }
T_GDATUM
UNIMPLEMENTED
OUTPUT
use XSLoader ();
our @ISA = qw(Tie::Hash);
-our $VERSION = "1.02";
+our $VERSION = "1.03";
XSLoader::load 'ODBM_File', $VERSION;
$var.dsize = (int)PL_na;
T_DATUM_V
ckFilter($arg, filter_store_value, \"filter_store_value\");
- $var.dptr = SvPV($arg, PL_na);
- $var.dsize = (int)PL_na;
+ if (SvOK($arg)) {
+ $var.dptr = SvPV($arg, PL_na);
+ $var.dsize = (int)PL_na;
+ }
+ else {
+ $var.dptr = \"\";
+ $var.dsize = 0;
+ }
T_GDATUM
UNIMPLEMENTED
OUTPUT
use XSLoader ();
our @ISA = qw(Tie::Hash);
-our $VERSION = "1.02" ;
+our $VERSION = "1.03" ;
XSLoader::load 'SDBM_File', $VERSION;
$var.dsize = (int)PL_na;
T_DATUM_V
ckFilter($arg, filter_store_value, \"filter_store_value\");
- $var.dptr = SvPV($arg, PL_na);
- $var.dsize = (int)PL_na;
+ if (SvOK($arg)) {
+ $var.dptr = SvPV($arg, PL_na);
+ $var.dsize = (int)PL_na;
+ }
+ else {
+ $var.dptr = \"\";
+ $var.dsize = 0;
+ }
T_GDATUM
UNIMPLEMENTED
OUTPUT
use DB_File;
use Fcntl;
-print "1..155\n";
+print "1..156\n";
sub ok
{
# unlink $Dfile;
#}
+{
+ # Bug ID 20001013.009
+ #
+ # test that $hash{KEY} = undef doesn't produce the warning
+ # Use of uninitialized value in null operation
+ use warnings ;
+ use strict ;
+ use DB_File ;
+
+ unlink $Dfile;
+ my %h ;
+ my $a = "";
+ local $SIG{__WARN__} = sub {$a = $_[0]} ;
+
+ tie %h, 'DB_File', $Dfile, O_RDWR|O_CREAT, 0664, $DB_BTREE
+ or die "Can't open file: $!\n" ;
+ $h{ABC} = undef;
+ ok(156, $a eq "") ;
+ untie %h ;
+ unlink $Dfile;
+}
+
exit ;
use DB_File;
use Fcntl;
-print "1..109\n";
+print "1..110\n";
sub ok
{
}
+{
+ # Bug ID 20001013.009
+ #
+ # test that $hash{KEY} = undef doesn't produce the warning
+ # Use of uninitialized value in null operation
+ use warnings ;
+ use strict ;
+ use DB_File ;
+
+ unlink $Dfile;
+ my %h ;
+ my $a = "";
+ local $SIG{__WARN__} = sub {$a = $_[0]} ;
+
+ tie %h, 'DB_File', $Dfile or die "Can't open file: $!\n" ;
+ $h{ABC} = undef;
+ ok(110, $a eq "") ;
+ untie %h;
+ unlink $Dfile;
+}
+
exit ;
EOM
}
-print "1..126\n";
+print "1..127\n";
my $Dfile = "recno.tmp";
unlink $Dfile ;
}
+{
+ # Bug ID 20001013.009
+ #
+ # test that $hash{KEY} = undef doesn't produce the warning
+ # Use of uninitialized value in null operation
+ use warnings ;
+ use strict ;
+ use DB_File ;
+
+ unlink $Dfile;
+ my @h ;
+ my $a = "";
+ local $SIG{__WARN__} = sub {$a = $_[0]} ;
+
+ tie @h, 'DB_File', $Dfile, O_RDWR|O_CREAT, 0664, $DB_RECNO
+ or die "Can't open file: $!\n" ;
+ $h[0] = undef;
+ ok(127, $a eq "") ;
+ untie @h;
+ unlink $Dfile;
+}
+
exit ;
use GDBM_File;
-print "1..66\n";
+print "1..68\n";
unlink <Op.dbmx*>;
close FILE ;
BEGIN { push @INC, '.'; }
+ unlink <dbhash.tmp*> ;
eval 'use SubDB ; ';
main::ok(13, $@ eq "") ;
untie %h;
unlink <Op.dbmx*>;
}
+
+{
+ # Bug ID 20001013.009
+ #
+ # test that $hash{KEY} = undef doesn't produce the warning
+ # Use of uninitialized value in null operation
+ use warnings ;
+ use strict ;
+ use GDBM_File ;
+
+ unlink <Op.dbmx*>;
+ my %h ;
+ my $a = "";
+ local $SIG{__WARN__} = sub {$a = $_[0]} ;
+
+ ok(67, tie(%h, 'GDBM_File','Op.dbmx', &GDBM_WRCREAT, 0640));
+ $h{ABC} = undef;
+ ok(68, $a eq "") ;
+ untie %h;
+ unlink <Op.dbmx*>;
+}
#If Fcntl is not available, try 0x202 or 0x102 for O_RDWR|O_CREAT
use Fcntl;
-print "1..64\n";
+print "1..65\n";
unlink <Op.dbmx*>;
untie %h;
unlink <Op.dbmx*>;
}
+
+{
+ # Bug ID 20001013.009
+ #
+ # test that $hash{KEY} = undef doesn't produce the warning
+ # Use of uninitialized value in null operation
+ use warnings ;
+ use strict ;
+ use NDBM_File ;
+
+ unlink <Op.dbmx*>;
+ my %h ;
+ my $a = "";
+ local $SIG{__WARN__} = sub {$a = $_[0]} ;
+
+ ok(65, tie(%h, 'NDBM_File','Op.dbmx', O_RDWR|O_CREAT, 0640)) ;
+}
#If Fcntl is not available, try 0x202 or 0x102 for O_RDWR|O_CREAT
use Fcntl;
-print "1..64\n";
+print "1..66\n";
unlink <Op.dbmx*>;
unlink <Op.dbmx*>;
}
+{
+ # Bug ID 20001013.009
+ #
+ # test that $hash{KEY} = undef doesn't produce the warning
+ # Use of uninitialized value in null operation
+ use warnings ;
+ use strict ;
+ use ODBM_File ;
+
+ unlink <Op.dbmx*>;
+ my %h ;
+ my $a = "";
+ local $SIG{__WARN__} = sub {$a = $_[0]} ;
+
+ ok(65, tie(%h, 'ODBM_File','Op.dbmx', O_RDWR|O_CREAT, 0640)) ;
+ $h{ABC} = undef;
+ ok(66, $a eq "") ;
+ untie %h;
+ unlink <Op.dbmx*>;
+}
+
if ($^O eq 'hpux') {
print <<EOM;
#
#If Fcntl is not available, try 0x202 or 0x102 for O_RDWR|O_CREAT
use Fcntl;
-print "1..66\n";
+print "1..68\n";
unlink <Op_dbmx.*>;
unlink <Op_dbmx*>;
}
+{
+ # Bug ID 20001013.009
+ #
+ # test that $hash{KEY} = undef doesn't produce the warning
+ # Use of uninitialized value in null operation
+ use warnings ;
+ use strict ;
+ use SDBM_File ;
+
+ unlink <Op_dbmx*>;
+ my %h ;
+ my $a = "";
+ local $SIG{__WARN__} = sub {$a = $_[0]} ;
+
+ ok(67, tie(%h, 'SDBM_File','Op_dbmx', O_RDWR|O_CREAT, 0640)) ;
+ $h{ABC} = undef;
+ ok(68, $a eq "") ;
+
+ untie %h;
+ unlink <Op_dbmx*>;
+}