Graph activity passing in wrong parent context to loop graph, causing crash/unexpected results

Description

Instead of using helper constructable IHThorGraphLoopArg::createParentExtract context, the Graph activity is incorrectly using the parent context from the outer owning graph (if any).

Conclusion

None

Activity

Show:

Jacob Cobbett-Smith April 6, 2021 at 11:17 AM

With help from GH, test used to validate fix:

namesRec := RECORD STRING20 lname; STRING10 fname; UNSIGNED2 age := 25; UNSIGNED2 ctr := 0; END; namesTable2(unsigned dftage) := sort(nofold(DATASET([{'Flintstone','Fred',35}, {'Flintstone','Wilma',33}, {'Jetson','Georgie',10}, {'Mr. T','Z-man', dftage}], namesRec)(dftage != 999)), age); i := INDEX(namesTable2(0),, 'i'); pRec := RECORD string vs; UNSIGNED4 id; STRING s; DATASET(namesRec) namesRes; END; loopBody(SET OF DATASET(namesRec) ds, DATASET(pRec) words, UNSIGNED4 c) := FUNCTION maxAge := 1;//MAX(ds[c-1], age); swords := SORT(nofold(words), -vs, LOCAL); RETURN i(keyed(lname = words[1].vs)); END; //g1 := GRAPH(namesTable2,3,loopBody(ROWSET(LEFT),COUNTER)); pds := DATASET(10, TRANSFORM(pRec, SELF.vs := 'Jetson'; SELF.id := COUNTER; SELF.s := (STRING)COUNTER; SELF.namesRes := [])); pRec doTrans(pRec l) := TRANSFORM infile := nofold(namesTable2(l.id)); SELF.namesRes := GRAPH(infile,3,loopBody(ROWSET(LEFT), DATASET([], pRec)+ROW(l, pRec), COUNTER + count(infile))); SELF := l; END; proj1 := PROJECT(nofold(pds), doTrans(LEFT)); SEQUENTIAL( BUILD(i, OVERWRITE); OUTPUT(proj1); );
Fixed
Pinned fields
Click on the next to a field label to start pinning.

Details

Components

Assignee

Reporter

Priority

Fix versions

Created April 6, 2021 at 10:36 AM
Updated April 6, 2021 at 12:26 PM
Resolved April 6, 2021 at 12:26 PM

Flag notifications