[Zope-dev] Re: [Zope] range:min bug in ZCatalogs fo Zope 2.3.2

Johan Carlsson [Torped] johanc@torped.se
Fri, 22 Mar 2002 10:01:19 +0100


At 06:08 2002-03-21 -0500, you wrote:
>Try to reproduce the same problem under 2.5.X.
>Or upgrade to 2.5.X.
>Andreas

The problem is reproducible in Zope 2.3.2 but doesn't appear in Zope 2.5.0.

What I have tested is a OOBTree with DateTime values (or None) as keys and
IITreeSet or integers as values (as in the case with FieldIndexes).
The OOBTrees items method gets called with one argument (a DateTime)
resulting in a list of sets containing items with keys larger than the passed
DateTime value.
When tested on Zope 2.3.2 some dates result in a empty list.

So, upgrading our software to 2.5.0 would take some time and I need
a quick fix. Would it be possible to run the BTree code from
Zope 2.5.0 in Zope 2.3.2?

Best Regards,
Johan Carlsson





> > Hi,
> > I have encountered a strange problem with ZCatalogs in Zope 2.3.2.
> >
> > We have objects having DateTime arguments effective_date and
>expiration_date
> > that gets indexed in different ZCatalogs. (The index is a field index).
> >
> > We then tries to get all published objects that have not yet been
>archived:
> >
> > now=_.DateTime()
> > Service.searchResults(
> >      effective_date =now, effective_date_usage='range:max'
> >      , expiration_date =now, expiration_date_usage='range:min'
> > )
> >
> >
> > Now this works fine, until one day when result searchResults returns an
> > empty result list
> > which is not expected.
> > It seems to be that some days the range:min statement doesn't work
>correctly.
> > (I tried with different range:* combinations and the only thing I found
>not
> > working
> > is the range:min statement (some days).
> >
> > If I instead use a different value for now:
> >
> > now2 = _.DateTime(now.Date())  # now.Date()  returns somethong like
> > "2002/03/21" which in turn makes the now2 equal to the DateTime value
> > "2002/03/21 00:00:000 GMT+1" (GMT+1 is my local TimeZone)
> >
> > Now using now2 in:
> >
> > Service.searchResults(
> >      effective_date =now, effective_date_usage='range:max'
> >      , expiration_date =now2, expiration_date_usage='range:min'
> > )
> >
> > will always result in a list (all though it gets quantized to midnight the
> > resulting list will be somewhat biased).
> >
> > What I don't seem to understand is that DateTime() and
> > DateTime(DateTime().Date) gets so different results.
> >
> > Have anyone seen something like this before?
> >
> > Best Regards,
> > Johan Carlsson
> >
> >
> >
> >
> > --
> > Johan Carlsson, Torped AB
> >
> > http://www.torped.se -- http://easypublisher.torped.se
> >
> >
> > _______________________________________________
> > Zope maillist  -  Zope@zope.org
> > http://lists.zope.org/mailman/listinfo/zope
> > **   No cross posts or HTML encoding!  **
> > (Related lists -
> >  http://lists.zope.org/mailman/listinfo/zope-announce
> >  http://lists.zope.org/mailman/listinfo/zope-dev )
> >