Source:
public void testRepeat() throws NoConnectionsException, IOException, ProcCallException { System.out.println("STARTING test Repeat"); Client client = getClient(); ClientResponse cr; VoltTable result; cr = client.callProcedure("P1.insert", 1, "foo", 1, 1.0, new Timestamp(1000000000000L)); assertEquals(ClientResponse.SUCCESS, cr.getStatus()); cr = client.callProcedure("REPEAT", 0, 1); assertEquals(ClientResponse.SUCCESS, cr.getStatus()); result = cr.getResults()[0]; assertEquals(1, result.getRowCount()); assertTrue(result.advanceRow()); assertEquals("", result.getString(1)); cr = client.callProcedure("REPEAT", 1, 1); assertEquals(ClientResponse.SUCCESS, cr.getStatus()); result = cr.getResults()[0]; assertEquals(1, result.getRowCount()); assertTrue(result.advanceRow()); assertEquals("foo", result.getString(1)); cr = client.callProcedure("REPEAT", 3, 1); assertEquals(ClientResponse.SUCCESS, cr.getStatus()); result = cr.getResults()[0]; assertEquals(1, result.getRowCount()); assertTrue(result.advanceRow()); assertEquals("foofoofoo", result.getString(1)); if (!isHSQL()) { String expectedError = "VOLTDB ERROR: SQL ERROR\\s*+The result of the REPEAT function is larger than the maximum size allowed " + "for strings \\(1048576 bytes\\)\\. Reduce either the string size or repetition count\\."; verifyProcFails(client, expectedError, "REPEAT", 10000000, 1); verifyProcFails(client, expectedError, "REPEAT", 4611686018427387903L, 1); } cr = client.callProcedure("@AdHoc", "select repeat('', 100000000000) from P1 limit 1"); assertContentOfTable(new Object[][] {{""}}, cr.getResults()[0]); }

Target:
public void testRepeat() throws NoConnectionsException, IOException, ProcCallException { System.out.println("STARTING test Repeat"); Client client = getClient(); ClientResponse cr; VoltTable result; cr = client.callProcedure("P1.insert", 1, "foo", 1, 1.0, new Timestamp(1000000000000L)); assertEquals(ClientResponse.SUCCESS, cr.getStatus()); cr = client.callProcedure("REPEAT", 0, 1); assertEquals(ClientResponse.SUCCESS, cr.getStatus()); result = cr.getResults()[0]; assertEquals(1, result.getRowCount()); assertTrue(result.advanceRow()); assertEquals("", result.getString(1)); cr = client.callProcedure("REPEAT", 1, 1); assertEquals(ClientResponse.SUCCESS, cr.getStatus()); result = cr.getResults()[0]; assertEquals(1, result.getRowCount()); assertTrue(result.advanceRow()); assertEquals("foo", result.getString(1)); cr = client.callProcedure("REPEAT", 3, 1); assertEquals(ClientResponse.SUCCESS, cr.getStatus()); result = cr.getResults()[0]; assertEquals(1, result.getRowCount()); assertTrue(result.advanceRow()); assertEquals("foofoofoo", result.getString(1)); if (!isHSQL()) { String expectedError = "VOLTDB ERROR: SQL ERROR\\s*+The result of the REPEAT function is larger than the maximum size allowed " + "for strings \\(1048576 bytes\\)\\. Reduce either the string size or repetition count\\."; verifyProcFails(client, expectedError, "REPEAT", 10000000, 1); verifyProcFails(client, expectedError, "REPEAT", 4611686018427387903L, 1); } long startTime = System.nanoTime(); cr = client.callProcedure("@AdHoc", "select repeat('', 10000000000000) from P1 limit 1"); assertContentOfTable(new Object[][] {{""}}, cr.getResults()[0]); long elapsedNanos = System.nanoTime() - startTime; assertTrue("Repeat with empty string took too long!", elapsedNanos < 1000000000L * 60L); }