hpcc-systems/HPCC-Platform — pull request #2179 by ghalliday (2012-04-27 08:21:16+00:00)
Title: Fix internal error on complex nested field selection

In some circumstances it was possible to get the following error:
Attempting to lookup field in a dataset which has no active element.
This is preventing another option being enabled that would solve some
problems with conditional evaluation of expressions.

The root cause is the handling of no_select. A no_select should have a
newAtom attribute associated with it if it is selecting a field from a
new row. So a[1].b.c is represented as
select(select(a[1],b,new),c)

Some places were incorrectly checking if the current select had an
associated new attribute instead of checking if the root select had
one.

no_select(no_selectnth) now always has a newAttribute associated with it.
This simplifies and optimizes the processing of unnormalized trees.

This also contains a fix for hqliproj projecting a datarow, and better
expansion of (a.b.c.d within transforms)

Signed-off-by: Gavin Halliday