NYCPHP Meetup

NYPHP.org

[nycphp-talk] PEAR DB_Cache: is this a bug?

David Mintz dmintz at davidmintz.org
Thu Feb 5 12:01:18 EST 2004


Hey all.

I've been playing with DB_Cache and encountered a behavior in fetchRow()
that seems weird -- or I'm doing something stupid, always a leading
theory.

The version of my Cache package is 1.5.3 and the file (Cache/DB.php)
containing the class (Cache_DB_Result) containing the method says revision
1.7 I think it will save words to just show it to you:

http://177coles.dyndns.org/test/

It seems that the internal cursor starts one too high and overruns the end
of the array. You get a row missing at the beginning and a "undefined
offest" warning at the end of the loop. I hacked up a crude fix that makes
the problem ~apparently~ go away and I can show ya that too if anyone's
interested.

Even more interesting, if you call fetchRow with arguments
DB_FETCHMODE_XXX and a $rownum, you go into an infinite loop. I didn't try
to fix that.

It's hard to imagine nobody else noticing these problems, but I found
nothing either in the PEAR bug reports or by doing some Googling. (Hence
my alternative theory, that I'm missing something.)

Does anyone know if this is still being maintained, or is it the end of
the line?


---
David Mintz
http://davidmintz.org/

        "Anybody else got a problem with Webistics?" -- Sopranos 24:17



More information about the talk mailing list