I've been seeing the following error on occasion during "make check-run":
$PWD/t/data-gen/reindex-time-range.v1-master index failed: Modification of a read-only value attempted at $DIR/lib/PublicInbox/SearchIdx.pm line 899, <$r> line 1.
Perhaps this fixes it. In any case, a construct of:
$h->{k} //= do { $h->{x} = ...; $val };
seems wrong and may cause Perl to error out depending on how
hashes are randomized.
sub push_rec {
my ($self, $file_char, $at, $ct, $blob_oid, $cmt_oid) = @_;
my $rec = pack(PACK_FMT, $file_char, $at, $ct, $blob_oid, $cmt_oid);
sub push_rec {
my ($self, $file_char, $at, $ct, $blob_oid, $cmt_oid) = @_;
my $rec = pack(PACK_FMT, $file_char, $at, $ct, $blob_oid, $cmt_oid);
- $self->{unpack_fmt} //= do {
+ $self->{unpack_fmt} // do {
my $len = length($cmt_oid);
my $fmt = PACK_FMT;
$fmt =~ s/H\*/H$len/g;
$self->{rec_size} = length($rec);
my $len = length($cmt_oid);
my $fmt = PACK_FMT;
$fmt =~ s/H\*/H$len/g;
$self->{rec_size} = length($rec);
+ $self->{unpack_fmt} = $fmt;
};
print { $self->{wr} } $rec or die "print: $!";
$self->{tot_size} += length($rec);
};
print { $self->{wr} } $rec or die "print: $!";
$self->{tot_size} += length($rec);