bdbdatastore
bdbdatastore copied to clipboard
Query with different results from default datastore
I get different results in BDBDatastore and default datastore for the following query:
results = Query(Model).filter('created <', datetime.datetime(2009, 5, 3, 1, 59, 17)).order('-created').order('__key__').fetch(10)
There's an entity stored with created = datetime.datetime(2009, 5, 3, 1, 59, 17). It is returned as the first result where it should not.
here is a demo of a query returning wrong results:
http://paste.pocoo.org/show/119841/
This happens in queries that use a >= filter, or a <= filter and a descending sort order, where the first entity fetched exactly matches the filter, but extra fields in the index after the inequality cause the 'is equal' test for the initial entity to fail.