[Bugs] #1342 IMME: range queries use lexical comparison, not numerical
Sugar Labs Bugs
bugtracker-noreply at sugarlabs.org
Wed Sep 23 05:13:04 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:3 sascha_silbe]:
> Replying to [comment:2 tomeu]:
> > I think we should be able to accept strings in
properties['timestamp'].
> For that to work we need to add type information to _QUERY_VALUE_MAP (or
special-case timestamp somewhere else in the code) so we know we need to
convert the string to an integer first.
Why not just doing this?
{{{
document.add_value(_VALUE_TIMESTAMP,
xapian.sortable_serialise(float(properties['timestamp'])))
}}}
It will fail if people put there non-numeric values, but at least it won't
fail if people happen to pass a dbus string instead of a dbus numeric
type.
--
Ticket URL: <http://bugs.sugarlabs.org/ticket/1342#comment:4>
Sugar Labs <http://sugarlabs.org/>
Sugar Labs bug tracking system
More information about the Bugs
mailing list