[jOOQ/jOOQ#13054] java.lang.IllegalArgumentException: Cannot create a

VALUES() constructor with an empty set of rows when using
JSON_ARRAY(ABSENT ON NULL) in PostgreSQL
This commit is contained in:
Lukas Eder 2022-02-11 13:59:14 +01:00
parent 86913f438b
commit 1f1831fbcd

View File

@ -145,7 +145,7 @@ implements
case POSTGRES:
case YUGABYTEDB:
if (onNull == JSONOnNull.ABSENT_ON_NULL) {
if (onNull == JSONOnNull.ABSENT_ON_NULL && !mapped.isEmpty()) {
Row1[] rows = map(fields, f -> row(f), Row1[]::new);
Table<?> t = values(rows).as("t", "a");
Field<?> a = t.field("a");