@@ -0,0 +1,2210 @@
+package com.akiban.cserver.itests.bugs.bug687049;%0A%0Aimport com.akiban.cserver.InvalidOperationException;%0Aimport com.akiban.cserver.api.common.TableId;%0Aimport com.akiban.cserver.itests.ApiTestBase;%0Aimport org.junit.Test;%0A%0Apublic final class TableAndColumnDuplicationIT extends ApiTestBase %7B%0A%0A    @Test%0A    public void sameTableAndColumn() throws InvalidOperationException %7B%0A        doTest(%22tbl1%22, %22id1%22, %22tbl1%22, %22id1%22);%0A    %7D%0A%0A    @Test%0A    public void sameTableDifferentColumn() throws InvalidOperationException %7B%0A        doTest(%22tbl1%22, %22id1%22, %22tbl1%22, %22id2%22);%0A    %7D%0A%0A    @Test%0A    public void differentTableSameColumn() throws InvalidOperationException %7B%0A        doTest(%22tbl1%22, %22id1%22, %22tbl2%22, %22id1%22);%0A    %7D%0A%0A    @Test%0A    public void differentTableDifferentColumn() throws InvalidOperationException %7B%0A        doTest(%22tbl1%22, %22id1%22, %22tbl2%22, %22id2%22);%0A    %7D%0A%0A    private void doTest(String schema1TableName, String schema1TableKeyCol,%0A                        String schema2TableName, String schema2TableKeyCol) throws InvalidOperationException%0A    %7B%0A        final TableId schema1Table%0A                = createTable(%22schema1%22, schema1TableName, schema1TableKeyCol + %22 int key, name varchar(32)%22);%0A        final TableId schema2Table =%0A                createTable(%22schema2%22, schema2TableName, schema2TableKeyCol + %22 int key, name varchar(32)%22);%0A%0A        writeRows(%0A                createNewRow(schema1Table, 0L, %22alpha-0%22),%0A                createNewRow(schema1Table, 1L, %22alpha-1%22),%0A                createNewRow(schema1Table, 2L, %22alpha-1%22)%0A        );%0A%0A        writeRows(%0A                createNewRow(schema2Table, 0L, %22bravo-0%22),%0A                createNewRow(schema2Table, 1L, %22bravo-1%22),%0A                createNewRow(schema2Table, 2L, %22bravo-1%22)%0A        );%0A%0A        expectFullRows( schema1Table,%0A                createNewRow(schema1Table, 0L, %22alpha-0%22),%0A                createNewRow(schema1Table, 1L, %22alpha-1%22),%0A                createNewRow(schema1Table, 2L, %22alpha-1%22)%0A        );%0A%0A        expectFullRows( schema2Table,%0A                createNewRow(schema2Table, 0L, %22bravo-0%22),%0A                createNewRow(schema2Table, 1L, %22bravo-1%22),%0A                createNewRow(schema2Table, 2L, %22bravo-1%22)%0A        );%0A    %7D%0A%7D%0A

Adding tests for the bug. There are four tests: - same table, same key columns - same table, diff key columns - diff table, same key columns - diff table, diff key columns