Skip to content

Commit aae2bd2

Browse files
committed
Set parent view id to object
1 parent 161b2c7 commit aae2bd2

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

soql/parser/postprocess/normalize.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,10 +252,17 @@ func (ctx *normalizeQueryContext) normalizeQuery(
252252
q.From[i].ViewId = viewId
253253
}
254254

255-
objDepth := len(q.From[i].Name) + ctx.headObjDepthOffset
255+
nameLen := len(q.From[i].Name)
256+
objDepth := nameLen + ctx.headObjDepthOffset
256257
if ctx.maxDepth < objDepth {
257258
ctx.maxDepth = objDepth
258259
}
260+
if nameLen > 1 {
261+
parentKey := nameutil.MakeDottedKeyIgnoreCase(q.From[i].Name, nameLen-1)
262+
if parentViewId, ok := ctx.viewIdMap[parentKey]; ok {
263+
q.From[i].ParentViewId = parentViewId
264+
}
265+
}
259266
}
260267

261268
// TODO: * check object graph when aggregation(group by)

0 commit comments

Comments
 (0)