File tree Expand file tree Collapse file tree
jdbc-v2/src/test/java/com/clickhouse/jdbc Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11package com .clickhouse .jdbc ;
22
3+ import com .clickhouse .client .api .ClientConfigProperties ;
34import com .clickhouse .client .api .DataTypeUtils ;
45import com .clickhouse .data .ClickHouseColumn ;
56import com .clickhouse .data .ClickHouseDataType ;
@@ -566,6 +567,18 @@ void testSelectFromArray() throws Exception {
566567 }
567568 }
568569
570+ @ Test (groups = {"integration" })
571+ void testExecuteQueryTimeout () throws Exception {
572+ final String sql = "SELECT sum(reinterpretAsUInt64(MD5(toString(number)))) FROM system.numbers LIMIT 1000000" ;
573+ Properties config = new Properties ();
574+ config .setProperty (ClientConfigProperties .ASYNC_OPERATIONS .getKey (), "true" );
575+ try (Connection conn = getJdbcConnection (config );
576+ PreparedStatement stmt = conn .prepareStatement (sql )) {
577+ stmt .setQueryTimeout (1 );
578+ assertThrows (SQLException .class , stmt ::executeQuery );
579+ }
580+ }
581+
569582 @ Test (groups = { "integration" })
570583 void testInsert () throws Exception {
571584 int ROWS = 1000 ;
You can’t perform that action at this time.
0 commit comments