query.extra(where=...) lack parenthesis
|Reported by:||Marek Brzóska <brzoskamarek@…>||Owned by:||Fandekasp|
|Component:||Database layer (models, ORM)||Version:||1.3|
|Cc:||brzoskamarek@…, eleather, lemaire.adrien@…||Triage Stage:||Ready for checkin|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
When using some_query.extra(where="some_code OR more_code") documentation says the where-clause will be ANDed with other conditions.
I believe the ANDing part does not surround the user specified where-clause with parenthesis which in this case leads to erroneous code because AND has higher priority than OR.
Change History (8)
comment:1 Changed 3 years ago by eleather
- Cc eleather added
- Easy pickings set
- Needs documentation unset
- Needs tests unset
- Patch needs improvement unset
- Triage Stage changed from Unreviewed to Accepted