Merge lp:~wgrant/launchpad/bug-629921-packages-empty-filter into lp:launchpad
Proposed by
William Grant
Status: | Merged |
---|---|
Approved by: | Henning Eggers |
Approved revision: | no longer in the source branch. |
Merged at revision: | 11725 |
Proposed branch: | lp:~wgrant/launchpad/bug-629921-packages-empty-filter |
Merge into: | lp:launchpad |
Diff against target: |
44 lines (+18/-1) 2 files modified
lib/lp/soyuz/browser/archive.py (+1/-1) lib/lp/soyuz/browser/tests/test_archive_packages.py (+17/-0) |
To merge this branch: | bzr merge lp:~wgrant/launchpad/bug-629921-packages-empty-filter |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Henning Eggers (community) | code | Approve | |
Review via email: mp+37339@code.launchpad.net |
Commit message
Treat an empty PPA package name filter as if it were absent. - Landed by henninge.
Description of the change
Passing an empty name filter string into Archive:+packages causes a query asking for packages matching '%%', and PostgreSQL appears to be insufficiently clever to optimise that away to nothing. This can result in very slow query.
The view now treats an empty name filter identically to an omitted one, and the various cases are tested.
To post a comment you must log in.
On Sat, Oct 2, 2010 at 8:19 PM, William Grant <email address hidden> wrote: name_filter is not None: name_filter is not None and name_filter[ 0]) > 0): name_filter[ 0]
>
> - if requested_
> + if (requested_
> + len(requested_
> return requested_
I would write this as name_filter and requested_ name_filter[ 0]:'
'if requested_
Its more correct (if requested_ name_filter[ 0] = None, your code will crash).
Looks good otherwise.
-Rob