SQLObject.select appears to generates bogus SQL if an empty string is passed as the first arg
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Launchpad itself |
Fix Released
|
High
|
Christian Reis |
Bug Description
In the BugSet.searchAsUser update that I'm about to submit to pqm, there's some code like this:
if where_clauses:
return Bug.select(
' AND '.join(
else:
return Bug.select(
which works as expected (i.e. bug.txt passes.) But changing that to:
return Bug.select("", **other_params)
causes exception output like:
...
Programming
SELECT COUNT(*) FROM Bug WHERE
...
when running the bug.txt test.
Instead, I would have expected my tests to fail (because I've changed the behaviour to have empty filter criteria), but not raise ProgrammingError exceptions.
Changed in launchpad: | |
assignee: | nobody → spiv |
description: | updated |
Changed in launchpad: | |
assignee: | spiv → kiko |
Changed in launchpad: | |
status: | Fix Committed → Fix Released |
Yeah, it's an SQLObject bug. The trivial workaround is using "1=1", which I believe can be found in our codebase in places.