[Bugs] #1342 IMME: range queries use lexical comparison, not numerical

Sugar Labs Bugs bugtracker-noreply at sugarlabs.org
Wed Sep 23 06:21:43 EDT 2009


#1342: range queries use lexical comparison, not numerical
--------------------------------+-------------------------------------------
    Reporter:  sascha_silbe     |          Owner:  sascha_silbe     
        Type:  defect           |         Status:  new              
    Priority:  Immediate        |      Milestone:  0.86             
   Component:  sugar-datastore  |        Version:  Git as of bugdate
    Severity:  Minor            |       Keywords:  r?               
Distribution:  Unspecified      |   Status_field:  Assigned         
--------------------------------+-------------------------------------------

Comment(by tomeu):

 Replying to [comment:5 sascha_silbe]:
 > Replying to [comment:4 tomeu]:
 > > Why not just doing this?
 > > {{{
 > > document.add_value(_VALUE_TIMESTAMP,
 xapian.sortable_serialise(float(properties['timestamp'])))
 > > }}}
 > Because that's only half of the solution and IMO the less important
 half.

 Well, for me it's important that we don't add more points of failure to
 activity development.

 > Timestamps are usually generated by the sugar.* framework while saving
 the entry, I can't think of any reason a (Python) activity would want to
 do it on their own and then I'd rather have it fail right away if they
 don't pass a numeric type, especially if passing a string for querying
 doesn't work.

 I really don't see why you don't think it's good to play a bit safer.

 > The other half is querying and this is where is makes an important
 difference: We need to know we're expecting a numeric type in order to
 invoke sortable_serialise() before comparison. sortable_serialise()
 produces binary data, so comparing with a decimal string doesn't make any
 sense.

 I'm just saying to accept the timestamp property in both string and
 numerical dbus types. It of course needs to contain a number, just don't
 see what we gain by enforcing it to be a numerical dbus type there.

-- 
Ticket URL: <http://bugs.sugarlabs.org/ticket/1342#comment:6>
Sugar Labs <http://sugarlabs.org/>
Sugar Labs bug tracking system


More information about the Bugs mailing list