IPerson.getBranch() should return only one result
Bug #41164 reported by
Diogo Matsubara
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Launchpad itself |
Fix Released
|
Critical
|
Unassigned |
Bug Description
IPerson.getBranch() is returning more than one result causing OOPS-113D552
Changed in launchpad: | |
status: | Confirmed → Fix Released |
To post a comment you must log in.
Hu-ho.... this oops looks like database fuck-up. This query should never ever return more than one result if the proper db constraints are there.
Therefore, the constraint of "owner, product, name" are unique for Branches is broken. That's VERY bad!
launchpad_prod=> select branch.id, branch.owner, person.name as owner_name, bra\nch.product, product.name as product_name, branch.name from (select owner, prod\uct, name from branch group by owner, product, name having count(*) > 1) as dup\_branch join branch using (owner, product, name) join person on branch.owner = \person.id join product on branch.product = product.id; ------- +------ ------+ ------- --+---- ------- ------+ ------
id | owner | owner_name | product | product_name | name
------+
1128 | 21568 | scotth | 1533 | brightcloud-web | main
1144 | 21568 | scotth | 1533 | brightcloud-web | main
1145 | 21568 | scotth | 1533 | brightcloud-web | main
(3 rows)