FoundationDB/sql-layer — pull request #1236 by MMcM (2014-03-13 23:14:30+00:00)
Title: When converting a subquery to a semi-join, be careful about where its WHERE conditions end up

They can go on the inside join if it's INNER, better reflecting what they apply to. Otherwise, they must go into the semi-join. Prior to this change, they always went into the inside join.

See new test for an example. IS NULL as part of the LEFT condition would fail always, giving only outer rows.

To make this more evident, a new rules test suite is created with a shorter ruleset that doesn't transform things after this rule that has the problem. (The former reverse-in did more because some of what it sets up happens later via static methods.)