[Xapian-tickets] [Xapian] #321: build_numeric_ranges sometimes builds invalid ranges

Xapian nobody at xapian.org
Tue Jan 6 12:53:13 GMT 2009


#321: build_numeric_ranges sometimes builds invalid ranges
--------------------+-------------------------------------------------------
 Reporter:  shane   |       Owner:  olly
     Type:  defect  |      Status:  new 
 Priority:  normal  |   Milestone:      
Component:  Other   |     Version:      
 Severity:  normal  |    Keywords:      
Blockedby:          |    Platform:  All 
 Blocking:          |  
--------------------+-------------------------------------------------------
 CategorySelectMatchSpy::build_numeric_ranges can occasionally construct
 ranges where one interval overlaps all others.

 The attached python script shows the problem (apologies for the external
 dependency). It prints the range constructed:
 {{{
 #!python
 [((11.949999999999999, 60.0), 2), ((14.5, 14.5), 1)]
 }}}
 when it should be:
 {{{
 #!python
 [((11.949999999999999, 11.949999999999999), 1), ((14.5, 14.5), 1), ((60.0,
 60.0), 1)]
 }}}
 This was using fedora 10 on x86_64.

 The attached patch fixes this.

 b was getting set to size_t(-1) due to taking the floor of a number that
 was slightly on the wrong side of 0. It then later got set to n_buckets
 and that resulted in items that should have been in the smallest bucket
 ending up in the largest one.

-- 
Ticket URL: <http://trac.xapian.org/ticket/321>
Xapian <http://xapian.org/>
Xapian



More information about the Xapian-tickets mailing list