Skip to content

Commit

Permalink
Add test that exposes an issue in Polypheny
Browse files Browse the repository at this point in the history
  • Loading branch information
gartens committed Mar 12, 2024
1 parent 6a76fbe commit 91c573a
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions src/test/java/org/polypheny/jdbc/StatementTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,34 @@ void testMoreThanOneExecute() throws SQLException {
}


@Test
void testTwoPreparedStatement() throws SQLException {
try ( PreparedStatement p = con.prepareStatement( "INSERT INTO t(id, a) VALUES (?, ?)" ) ) {
p.setInt( 1, 4 );
p.setInt( 2, 4 );
p.execute();
p.setInt( 1, 5 );
p.setInt( 2, 5 );
p.execute();
}

try ( Statement statement = con.createStatement() ) {
statement.execute( "DROP TABLE IF EXISTS t" );
statement.execute( "CREATE TABLE t(id INTEGER PRIMARY KEY, a INTEGER NOT NULL)" );
}

try ( PreparedStatement p = con.prepareStatement( "INSERT INTO t(id, a) VALUES (?, ?)" ) ) {
p.setInt( 1, 4 );
p.setInt( 2, 4 );
p.execute();
p.setInt( 1, 5 );
p.setInt( 2, 5 );
p.execute();
}

}


@ParameterizedTest()
@ValueSource(ints = { 99, 100, 101 })
void testFetch( int n ) throws SQLException {
Expand Down

0 comments on commit 91c573a

Please sign in to comment.