r2dbc-h2 icon indicating copy to clipboard operation
r2dbc-h2 copied to clipboard

Should not decode null integer value to 0

Open rj-hwang opened this issue 5 years ago • 0 comments

Use r2dbc-h2-0.8.0.M8

create table t(id integer primary key, v integer)
insert into t(id, v) values (1, null);
StepVerifier.create(
  Mono.from(connectionFactory.create())
    .flatMap(c -> Mono.from(c.createStatement("select * from t where id = 1").execute()))
    .flatMap(result -> Mono.from(result.map((row, rowMetadata) -> row.get("v", Integer.class))))
).expectNext((Integer) null).verifyComplete();

Error:

expectation "expectNext(null)" failed (expected value: null; actual value: 0)

rj-hwang avatar May 23 '19 06:05 rj-hwang