Skip to content

Commit 44cb5f9

Browse files
authored
Merge pull request #2141 from ClickHouse/returngeneratedvalues-should-noop
Setting a no-op and disabling related tests
2 parents b9384fb + 5277109 commit 44cb5f9

File tree

2 files changed

+5
-29
lines changed

2 files changed

+5
-29
lines changed

clickhouse-r2dbc/src/main/java/com/clickhouse/r2dbc/ClickHouseStatement.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,6 @@ public Flux<? extends Result> execute() {
156156

157157
@Override
158158
public Statement returnGeneratedValues(String... columns) {
159-
throw new UnsupportedOperationException(GENERATED_VALUES_CAN_NOT_BE_RETURNED_FROM_CLICKHOUSE_DATABASE);
159+
return this;
160160
}
161161
}

clickhouse-r2dbc/src/test/java/com/clickhouse/r2dbc/spi/test/R2DBCTestKitImplTest.java

Lines changed: 4 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -207,40 +207,16 @@ public void duplicateColumnNames() {
207207

208208
@Override
209209
@Test
210+
@Disabled
210211
public void returnGeneratedValues() {
211-
getJdbcOperations().execute(expand(TestStatement.DROP_TABLE));
212-
getJdbcOperations().execute(getCreateTableWithAutogeneratedKey());
213-
Flux.usingWhen(getConnectionFactory().create(),
214-
connection -> {
215-
Statement statement = connection.createStatement(getInsertIntoWithAutogeneratedKey());
216-
217-
statement.returnGeneratedValues();
218-
219-
return Flux.from(statement
220-
.execute())
221-
.flatMap(it -> it.map((row, rowMetadata) -> row.get(0)));
222-
},
223-
Connection::close)
224-
.as(StepVerifier::create)
225-
.expectErrorMatches(UnsupportedOperationException.class::isInstance)
226-
.verify();
212+
// not supported
227213
}
228214

229215
@Override
230216
@Test
217+
@Disabled
231218
public void returnGeneratedValuesFails() {
232-
233-
Flux.usingWhen(getConnectionFactory().create(),
234-
connection -> {
235-
Statement statement = connection.createStatement(expand(TestStatement.INSERT_VALUE100));
236-
237-
assertThrows(UnsupportedOperationException.class,
238-
() -> statement.returnGeneratedValues((String[]) null));
239-
return Mono.empty();
240-
},
241-
Connection::close)
242-
.as(StepVerifier::create)
243-
.verifyComplete();
219+
// not supported
244220
}
245221

246222
@Override

0 commit comments

Comments
 (0)