Buggy code:
public final class InbetweenTest extends BaseJDBCTestCase { public InbetweenTest ( String name ) { } public static Test suite ( ) { } ResultSet rs = null ; ResultSetMetaData rsmd ; SQLWarning sqlWarn = null ; PreparedStatement pSt ; CallableStatement cSt ; Statement st ; Connection conn ; String [ ] [ ] expRS ; String [ ] expColNames ; private void createTestObjects ( Statement st ) throws SQLException { conn = getConnection ( ) ; conn . setAutoCommit ( false ) ; CleanDatabaseTestSetup . cleanDatabase ( conn , false ) ; st . executeUpdate ( "set<seq2seq4repair_space>isolation<seq2seq4repair_space>to<seq2seq4repair_space>rr" ) ; st . executeUpdate ( ( "<seq2seq4repair_space>CREATE<seq2seq4repair_space>FUNCTION<seq2seq4repair_space>ConsistencyChecker()<seq2seq4repair_space>RETURNS<seq2seq4repair_space>VARCHAR(2000)" + ( ( ( "EXTERNAL<seq2seq4repair_space>NAME<seq2seq4repair_space>" + "'org.apache.derbyTesting.functionTests.util.T_Consis" ) + "tencyChecker.runConsistencyChecker'" ) + "LANGUAGE<seq2seq4repair_space>JAVA<seq2seq4repair_space>PARAMETER<seq2seq4repair_space>STYLE<seq2seq4repair_space>JAVA" ) ) ) ; st . executeUpdate ( "create<seq2seq4repair_space>table<seq2seq4repair_space>s<seq2seq4repair_space>(i<seq2seq4repair_space>int)" ) ; st . executeUpdate ( ( "<seq2seq4repair_space>create<seq2seq4repair_space>table<seq2seq4repair_space>t<seq2seq4repair_space>(i<seq2seq4repair_space>int,<seq2seq4repair_space>s<seq2seq4repair_space>smallint,<seq2seq4repair_space>c<seq2seq4repair_space>char(10),<seq2seq4repair_space>v<seq2seq4repair_space>" + ( "varchar(50),<seq2seq4repair_space>" + "d<seq2seq4repair_space>double<seq2seq4repair_space>precision,<seq2seq4repair_space>r<seq2seq4repair_space>real,<seq2seq4repair_space>e<seq2seq4repair_space>date,<seq2seq4repair_space>t<seq2seq4repair_space>time,<seq2seq4repair_space>p<seq2seq4repair_space>timestamp)" ) ) ) ; st . executeUpdate ( "<seq2seq4repair_space>create<seq2seq4repair_space>table<seq2seq4repair_space>test<seq2seq4repair_space>(i<seq2seq4repair_space>int,<seq2seq4repair_space>d<seq2seq4repair_space>double<seq2seq4repair_space>precision)" ) ; st . executeUpdate ( "create<seq2seq4repair_space>table<seq2seq4repair_space>big(i<seq2seq4repair_space>int,<seq2seq4repair_space>c<seq2seq4repair_space>char(10))" ) ; st . executeUpdate ( "create<seq2seq4repair_space>table<seq2seq4repair_space>bt1<seq2seq4repair_space>(i<seq2seq4repair_space>int,<seq2seq4repair_space>c<seq2seq4repair_space>char(5),<seq2seq4repair_space>de<seq2seq4repair_space>decimal(4,<seq2seq4repair_space>1))" ) ; st . executeUpdate ( ( "<seq2seq4repair_space>create<seq2seq4repair_space>table<seq2seq4repair_space>bt2<seq2seq4repair_space>(i<seq2seq4repair_space>int,<seq2seq4repair_space>d<seq2seq4repair_space>double,<seq2seq4repair_space>da<seq2seq4repair_space>date,<seq2seq4repair_space>t<seq2seq4repair_space>" + "time,<seq2seq4repair_space>tp<seq2seq4repair_space>timestamp,<seq2seq4repair_space>vc<seq2seq4repair_space>varchar(10))" ) ) ; st . executeUpdate ( "insert<seq2seq4repair_space>into<seq2seq4repair_space>s<seq2seq4repair_space>values<seq2seq4repair_space>(1)" ) ; st . executeUpdate ( "<seq2seq4repair_space>insert<seq2seq4repair_space>into<seq2seq4repair_space>s<seq2seq4repair_space>values<seq2seq4repair_space>(1)" ) ; st . executeUpdate ( "<seq2seq4repair_space>insert<seq2seq4repair_space>into<seq2seq4repair_space>s<seq2seq4repair_space>values<seq2seq4repair_space>(2)" ) ; st . executeUpdate ( ( "<seq2seq4repair_space>insert<seq2seq4repair_space>into<seq2seq4repair_space>t<seq2seq4repair_space>values<seq2seq4repair_space>(null,<seq2seq4repair_space>null,<seq2seq4repair_space>null,<seq2seq4repair_space>null,<seq2seq4repair_space>" + "null,<seq2seq4repair_space>null,<seq2seq4repair_space>null,<seq2seq4repair_space>null,<seq2seq4repair_space>null)" ) ) ; st . executeUpdate ( ( ( ( "<seq2seq4repair_space>insert<seq2seq4repair_space>into<seq2seq4repair_space>t<seq2seq4repair_space>values<seq2seq4repair_space>(0,<seq2seq4repair_space>100,<seq2seq4repair_space>'hello',<seq2seq4repair_space>'everyone<seq2seq4repair_space>" + ( ( "is<seq2seq4repair_space>here',<seq2seq4repair_space>200.0e0," + "<seq2seq4repair_space>300.0e0,<seq2seq4repair_space>'1992-01-01','12:30:30'," ) + "'" ) ) + ( Timestamp . valueOf ( "1992-01-01<seq2seq4repair_space>12:30:30" ) ) ) + "')" ) ) ; st . executeUpdate ( ( ( ( "insert<seq2seq4repair_space>into<seq2seq4repair_space>t<seq2seq4repair_space>values<seq2seq4repair_space>(-1,<seq2seq4repair_space>-100,<seq2seq4repair_space>'goodbye',<seq2seq4repair_space>" + ( ( "'everyone<seq2seq4repair_space>is<seq2seq4repair_space>there',<seq2seq4repair_space>-200.0e0," + "<seq2seq4repair_space>-300.0e0,<seq2seq4repair_space>'1992-01-02',<seq2seq4repair_space>'12:30:59'," ) + "'" ) ) + ( Timestamp . valueOf ( "1992-01-02<seq2seq4repair_space>12:30:59" ) ) ) + "')" ) ) ; st . executeUpdate ( "<seq2seq4repair_space>insert<seq2seq4repair_space>into<seq2seq4repair_space>test<seq2seq4repair_space>values<seq2seq4repair_space>(2,<seq2seq4repair_space>4.0)" ) ; st . executeUpdate ( "<seq2seq4repair_space>insert<seq2seq4repair_space>into<seq2seq4repair_space>test<seq2seq4repair_space>values<seq2seq4repair_space>(3,<seq2seq4repair_space>10.0)" ) ; st . executeUpdate ( "<seq2seq4repair_space>insert<seq2seq4repair_space>into<seq2seq4repair_space>test<seq2seq4repair_space>values<seq2seq4repair_space>(4,<seq2seq4repair_space>12.0)" ) ; st . executeUpdate ( "<seq2seq4repair_space>insert<seq2seq4repair_space>into<seq2seq4repair_space>test<seq2seq4repair_space>values<seq2seq4repair_space>(5,<seq2seq4repair_space>25.0)" ) ; st . executeUpdate ( "<seq2seq4repair_space>insert<seq2seq4repair_space>into<seq2seq4repair_space>test<seq2seq4repair_space>values<seq2seq4repair_space>(10,<seq2seq4repair_space>100.0)" ) ; st . executeUpdate ( "<seq2seq4repair_space>insert<seq2seq4repair_space>into<seq2seq4repair_space>test<seq2seq4repair_space>values<seq2seq4repair_space>(-6,<seq2seq4repair_space>36)" ) ; st . executeUpdate ( ( "<seq2seq4repair_space>insert<seq2seq4repair_space>into<seq2seq4repair_space>big<seq2seq4repair_space>values<seq2seq4repair_space>" + ( ( ( ( ( ( ( "<seq2seq4repair_space>(1,<seq2seq4repair_space>'1'),<seq2seq4repair_space>(2,<seq2seq4repair_space>'2'),<seq2seq4repair_space>(3,<seq2seq4repair_space>'3'),<seq2seq4repair_space>(4,<seq2seq4repair_space>'4'),<seq2seq4repair_space>(5,<seq2seq4repair_space>'5'),<seq2seq4repair_space>" + "(6,<seq2seq4repair_space>'6'),<seq2seq4repair_space>(7,<seq2seq4repair_space>'7'),<seq2seq4repair_space>(8,<seq2seq4repair_space>'8'),<seq2seq4repair_space>(9,<seq2seq4repair_space>'9'),<seq2seq4repair_space>(10,<seq2seq4repair_space>'10'),<seq2seq4repair_space>" ) + "<seq2seq4repair_space>(11,<seq2seq4repair_space>'11'),<seq2seq4repair_space>(12,<seq2seq4repair_space>'12'),<seq2seq4repair_space>(13,<seq2seq4repair_space>'13'),<seq2seq4repair_space>(14,<seq2seq4repair_space>'14'),<seq2seq4repair_space>" ) + "(15,<seq2seq4repair_space>'15'),<seq2seq4repair_space>(16,<seq2seq4repair_space>'16'),<seq2seq4repair_space>(17,<seq2seq4repair_space>'17'),<seq2seq4repair_space>(18,<seq2seq4repair_space>'18'),<seq2seq4repair_space>" ) + "(19,<seq2seq4repair_space>'19'),<seq2seq4repair_space>(20,<seq2seq4repair_space>'20'),<seq2seq4repair_space>" ) + "<seq2seq4repair_space>(21,<seq2seq4repair_space>'21'),<seq2seq4repair_space>(22,<seq2seq4repair_space>'22'),<seq2seq4repair_space>(23,<seq2seq4repair_space>'23'),<seq2seq4repair_space>(24,<seq2seq4repair_space>'24'),<seq2seq4repair_space>" ) + "(25,<seq2seq4repair_space>'25'),<seq2seq4repair_space>(26,<seq2seq4repair_space>'26'),<seq2seq4repair_space>(27,<seq2seq4repair_space>'27'),<seq2seq4repair_space>(28,<seq2seq4repair_space>'28'),<seq2seq4repair_space>" ) + "(29,<seq2seq4repair_space>'29'),<seq2seq4repair_space>(30,<seq2seq4repair_space>'30')" ) ) ) ; st . executeUpdate ( ( "<seq2seq4repair_space>insert<seq2seq4repair_space>into<seq2seq4repair_space>bt1<seq2seq4repair_space>values<seq2seq4repair_space>(1,<seq2seq4repair_space>'one',<seq2seq4repair_space>null),<seq2seq4repair_space>(2,<seq2seq4repair_space>" + ( ( "'two',<seq2seq4repair_space>22.2),<seq2seq4repair_space>(3,<seq2seq4repair_space>'three',<seq2seq4repair_space>null)," + "<seq2seq4repair_space>(7,<seq2seq4repair_space>'seven',<seq2seq4repair_space>null),<seq2seq4repair_space>(8,<seq2seq4repair_space>'eight',<seq2seq4repair_space>2.8),<seq2seq4repair_space>(9,<seq2seq4repair_space>" ) + "'nine',<seq2seq4repair_space>null),<seq2seq4repair_space>(3,<seq2seq4repair_space>'trois',<seq2seq4repair_space>21.2)" ) ) ) ; st . executeUpdate ( ( "<seq2seq4repair_space>insert<seq2seq4repair_space>into<seq2seq4repair_space>bt1<seq2seq4repair_space>(i)<seq2seq4repair_space>values<seq2seq4repair_space>10,<seq2seq4repair_space>11,<seq2seq4repair_space>12,<seq2seq4repair_space>13,<seq2seq4repair_space>14,<seq2seq4repair_space>15,<seq2seq4repair_space>" + "16,<seq2seq4repair_space>17,<seq2seq4repair_space>18,<seq2seq4repair_space>19,<seq2seq4repair_space>20" ) ) ; assertUpdateCount ( st , 11 , "<seq2seq4repair_space>update<seq2seq4repair_space>bt1<seq2seq4repair_space>set<seq2seq4repair_space>c<seq2seq4repair_space>=<seq2seq4repair_space>cast<seq2seq4repair_space>(i<seq2seq4repair_space>as<seq2seq4repair_space>char(5))<seq2seq4repair_space>where<seq2seq4repair_space>i<seq2seq4repair_space>>=<seq2seq4repair_space>10" ) ; assertUpdateCount ( st , 6 , ( "<seq2seq4repair_space>update<seq2seq4repair_space>bt1<seq2seq4repair_space>set<seq2seq4repair_space>de<seq2seq4repair_space>=<seq2seq4repair_space>cast<seq2seq4repair_space>(i//2.8<seq2seq4repair_space>as<seq2seq4repair_space>decimal(4,1))<seq2seq4repair_space>" + ( "where<seq2seq4repair_space>i<seq2seq4repair_space>>=<seq2seq4repair_space>10<seq2seq4repair_space>and<seq2seq4repair_space>2<seq2seq4repair_space>*<seq2seq4repair_space>(cast<seq2seq4repair_space>(i<seq2seq4repair_space>as<seq2seq4repair_space>double)<seq2seq4repair_space>//<seq2seq4repair_space>2.0)<seq2seq4repair_space>-<seq2seq4repair_space>" + "(i<seq2seq4repair_space>//<seq2seq4repair_space>2)<seq2seq4repair_space>=<seq2seq4repair_space>i<seq2seq4repair_space>//<seq2seq4repair_space>2" ) ) ) ; st . executeUpdate ( ( ( ( ( "<seq2seq4repair_space>insert<seq2seq4repair_space>into<seq2seq4repair_space>bt2<seq2seq4repair_space>values<seq2seq4repair_space>(8,<seq2seq4repair_space>-800.0,<seq2seq4repair_space>'1992-03-22',<seq2seq4repair_space>" + "'03:22:28',<seq2seq4repair_space>'" ) + ( Timestamp . valueOf ( "1992-03-22<seq2seq4repair_space>03:22:28.0" ) ) ) + "'," ) + "'2992-01-02')" ) ) ; st . executeUpdate ( ( ( ( ( "<seq2seq4repair_space>insert<seq2seq4repair_space>into<seq2seq4repair_space>bt2<seq2seq4repair_space>values<seq2seq4repair_space>(1,<seq2seq4repair_space>200.0,<seq2seq4repair_space>'1998-03-22'," + "'13:22:28',<seq2seq4repair_space>'" ) + ( Timestamp . valueOf ( "1998-03-22<seq2seq4repair_space>03:22:28.0" ) ) ) + "'," ) + "'3999-08-08')" ) ) ; st . executeUpdate ( ( ( ( ( "<seq2seq4repair_space>insert<seq2seq4repair_space>into<seq2seq4repair_space>bt2<seq2seq4repair_space>values<seq2seq4repair_space>(-8,<seq2seq4repair_space>800,<seq2seq4repair_space>'3999-08-08',<seq2seq4repair_space>" + "'02:28:22',<seq2seq4repair_space>'" ) + ( Timestamp . valueOf ( "3999-08-08<seq2seq4repair_space>02:28:22.0" ) ) ) + "'," ) + "'1992-01-02')" ) ) ; st . executeUpdate ( ( "<seq2seq4repair_space>insert<seq2seq4repair_space>into<seq2seq4repair_space>bt2<seq2seq4repair_space>values<seq2seq4repair_space>(18,<seq2seq4repair_space>180.00,<seq2seq4repair_space>'2007-02-23',<seq2seq4repair_space>" + "'15:47:27',<seq2seq4repair_space>null,<seq2seq4repair_space>null)" ) ) ; st . executeUpdate ( ( "<seq2seq4repair_space>insert<seq2seq4repair_space>into<seq2seq4repair_space>bt2<seq2seq4repair_space>values<seq2seq4repair_space>(22,<seq2seq4repair_space>202.010,<seq2seq4repair_space>'2007-02-23',<seq2seq4repair_space>" + "'15:47:27',<seq2seq4repair_space>null,<seq2seq4repair_space>null)" ) ) ; st . executeUpdate ( ( "<seq2seq4repair_space>insert<seq2seq4repair_space>into<seq2seq4repair_space>bt2<seq2seq4repair_space>values<seq2seq4repair_space>(23,<seq2seq4repair_space>322.002,<seq2seq4repair_space>null,<seq2seq4repair_space>" + "'15:47:28',<seq2seq4repair_space>null,<seq2seq4repair_space>null)" ) ) ; <START_BUG> st . executeUpdate ( ( ( ( "<seq2seq4repair_space>insert<seq2seq4repair_space>into<seq2seq4repair_space>bt2<seq2seq4repair_space>values<seq2seq4repair_space>(28,<seq2seq4repair_space>82,<seq2seq4repair_space>null,<seq2seq4repair_space>'15:47:28',<seq2seq4repair_space>" + "'" ) + ( Timestamp . valueOf ( "0000-00-00<seq2seq4repair_space>15:47:28.0" ) ) ) + "',<seq2seq4repair_space>null)" ) ) ; <END_BUG> st . executeUpdate ( "<seq2seq4repair_space>create<seq2seq4repair_space>index<seq2seq4repair_space>ix_big_i<seq2seq4repair_space>on<seq2seq4repair_space>big<seq2seq4repair_space>(i)" ) ; st . executeUpdate ( "<seq2seq4repair_space>create<seq2seq4repair_space>index<seq2seq4repair_space>bt1_ixi<seq2seq4repair_space>on<seq2seq4repair_space>bt1<seq2seq4repair_space>(i)" ) ; st . executeUpdate ( "<seq2seq4repair_space>create<seq2seq4repair_space>index<seq2seq4repair_space>bt1_ixde<seq2seq4repair_space>on<seq2seq4repair_space>bt1<seq2seq4repair_space>(de)" ) ; st . executeUpdate ( "<seq2seq4repair_space>create<seq2seq4repair_space>index<seq2seq4repair_space>bt1_ixic<seq2seq4repair_space>on<seq2seq4repair_space>bt1<seq2seq4repair_space>(i,<seq2seq4repair_space>c)" ) ; st . executeUpdate ( "<seq2seq4repair_space>create<seq2seq4repair_space>index<seq2seq4repair_space>bt2_ixd<seq2seq4repair_space>on<seq2seq4repair_space>bt2<seq2seq4repair_space>(d)" ) ; st . executeUpdate ( "<seq2seq4repair_space>create<seq2seq4repair_space>index<seq2seq4repair_space>bt2_ixda<seq2seq4repair_space>on<seq2seq4repair_space>bt2<seq2seq4repair_space>(da)" ) ; st . executeUpdate ( "<seq2seq4repair_space>create<seq2seq4repair_space>index<seq2seq4repair_space>bt2_ixvc<seq2seq4repair_space>on<seq2seq4repair_space>bt2<seq2seq4repair_space>(vc)" ) ; } public void testBetween ( ) throws Exception { } public void testInList ( ) throws SQLException { } public void testInBetween ( ) throws SQLException { } public void testBigInList ( ) throws SQLException { } public void testCheckQueries ( ) throws SQLException { } public void testNestedQueries ( ) throws SQLException { } public void testBeetle4316 ( ) throws SQLException { } public void testReproductionBeetle5135 ( ) throws SQLException { } }

Fix:
st . executeUpdate ( ( ( ( "<seq2seq4repair_space>insert<seq2seq4repair_space>into<seq2seq4repair_space>bt2<seq2seq4repair_space>values<seq2seq4repair_space>(28,<seq2seq4repair_space>82,<seq2seq4repair_space>null,<seq2seq4repair_space>'15:47:28',<seq2seq4repair_space>" + "'" ) + ( Timestamp . valueOf ( "2007-02-23<seq2seq4repair_space>15:47:27.544" ) ) ) + "',<seq2seq4repair_space>null)" ) ) ;