@Test
public void reallocateOnBind() throws ClassNotFoundException {

    AkibanInformationSchema ais = AISBBasedBuilder.create(typesTranslator)
            .table("myschema", "mytable")
            .colInt("id", false)
            .colInt("int_0", true)
            .colInt("int_1", true)
            .colInt("int_2", true)
            .colInt("int_3", true)
            .colInt("int_4", true)
            .colString("bigstring", 500)
            .colString("smallstring", 2)
            .ais();
    List<?> values = Arrays.asList(
            1L, // id
            null, null, null, null, null, // int_x's
            Strings.repeat("a", 476), // bigstring
            "hi" // smallstring
    );
    Object[] valuesArray = values.toArray(new Object[values.size()]);
    RowData rowData = new RowData(new byte[500]);
    new SchemaFactory().buildRowDefs(ais);
    RowDef rowDef = ais.getTable("myschema", "mytable").rowDef();
    assertNotNull("RowDef", rowDef);
    try {
        rowData.createRow(rowDef, valuesArray, false);
        fail("expected ArrayIndexOutOfBoundsException");
    } catch (ArrayIndexOutOfBoundsException e) {
        boolean foundInBind = false;
        for (StackTraceElement frame : e.getStackTrace()) {
            Class<?> frameClass = Class.forName(frame.getClassName());
            if (RowDataTarget.class.isAssignableFrom(frameClass) && "bind".equals(frame.getMethodName())) {
                foundInBind = true;
                break;
            }
        }
        assertTrue("stack trace didn't include RowDataTarget.bind", foundInBind);
    }
}