Skip Menu |

This queue is for tickets about the Palm-PDB CPAN distribution.

Report information
The Basics
Id: 101666
Status: resolved
Priority: 0/
Queue: Palm-PDB

People
Owner: Nobody in particular
Requestors: Alan.Wehmann [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: 1.016



Subject: patch to put deleted record last, in PDB.pm
Date: Wed, 21 Jan 2015 13:31:35 -0600
To: bug-Palm-PDB [...] rt.cpan.org
From: Alan Wehmann <alan.wehmann [...] gmail.com>
I note that for a SmartList-To-Go database, deleted records are all located after the ones that aren't deleted. This is true even in the case that records are added to a database that has deleted records (where the records are added on the handheld). PDB.pm puts appended records at the end of all records that were read in & it took me a while to realize that SLTG wants added records to come before the deleted ones. It makes this rearrangement itself (as noted in the previous paragraph--when records are added (on the handheld) to a database that contains deleted records). Below I include my patch to fix this problem: --- /opt/local/lib/perl5/site_perl/5.16.3/Palm/original/PDB.pm 2014-08-09 14:47:03.000000000 -0500 +++ /opt/local/lib/perl5/site_perl/5.16.3/Palm/original/fixed/PDB.pm 2015-01-21 13:26:47.000000000 -0600 @@ -723,6 +723,7 @@ my $self = shift; my $fname = shift; # Output file name my @record_data; + my @temp_data; die "Can't write a database with no name\n" unless $self->{name} ne ""; @@ -804,9 +805,16 @@ $id = $record->{id}; $data = $self->PackRecord($record); + if ($attributes & 0x80) { + push @temp_data, [ $attributes, $id, $data ]; + } + else { + push @record_data, [ $attributes, $id, $data ]; + } - push @record_data, [ $attributes, $id, $data ]; } + # put deleted records at end + push @record_data, @temp_data; # Figure out size of index $index_len = RecIndexHeaderLen + ($#record_data + 1) * IndexRecLen;
Are you reporting that SmartList-To-Go can't read a database that has deleted records before active records? Or does it just rearrange the database when it writes it back?
Subject: Re: [rt.cpan.org #101666] patch to put deleted record last, in PDB.pm
Date: Wed, 21 Jan 2015 16:36:03 -0600
To: bug-Palm-PDB [...] rt.cpan.org
From: Alan Wehmann <alan.wehmann [...] gmail.com>
If the deleted records aren’t at the end, they affect what is displayed by SmartList-To-Go (SLTG) on the handheld. If using a View to look at the database records, extra, bogus records show up. If looking at the records in detail, false information shows up. A detailed example might help. My test SLTG database had the following data in it: 0 00037 -1.500 1 01511 0.000 2 00004 0.250 3 00001 0.500 4 00087 1.500 5 00020 1.999 6 00010 2.000 7 01000 2.001 8 00003 4.000 9 00008 8.000 10 00010 10.000 11 00007 16.000 12 00014 16.001 13 00032 32.000 14 00064 64.000 15 00100 100.000 16 * 00011 128.000 10/16/1 17 02001 128.001 18 * 00200 200.000 2/14/1 19 * 01000 1000.000 9/9/10 20 01512 15000.000 The fields were integer, floating point, date (Column 1 shown here wasn’t in the database—it’s for numbering reference). I don’t show all the date values, only 3 of them. I deleted all but the records with asterisks (#s 16, 18, 19). If I didn’t append any records with the code that used PDB.pm, then the display of the three non-deleted records back on the handheld was okay (because SLTG arranged to have the deleted records last). However, if I added a couple of records with the code that used PDB.pm, the the display back on the handheld was cuckoo. In one direction, in detail view, the three non-deleted records were displayed. Then, for the next 18 steps on the handheld), the contents of the last non-deleted record (#19) would be repeatedly shown. Finally, for the last two steps, the two appended records were shown. In the reverse stepping direction on the handheld, the two appended records were shown, then the first appended record values would be shown for the next 18 steps going backward, then, finally, the three non-deleted records were shown. If all the deleted records are arranged to be at the end--after the records appended by the code--then the record display on the handheld was normal (the three non-deleted records, followed by the two appended records). Show quoted text
> On Jan 21, 2015, at 2:01 PM, Christopher J. Madsen via RT <bug-Palm-PDB@rt.cpan.org> wrote: > > <URL: https://rt.cpan.org/Ticket/Display.html?id=101666 > > > Are you reporting that SmartList-To-Go can't read a database that has deleted records before active records? Or does it just rearrange the database when it writes it back?