Skip Menu |

This queue is for tickets about the Tree-Numbered-Tools CPAN distribution.

Report information
The Basics
Id: 48068
Status: resolved
Worked: 20 hours (1200 min)
Priority: 0/
Queue: Tree-Numbered-Tools

People
Owner: johan [...] kuu.se
Requestors: danielh [...] e2eresolutions.com
Cc:
AdminCc:

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



Subject: non-sorted serials/parent cause null append error
Date: Tue, 21 Jul 2009 14:36:39 -0400
To: <bug-Tree-Numbered-Tools [...] rt.cpan.org>
From: "Daniel Higgins" <danielh [...] e2eresolutions.com>
the module fails with undefined errors if one of the following is true: 1- your list is not ordered by serial: this is caused by calling ->append in readArray(), Tree::Numbered will assign a its own serial number, starting from 0. which just happen to match if your list is sorted (and incidentally, but I haven't tested this, if your list does not skip any numbers). thus when calling getSubTree the parentid is the sale as Tree::Numbered's ideal of the serial 2- your list has serial with dependencies numbers higher than itself (eg, a node having serial 5 and parentid 10): this fails because the parent node is not created yet, so getSubTree returns a null. the solution is ordering by parentid, which fail because of the first bug -- Ce message a �t� v�rifi� par MailScanner pour des virus ou des polluriels et rien de suspect n'a �t� trouv�. -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean.
Subject: [rt.cpan.org #48068]
Date: Tue, 21 Jul 2009 15:00:53 -0400
To: <bug-Tree-Numbered-Tools [...] rt.cpan.org>
From: "Daniel Higgins" <danielh [...] e2eresolutions.com>
attached is a partial patch that fix the readArray() function. I have NOT fixed the other calls to getSubTree() -- Ce message a �t� v�rifi� par MailScanner pour des virus ou des polluriels et rien de suspect n'a �t� trouv�. -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean.

Message body is not shown because sender requested not to inline it.

Subject: Re: [rt.cpan.org #48068]
Date: Wed, 22 Jul 2009 08:34:23 +0200
To: bug-Tree-Numbered-Tools [...] rt.cpan.org
From: Johan Kuuse <kuuse [...] redantigua.com>
On Tue, 2009-07-21 at 15:01 -0400, Daniel Higgins via RT wrote: Show quoted text
> Queue: Tree-Numbered-Tools > Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=48068 > > > attached is a partial patch that fix the readArray() function. I have NOT fixed the other calls to getSubTree() >
Thanks for the patch. I'll try to reproduce the error, apply your patch, and then see how I can fix the other calls to getSubTree(). Regards, Johan
Subject: RE: [rt.cpan.org #48068]
Date: Wed, 22 Jul 2009 13:08:43 -0400
To: <bug-Tree-Numbered-Tools [...] rt.cpan.org>
From: "Daniel Higgins" <danielh [...] e2eresolutions.com>
sorry i should have done that myself here's a test case for bug #2 use Tree::Numbered::Tools; my $arrayref = [ [qw(serial parent name url)], [1, 0, 'ROOT', 'ROOT'], [2, 3, 'File', 'file.pl'], # notice this one has a parent to the next line [3, 1, 'File', 'file2.pl'], ]; my $tree = Tree::Numbered::Tools->readArray( arrayref => $arrayref, use_column_names => 1, ); here's a test case for bug #2 use Tree::Numbered::Tools; my $arrayref = [ [qw(serial parent name id)], [1, 0, 'ROOT', 'ROOT'], [5, 1, 'File', '5'], [2, 1, 'File', '2'], [4, 2, 'File', '4'], [3, 4, 'File', '3'], ]; my $tree = Tree::Numbered::Tools->readArray( arrayref => $arrayref, use_column_names => 1, ); print $tree->outputFile(); note that this one succeeds, but the tree is wrong. the output is # name id # ---- -- File 5 File 4 File 3 File 2 whereas ID 4 should have parent ID 2, but since it looks for Tree::Numbered's serial, it attaches to ID 5 (which is placed second in the list) and here's another test. it's not the exact description of bug #1, but I believe it's related, since id 5 doesn't exist according to Tree::Numbered's serial, the getSubTree() call fails on parentid 5 use Tree::Numbered::Tools; my $arrayref = [ [qw(serial parent name id)], [1, 0, 'ROOT', 'ROOT'], [5, 1, 'File', '5'], [8, 5, 'File', '8'], ]; my $tree = Tree::Numbered::Tools->readArray( arrayref => $arrayref, use_column_names => 1, ); print $tree->outputFile(); -- Daniel Higgins Technical Representative E2E Resolutions Inc. Phone: +1 (450) 926-8497 x2239 E-Mail: daniel.higgins@e2eresolutions.com web : http://www.e2eresolutions.com/ -----Message d'origine----- De : Johan Kuuse via RT [mailto:bug-Tree-Numbered-Tools@rt.cpan.org] Envoyé : July 22, 2009 2:35 AM À : danielh@e2eresolutions.com Objet : Re: [rt.cpan.org #48068] <URL: http://rt.cpan.org/Ticket/Display.html?id=48068 > On Tue, 2009-07-21 at 15:01 -0400, Daniel Higgins via RT wrote: Show quoted text
> Queue: Tree-Numbered-Tools > Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=48068 > > > attached is a partial patch that fix the readArray() function. I have NOT fixed the other calls to getSubTree() >
Thanks for the patch. I'll try to reproduce the error, apply your patch, and then see how I can fix the other calls to getSubTree(). Regards, Johan -- Ce message a t vrifi par MailScanner pour des virus ou des polluriels et rien de suspect n'a t trouv. -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. -- Ce message a �t� v�rifi� par MailScanner pour des virus ou des polluriels et rien de suspect n'a �t� trouv�. -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean.
Subject: RE: [rt.cpan.org #48068]
Date: Fri, 24 Jul 2009 02:01:14 +0200
To: bug-Tree-Numbered-Tools [...] rt.cpan.org
From: Johan Kuuse <kuuse [...] redantigua.com>
Hi Daniel, I attach a patch which includes both your patch and a workaround for the other bug; the array is sorted numerically by 'parent' before adding nodes to the tree. Hope that helps. Regards, Johan On Wed, 2009-07-22 at 13:09 -0400, Daniel Higgins via RT wrote: Show quoted text
> Queue: Tree-Numbered-Tools > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=48068 > > > sorry i should have done that myself > > here's a test case for bug #2 > > use Tree::Numbered::Tools; > my $arrayref = [ > [qw(serial parent name url)], > [1, 0, 'ROOT', 'ROOT'], > [2, 3, 'File', 'file.pl'], # notice this one has a parent to the next line > [3, 1, 'File', 'file2.pl'], > ]; > > my $tree = Tree::Numbered::Tools->readArray( > arrayref => $arrayref, > use_column_names => 1, > ); > > > here's a test case for bug #2 > use Tree::Numbered::Tools; > > my $arrayref = [ > [qw(serial parent name id)], > [1, 0, 'ROOT', 'ROOT'], > [5, 1, 'File', '5'], > [2, 1, 'File', '2'], > [4, 2, 'File', '4'], > [3, 4, 'File', '3'], > ]; > > my $tree = Tree::Numbered::Tools->readArray( > arrayref => $arrayref, > use_column_names => 1, > ); > > > print $tree->outputFile(); > > > > note that this one succeeds, but the tree is wrong. the output is > # > name id > # ---- -- > File 5 > File 4 > File 3 > File 2 > > whereas ID 4 should have parent ID 2, but since it looks for Tree::Numbered's serial, it attaches to ID 5 (which is placed second in the list) > > > > and here's another test. it's not the exact description of bug #1, but I believe it's related, since id 5 doesn't exist according to Tree::Numbered's serial, the getSubTree() call fails on parentid 5 > > use Tree::Numbered::Tools; > > my $arrayref = [ > [qw(serial parent name id)], > [1, 0, 'ROOT', 'ROOT'], > [5, 1, 'File', '5'], > [8, 5, 'File', '8'], > ]; > > my $tree = Tree::Numbered::Tools->readArray( > arrayref => $arrayref, > use_column_names => 1, > ); > > > print $tree->outputFile(); > > > > -- > Daniel Higgins > Technical Representative > E2E Resolutions Inc. > Phone: +1 (450) 926-8497 x2239 > E-Mail: daniel.higgins@e2eresolutions.com > web : http://www.e2eresolutions.com/ > > -----Message d'origine----- > De : Johan Kuuse via RT [mailto:bug-Tree-Numbered-Tools@rt.cpan.org] > Envoyé : July 22, 2009 2:35 AM > À : danielh@e2eresolutions.com > Objet : Re: [rt.cpan.org #48068] > > <URL: http://rt.cpan.org/Ticket/Display.html?id=48068 > > > On Tue, 2009-07-21 at 15:01 -0400, Daniel Higgins via RT wrote:
> > Queue: Tree-Numbered-Tools > > Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=48068 > > > > > attached is a partial patch that fix the readArray() function. I have NOT fixed the other calls to getSubTree() > >
> > Thanks for the patch. > I'll try to reproduce the error, apply your patch, and then see how I > can fix the other calls to getSubTree(). > > Regards, > Johan > > > > -- > Ce message a t vrifi par MailScanner pour des virus ou des polluriels et rien de > suspect n'a t trouv. > -- > This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. > > >

Message body is not shown because sender requested not to inline it.

Subject: RE: [rt.cpan.org #48068]
Date: Fri, 24 Jul 2009 09:29:36 -0400
To: <bug-Tree-Numbered-Tools [...] rt.cpan.org>
From: "Daniel Higgins" <danielh [...] e2eresolutions.com>
yep looks good, at least for the readArray() function. I haven't tested the others -- Daniel Higgins Technical Representative E2E Resolutions Inc. Phone: +1 (450) 926-8497 x2239 E-Mail: daniel.higgins@e2eresolutions.com web : http://www.e2eresolutions.com/ -----Message d'origine----- De : Johan Kuuse via RT [mailto:bug-Tree-Numbered-Tools@rt.cpan.org] Envoyé : July 23, 2009 8:02 PM À : danielh@e2eresolutions.com Objet : RE: [rt.cpan.org #48068] <URL: https://rt.cpan.org/Ticket/Display.html?id=48068 > Hi Daniel, I attach a patch which includes both your patch and a workaround for the other bug; the array is sorted numerically by 'parent' before adding nodes to the tree. Hope that helps. Regards, Johan -- Ce message a �t� v�rifi� par MailScanner pour des virus ou des polluriels et rien de suspect n'a �t� trouv�. -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean.
Subject: RE: [rt.cpan.org #48068]
Date: Wed, 29 Jul 2009 12:52:57 +0200
To: bug-Tree-Numbered-Tools [...] rt.cpan.org
From: Johan Kuuse <kuuse [...] redantigua.com>
I have rewritten the test script to for all functions to be more extensive, and fixed some minor bugs (besides the ones you found), and published it as a new version: http://search.cpan.org/~kuuse/Tree-Numbered-Tools-1.02/ At the time of this writing it hasn't been mirrored everywhere (read cpan.org), but you can get it from funet.fi: ftp://ftp.funet.fi/pub/languages/perl/CPAN/authors/id/K/KU/KUUSE/ If your scripts works with 1.02, you could close this ticket. Regards, Johan On Fri, 2009-07-24 at 09:30 -0400, Daniel Higgins via RT wrote: Show quoted text
> Queue: Tree-Numbered-Tools > Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=48068 > > > yep looks good, at least for the readArray() function. I haven't tested the others > > -- > Daniel Higgins > Technical Representative > E2E Resolutions Inc. > Phone: +1 (450) 926-8497 x2239 > E-Mail: daniel.higgins@e2eresolutions.com > web : http://www.e2eresolutions.com/ > > > -----Message d'origine----- > De : Johan Kuuse via RT [mailto:bug-Tree-Numbered-Tools@rt.cpan.org] > Envoyé : July 23, 2009 8:02 PM > À : danielh@e2eresolutions.com > Objet : RE: [rt.cpan.org #48068] > > <URL: https://rt.cpan.org/Ticket/Display.html?id=48068 > > > Hi Daniel, > > I attach a patch which includes both your patch and a workaround for the other bug; the array is sorted numerically by 'parent' before adding nodes to the tree. Hope that helps. > > Regards, > Johan > >
Subject: RE: [rt.cpan.org #48068]
Date: Wed, 29 Jul 2009 13:50:37 -0400
To: <bug-Tree-Numbered-Tools [...] rt.cpan.org>
From: "Daniel Higgins" <danielh [...] e2eresolutions.com>
the original bugs are fixed as far as i can tell, one comment and one one minor issue came up 1. it now "requires" version 5.8.9 of perl, but runs fine under 5.8.8 2. the addition of "use warnings" causes one to show up on line 1480 if your sql string begin or end with a newline -- Daniel Higgins Technical Representative E2E Resolutions Inc. Phone: +1 (450) 926-8497 x2239 E-Mail: daniel.higgins@e2eresolutions.com web : http://www.e2eresolutions.com/ -- Ce message a �t� v�rifi� par MailScanner pour des virus ou des polluriels et rien de suspect n'a �t� trouv�. -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean.
Subject: RE: [rt.cpan.org #48068]
Date: Thu, 30 Jul 2009 15:35:45 +0200
To: bug-Tree-Numbered-Tools [...] rt.cpan.org
From: Johan Kuuse <kuuse [...] redantigua.com>
On Wed, 2009-07-29 at 13:51 -0400, Daniel Higgins via RT wrote: Show quoted text
> Queue: Tree-Numbered-Tools > Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=48068 > > > the original bugs are fixed as far as i can tell, one comment and one one minor issue came up > > 1. it now "requires" version 5.8.9 of perl, but runs fine under 5.8.8 > 2. the addition of "use warnings" causes one to show up on line 1480 if your sql string begin or end with a newline > > -- > Daniel Higgins > Technical Representative > E2E Resolutions Inc. > Phone: +1 (450) 926-8497 x2239 > E-Mail: daniel.higgins@e2eresolutions.com > web : http://www.e2eresolutions.com/ >
1. I changed minimal required version to 5.6.0 2. I stripped the sql sentence from leading and trailing whitespace characters (newline included) to avoid the warning message. (I couldn't reproduce the warning with leading newline(s), though, only with trailing ones.) Before I publish version 1.03 (attached), may you please confirm that i works for you as well? Regards, Johan
Download Tree-Numbered-Tools-1.03.tar.gz
application/x-compressed-tar 30.4k

Message body not shown because it is not plain text.

Subject: RE: [rt.cpan.org #48068]
Date: Thu, 30 Jul 2009 09:43:23 -0400
To: <bug-Tree-Numbered-Tools [...] rt.cpan.org>
From: "Daniel Higgins" <danielh [...] e2eresolutions.com>
everything looks good to go thanks -- Ce message a �t� v�rifi� par MailScanner pour des virus ou des polluriels et rien de suspect n'a �t� trouv�. -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean.
Subject: RE: [rt.cpan.org #48068]
Date: Thu, 30 Jul 2009 17:00:40 +0200
To: bug-Tree-Numbered-Tools [...] rt.cpan.org
From: Johan Kuuse <kuuse [...] redantigua.com>
I have uploaded 1.03 to CPAN, so you can close the ticket now. Thanks a lot for your collaboration! Regards, Johan
Subject: RE: [rt.cpan.org #48068]
Date: Thu, 30 Jul 2009 11:36:06 -0400
To: <bug-Tree-Numbered-Tools [...] rt.cpan.org>
From: "Daniel Higgins" <danielh [...] e2eresolutions.com>
sorry but the interface won't let me close it, even after logging in. probably because I don't own the bug/package -- Ce message a �t� v�rifi� par MailScanner pour des virus ou des polluriels et rien de suspect n'a �t� trouv�. -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean.
Case closed. Bye. :-)