@@ -0,0 +1,2625 @@
+/**%0A * END USER LICENSE AGREEMENT (%E2%80%9CEULA%E2%80%9D)%0A *%0A * READ THIS AGREEMENT CAREFULLY (date: 9/13/2011):%0A * http://www.akiban.com/licensing/20110913%0A *%0A * BY INSTALLING OR USING ALL OR ANY PORTION OF THE SOFTWARE, YOU ARE ACCEPTING%0A * ALL OF THE TERMS AND CONDITIONS OF THIS AGREEMENT. YOU AGREE THAT THIS%0A * AGREEMENT IS ENFORCEABLE LIKE ANY WRITTEN AGREEMENT SIGNED BY YOU.%0A *%0A * IF YOU HAVE PAID A LICENSE FEE FOR USE OF THE SOFTWARE AND DO NOT AGREE TO%0A * THESE TERMS, YOU MAY RETURN THE SOFTWARE FOR A FULL REFUND PROVIDED YOU (A) DO%0A * NOT USE THE SOFTWARE AND (B) RETURN THE SOFTWARE WITHIN THIRTY (30) DAYS OF%0A * YOUR INITIAL PURCHASE.%0A *%0A * IF YOU WISH TO USE THE SOFTWARE AS AN EMPLOYEE, CONTRACTOR, OR AGENT OF A%0A * CORPORATION, PARTNERSHIP OR SIMILAR ENTITY, THEN YOU MUST BE AUTHORIZED TO SIGN%0A * FOR AND BIND THE ENTITY IN ORDER TO ACCEPT THE TERMS OF THIS AGREEMENT. THE%0A * LICENSES GRANTED UNDER THIS AGREEMENT ARE EXPRESSLY CONDITIONED UPON ACCEPTANCE%0A * BY SUCH AUTHORIZED PERSONNEL.%0A *%0A * IF YOU HAVE ENTERED INTO A SEPARATE WRITTEN LICENSE AGREEMENT WITH AKIBAN FOR%0A * USE OF THE SOFTWARE, THE TERMS AND CONDITIONS OF SUCH OTHER AGREEMENT SHALL%0A * PREVAIL OVER ANY CONFLICTING TERMS OR CONDITIONS IN THIS AGREEMENT.%0A */%0A%0Apackage com.akiban.sql.optimizer.plan;%0A%0Aimport java.util.List;%0A%0Apublic class GroupLoopScan extends BaseScan%0A%7B%0A    private TableSource insideTable, outsideTable;%0A    private List%3CConditionExpression%3E joinConditions;%0A%0A    public GroupLoopScan(TableSource insideTable, TableSource outsideTable,%0A                         List%3CConditionExpression%3E joinConditions) %7B%0A        this.insideTable = insideTable;%0A        this.outsideTable = outsideTable;%0A        this.joinConditions = joinConditions;%0A    %7D%0A%0A    public TableSource getInsideTable() %7B%0A        return insideTable;%0A    %7D%0A    public TableSource getOutsideTable() %7B%0A        return outsideTable;%0A    %7D%0A%0A    public List%3CConditionExpression%3E getJoinConditions() %7B%0A        return joinConditions;%0A    %7D%0A%0A    @Override%0A    public boolean accept(PlanVisitor v) %7B%0A        if (v.visitEnter(this)) %7B%0A            // Don't own tables, right?%0A        %7D%0A        return v.visitLeave(this);%0A    %7D%0A%0A    @Override%0A    public String summaryString() %7B%0A        StringBuilder str = new StringBuilder(super.summaryString());%0A        str.append('(');%0A        str.append(outsideTable.summaryString());%0A        str.append(%22 - %22);%0A        str.append(insideTable.summaryString());%0A        if (getCostEstimate() != null) %7B%0A            str.append(%22, %22);%0A            str.append(getCostEstimate());%0A        %7D%0A        str.append(%22)%22);%0A        return str.toString();%0A    %7D%0A%0A%7D%0A

Add a new scan that represents the outer loop coming into the inner for group operations.