[#8434] Support H2 v1.4.198 array syntax
H2 1.4.198 changed array syntax incompatibly to align the syntax with PostgreSQL, HSQLDB, and the SQL standard. The old syntax (which conflicts with row value expression) is no longer really supported.
This commit is contained in:
parent
a55a362fd8
commit
6d630cd53a
@ -19,7 +19,7 @@
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<org.jooq.version>3.12.0-SNAPSHOT</org.jooq.version>
|
||||
<h2.version>1.4.198</h2.version>
|
||||
<h2.version>1.4.199</h2.version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
|
||||
@ -20,7 +20,7 @@
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<org.springframework.version>3.2.6.RELEASE</org.springframework.version>
|
||||
<org.jooq.version>3.12.0-SNAPSHOT</org.jooq.version>
|
||||
<org.h2.version>1.4.198</org.h2.version>
|
||||
<org.h2.version>1.4.199</org.h2.version>
|
||||
<scala.version>2.12.7</scala.version>
|
||||
|
||||
<db.url>jdbc:h2:~/flyway-test</db.url>
|
||||
|
||||
@ -20,7 +20,7 @@
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<org.jooq.version>3.12.0-SNAPSHOT</org.jooq.version>
|
||||
<org.h2.version>1.4.198</org.h2.version>
|
||||
<org.h2.version>1.4.199</org.h2.version>
|
||||
<java.version>1.8</java.version>
|
||||
|
||||
<!-- JBoss dependency versions -->
|
||||
|
||||
@ -20,7 +20,7 @@
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<org.springframework.version>3.2.6.RELEASE</org.springframework.version>
|
||||
<org.jooq.version>3.12.0-SNAPSHOT</org.jooq.version>
|
||||
<org.h2.version>1.4.198</org.h2.version>
|
||||
<org.h2.version>1.4.199</org.h2.version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
|
||||
@ -19,7 +19,7 @@
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<org.jooq.version>3.12.0-SNAPSHOT</org.jooq.version>
|
||||
<org.h2.version>1.4.198</org.h2.version>
|
||||
<org.h2.version>1.4.199</org.h2.version>
|
||||
<org.hibernate.version>5.3.1.Final</org.hibernate.version>
|
||||
<org.springframework.version>5.0.7.RELEASE</org.springframework.version>
|
||||
</properties>
|
||||
|
||||
@ -21,7 +21,7 @@
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<kotlin.version>1.2.30</kotlin.version>
|
||||
<org.jooq.version>3.12.0-SNAPSHOT</org.jooq.version>
|
||||
<org.h2.version>1.4.198</org.h2.version>
|
||||
<org.h2.version>1.4.199</org.h2.version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
|
||||
@ -20,7 +20,7 @@
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<org.springframework.version>3.2.6.RELEASE</org.springframework.version>
|
||||
<org.jooq.version>3.12.0-SNAPSHOT</org.jooq.version>
|
||||
<org.h2.version>1.4.198</org.h2.version>
|
||||
<org.h2.version>1.4.199</org.h2.version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
|
||||
@ -20,7 +20,7 @@
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<org.springframework.version>4.3.10.RELEASE</org.springframework.version>
|
||||
<org.jooq.version>3.12.0-SNAPSHOT</org.jooq.version>
|
||||
<org.h2.version>1.4.198</org.h2.version>
|
||||
<org.h2.version>1.4.199</org.h2.version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
|
||||
@ -20,7 +20,7 @@
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<org.springframework.version>4.2.4.RELEASE</org.springframework.version>
|
||||
<org.jooq.version>3.12.0-SNAPSHOT</org.jooq.version>
|
||||
<org.h2.version>1.4.198</org.h2.version>
|
||||
<org.h2.version>1.4.199</org.h2.version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
|
||||
@ -78,22 +78,12 @@ final class Array<T> extends AbstractField<T[]> {
|
||||
@Override
|
||||
public final void accept(Context<?> ctx) {
|
||||
switch (ctx.family()) {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
case H2:
|
||||
ctx.sql('(').visit(fields);
|
||||
|
||||
// [#7878] Single element arrays in H2 need a trailing comma to distinguish between e.g.
|
||||
// (1), the parenthesised integer, and (1,) the array.
|
||||
// See: http://h2database.com/html/grammar.html#array
|
||||
if (fields.size() == 1)
|
||||
ctx.sql(',');
|
||||
|
||||
ctx.sql(')');
|
||||
break;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
case HSQLDB:
|
||||
case POSTGRES:
|
||||
default:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user