FoundationDB/sql-layer — pull request #1404 by ScottDugas (2014-08-14 20:00:07+00:00)
Title: Don't assume ANY[i] is same as project index

InConditionReverser.cleanUpSemiJoin assumes that all conditions
from the original (t1.a = ANY[0] and t2.b = ANY[1]) will be in the
final joinConditions and that the condition index, is the same as
the projected column index, but when you have an index on t2.c it
removes that from the list of join conditions, so the
joinConditions are just t2.b = ANY[1] which cleanUpSemiJoin than
updates to t2.b = t2.c. Instead get the position from the right
hand side of the condition and replace it with that index