Skip to content

Commit 6f0ae5b

Browse files
authored
fix(query): fix profile graph broken for merge (#18436)
1 parent 7188477 commit 6f0ae5b

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/query/pipeline/core/src/pipeline.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,16 +144,18 @@ impl Pipeline {
144144
return self;
145145
}
146146

147+
let root_scope = root_scope.unwrap();
148+
147149
for node in self.graph.node_weights_mut() {
148150
let Some(scope) = node.scope.as_mut() else {
149-
node.scope = root_scope.clone();
151+
node.scope = Some(root_scope.clone());
150152
continue;
151153
};
152154

153-
if scope.parent_id.is_none() {
155+
if scope.parent_id.is_none() && scope.id != root_scope.id {
154156
unsafe {
155157
let scope = Arc::get_mut_unchecked(scope);
156-
scope.parent_id = root_scope.as_ref().map(|x| x.id);
158+
scope.parent_id = Some(root_scope.id);
157159
}
158160
}
159161
}

0 commit comments

Comments
 (0)