incomplete version checking in run_query()
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
AppScale |
In Progress
|
Critical
|
Navraj Chohan |
Bug Description
With an app like:
class Kind1(db.Model)
Kind1 properties ...
class Kind2(db.model)
Kind2 properties ...
k1 = Kind1()
k2 = Kind2()
k1.properties = some value
...
k2.properties = some other value
...
k1.put()
k2.put()
results = db.GqlQuery("SELECT *")
The above app causes the function run_query() in AppDB/appscale_
to be called with a 'kindless' query.
The loop 'for kind in kinds:' at line 546 (in version 787.5.4)
is executed twice, once for Kind1 and once for Kind2.
After this loop the 'versions' list will only have 1 element
and the 'results' list will have two elements.
This is because 'versions' gets overwritten each time through the loop
and only retains the last list of version (transaction) numbers.
This means that the loop 'for index, ii in enumerate(
won't validate all of the entities in the 'results' list,
and will probably validate them using incorrect version (transaction) numbers.
Attached is a possible solution (diff against version 787.5.4, from the trunk)
Thanks for this patch. It's being merged at the github site. You've been added to the committers list at: http:// appscale. cs.ucsb. edu/people. html