The SQLDialect.DEFAULT behaviour should be that of the standard SQL for array tables
This commit is contained in:
Lukas Eder 2022-10-13 11:22:31 +02:00
parent eba8a527bf
commit f55fa8a770
2 changed files with 38 additions and 22 deletions

View File

@ -112,27 +112,27 @@ final class ArrayOfValues extends AbstractTable<Record> implements UNotYetImplem
case CUBRID:
case DERBY:
case FIREBIRD:
case IGNITE:
case MARIADB:
case MYSQL:
case SQLITE:
ctx.visit(new ArrayTableEmulation(array).as(alias, fieldAliases));
break;

View File

@ -176,18 +176,30 @@ final class ArrayTable extends AbstractTable<Record> implements UNotYetImplement
case H2:
return new H2ArrayTable().as(alias);
// [#756] These dialects need special care when aliasing unnested
// arrays
// Most dialects can simulate unnested arrays using UNION ALL
case HSQLDB:
case POSTGRES:
case YUGABYTEDB:
return new PostgresHSQLDBTable().as(alias, fieldAliases);
// Other dialects can simulate unnested arrays using UNION ALL
default:
case CUBRID:
case DERBY:
case FIREBIRD:
case IGNITE:
case MARIADB:
case MYSQL:
case SQLITE:
if (array.getDataType().getType().isArray() && array instanceof Param)
return emulate();
@ -200,6 +212,10 @@ final class ArrayTable extends AbstractTable<Record> implements UNotYetImplement
else
return DSL.table("{0}", array).as(alias);
// [#756] The standard SQL behaviour
default:
return new PostgresHSQLDBTable().as(alias, fieldAliases);
}
}