Skip to content

Commit

Permalink
Fix test failure on CH older than 22.1
Browse files Browse the repository at this point in the history
  • Loading branch information
zhicwu committed Mar 5, 2022
1 parent 6cd6821 commit 3a28431
Showing 1 changed file with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,11 @@ private void checkTable(Statement stmt, String query, String[] results) throws S
public void testReadWriteBool() throws SQLException {
try (ClickHouseConnection conn = newConnection(new Properties());
Statement s = conn.createStatement();
PreparedStatement stmt = conn.prepareStatement("insert into test_read_write_bool values(?,?)")) {
s.execute("drop table if exists test_read_write_bool");
try {
s.execute("create table test_read_write_bool(id Int32, b Bool)engine=Memory");
} catch (SQLException e) {
s.execute("create table test_read_write_bool(id Int32, b UInt8)engine=Memory");
}
PreparedStatement stmt = conn.prepareStatement(
"insert into test_read_write_bool select c1, c2 from input('c1 Int32, c2 Bool')")) {
s.execute("drop table if exists test_read_write_bool; "
+ "create table test_read_write_bool(id Int32, b Bool)engine=Memory");

stmt.setInt(1, 1);
stmt.setBoolean(2, true);
stmt.addBatch();
Expand Down

0 comments on commit 3a28431

Please sign in to comment.