[Zope-Perl] Bug with recursion?
Kai.Olbrich@colt.de
Kai.Olbrich@colt.de
Mon, 3 Sep 2001 18:41:57 +0200
Hi,
i've a small SQL Table for a Bookmarkmanager, witch is recursive.
mysql> desc bm;
+----------+------------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+----------+------------------+------+-----+---------+-------+
| id | int(10) unsigned | | PRI | 0 | |
| parentid | int(10) unsigned | | | 0 | |
| title | varchar(30) | | | | |
+----------+------------------+------+-----+---------+-------+
3 rows in set (0.00 sec) =20
mysql> select * from bm;
+----+----------+---------------+
| id | parentid | title |
+----+----------+---------------+
| 1 | 0 | folder1 |
| 2 | 0 | folder2 |
| 3 | 1 | unterolder1 |
| 4 | 3 | nochnenfolder |
+----+----------+---------------+
4 rows in set (0.00 sec)
=20
When I execute the following zope-perl method, the first time I get the
right output.
But when I execute the same method with the _same_ argument like =
before, I
get no output.
Then I change the method, I only add a space or so and save, the same =
like
before.
The first call works, any following not.
Method queryParentLookup
Arguments: childid
select * from bm where id=3D<dtml-var childid>
------------------------------------------------
Method printpath
Arguments: self, child
my @ret;
rek_path($child);
my $ret=3Djoin(":", @ret);
sub rek_path {
for($self->queryParentLookup({childid=3D>$_[0]})) {
unshift(@ret, $_->title);
rek_path($_->parentid);
}
}
I'm using Zope 2.4.0 with Linux 2.4.x, pyperl 1.0.1, zoperl 1.0.beta5, =
Perl
5.6.1 (threading), Python 2.1, gcc 2.95.4
Any hints?
Gru=DF,
Kai Olbrich