FoundationDB/sql-layer — pull request #1142 by MMcM (2013-12-31 18:08:01+00:00)
Title: Freeze a ProjectedRow leaving a Map_NestedLoops

The root problem is that delayed execution, as implemented by ProjectedRow.valueAt, is tricky to get right in the face of context and resource reuse.

We have removed row reuse, which was one such source of problems. In pipelined mode, we have mostly removed binding position reuse: nested bindings now form a tree. So this bug only shows up in tests and using Persistit. For that reason, this branch just fixes it by freezing the ProjectedRow if it's generated out of a nested-loops Map.

I could be persuaded to remove freezing of ProjectedRows altogether (it's also in Sort), in favor of evaluating right away when the row is built.

Includes the earlier explain branch.