Bug 113128

Summary: Hierarchy Denormalization fails when adding a subgroup to a group in certain cases
Product: [Retired] Red Hat Web Application Framework Reporter: Brett Prucha <pruchaba_bah>
Component: otherAssignee: Archit Shah <archit.shah>
Status: CLOSED RAWHIDE QA Contact: Jon Orris <jorris>
Severity: high Docs Contact:
Priority: high    
Version: nightly   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2004-01-28 19:29:27 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 106481    
Attachments:
Description Flags
Package Hierarchy Denormalization Fix none

Description Brett Prucha 2004-01-08 18:39:04 UTC
Description of problem:

Hierarchy Denormalization fails when adding a subgroup to a group 
when that group is a subgroup to another group with more than one 
path.

Version-Release number of selected component (if applicable):


How reproducible:

Every time


Steps to Reproduce/Actual results/Expected results:

1. create group1, group2, group3, and group4

2. create a group subgroup map like so

 |- group1
 |  |- group2
 |  |  |- group3
 |  |- group3
 |- group4

group_subgroup_trans_index looks like the following:

group_id    subgroup_id    n_paths
^^^^^^^^    ^^^^^^^^^^^    ^^^^^^^
group1      group1         0
group1      group2         1
group1      group3         2

3. place group4 under group3

 |- group1
 |  |- group2
 |  |  |- group3
 |  |     |- group4
 |  |- group3
 |  |  |- group4

group_subgroup_trans_index looks like the following:

group_id    subgroup_id    n_paths
^^^^^^^^    ^^^^^^^^^^^    ^^^^^^^
group1      group1         0
group1      group2         1
group1      group3         2
group1      group4         1 <--- note: should be 2

4. remove group3 as a subgroup of group2

 |- group1
 |  |- group2
 |  |- group3
 |  |  |- group4

group_subgroup_trans_index looks like the following:

group_id    subgroup_id    n_paths
^^^^^^^^    ^^^^^^^^^^^    ^^^^^^^
group1      group1         0
group1      group2         1
group1      group3         1

Note: group4 is not a subgroup of group1 according to 
group_subgroup_trans_index but it should be!


Additional info:

I am attaching a fix.  I am running MS SQL Server 2000 so have only 
tested it with that database.  I just translated the MS SQL Server 
logic into PL/SQL and don't even know if it complies but if not you 
should get the idea.

Comment 1 Brett Prucha 2004-01-08 18:41:41 UTC
Created attachment 96835 [details]
Package Hierarchy Denormalization Fix

Comment 2 Richard Li 2004-01-08 18:59:07 UTC
When did you port the code?

A similar problem was identified in Sept, and fixed on the tip @36509
(Sept 30) for Oracle. This fix was then accidentally lost on Oct 23,
and then re-fixed on Nov 3. It was ported to the Postgres
denormalization on 
November 3.

Assigning to ashah to verify.

Comment 3 Brett Prucha 2004-01-08 19:25:35 UTC
I ported it from the 5.3.0 nightly builds 08.11.2003 however I 
compared it to 6.1.0 nightly build 12.13.2003 and it was the same.

Comment 4 Archit Shah 2004-01-26 23:26:09 UTC
Fixed (@39777). I modified the patch slightly (for aesthetics) and
applied to both oracle and postgres.