[jOOQ/jOOQ#11850] Get SQLDialect.TERADATA up to date
- Avoid using TITLE without quoting in Teradata - Fix NotField - MERGE does not support AND in MATCHED clauses - Fix WIDTH_BUCKET - Regenerate test schema - Support generating identity information ([jOOQ/jOOQ#11854]) - More XML function fixes - Fix TOP 100 PERCENT hack in the presence of UNIONs
This commit is contained in:
parent
ca64acef4d
commit
fc964fe9b3
@ -351,7 +351,7 @@ public abstract class AbstractDatabase implements Database {
|
||||
// cases where quoting would have been necessary were found in
|
||||
// integration tests, or when looking for identifiers matching
|
||||
// [A-Za-z_$#][A-Za-z0-9_$#]+ in generated jOOQ-meta code.
|
||||
configuration.settings().setRenderQuotedNames(RenderQuotedNames.NEVER);
|
||||
configuration.settings().setRenderQuotedNames(getRenderQuotedNames());
|
||||
|
||||
if (muteExceptions) {
|
||||
return DSL.using(configuration);
|
||||
@ -464,6 +464,13 @@ public abstract class AbstractDatabase implements Database {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Subclasses may override this.
|
||||
*/
|
||||
protected RenderQuotedNames getRenderQuotedNames() {
|
||||
return RenderQuotedNames.NEVER;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the configured dialect is versioned explicitly and supports a
|
||||
* given dialect.
|
||||
|
||||
@ -37,16 +37,16 @@
|
||||
*/
|
||||
package org.jooq;
|
||||
|
||||
import org.jetbrains.annotations.*;
|
||||
|
||||
|
||||
// ...
|
||||
import static org.jooq.SQLDialect.POSTGRES;
|
||||
// ...
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
import org.jooq.impl.DSL;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
/**
|
||||
* The SQL standard <code>ARRAY_AGG()</code> function.
|
||||
*
|
||||
|
||||
@ -37,12 +37,12 @@
|
||||
*/
|
||||
package org.jooq;
|
||||
|
||||
import org.jetbrains.annotations.*;
|
||||
|
||||
|
||||
// ...
|
||||
// ...
|
||||
import static org.jooq.SQLDialect.POSTGRES;
|
||||
// ...
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
/**
|
||||
* A step in the construction of an <code>XMLEXISTS</code> predicate.
|
||||
|
||||
@ -37,12 +37,12 @@
|
||||
*/
|
||||
package org.jooq;
|
||||
|
||||
import org.jetbrains.annotations.*;
|
||||
|
||||
|
||||
// ...
|
||||
// ...
|
||||
import static org.jooq.SQLDialect.POSTGRES;
|
||||
// ...
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
/**
|
||||
* A step in the construction of an <code>XMLQUERY</code> expression.
|
||||
|
||||
@ -42,6 +42,7 @@ package org.jooq;
|
||||
// ...
|
||||
import static org.jooq.SQLDialect.POSTGRES;
|
||||
// ...
|
||||
// ...
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
|
||||
@ -42,6 +42,7 @@ package org.jooq;
|
||||
// ...
|
||||
import static org.jooq.SQLDialect.POSTGRES;
|
||||
// ...
|
||||
// ...
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
|
||||
@ -42,6 +42,7 @@ package org.jooq;
|
||||
// ...
|
||||
import static org.jooq.SQLDialect.POSTGRES;
|
||||
// ...
|
||||
// ...
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
|
||||
@ -42,6 +42,7 @@ package org.jooq;
|
||||
// ...
|
||||
import static org.jooq.SQLDialect.POSTGRES;
|
||||
// ...
|
||||
// ...
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
|
||||
@ -320,6 +320,7 @@ final class Keywords {
|
||||
static final Keyword K_PLACING = keyword("placing");
|
||||
static final Keyword K_POSITION = keyword("position");
|
||||
static final Keyword K_PRECEDING = keyword("preceding");
|
||||
static final Keyword K_PRESERVE = keyword("preserve");
|
||||
static final Keyword K_PREVIOUS_VALUE_FOR = keyword("previous value for");
|
||||
static final Keyword K_PRIMARY_KEY = keyword("primary key");
|
||||
static final Keyword K_PRIOR = keyword("prior");
|
||||
@ -431,6 +432,7 @@ final class Keywords {
|
||||
static final Keyword K_WHEN = keyword("when");
|
||||
static final Keyword K_WHERE = keyword("where");
|
||||
static final Keyword K_WHILE = keyword("while");
|
||||
static final Keyword K_WHITESPACE = keyword("whitespace");
|
||||
static final Keyword K_WINDOW = keyword("window");
|
||||
static final Keyword K_WITH = keyword("with");
|
||||
static final Keyword K_WITHIN_GROUP = keyword("within group");
|
||||
|
||||
@ -57,6 +57,7 @@ import static org.jooq.SQLDialect.HSQLDB;
|
||||
// ...
|
||||
// ...
|
||||
// ...
|
||||
import static org.jooq.conf.ParamType.INLINED;
|
||||
import static org.jooq.impl.DSL.condition;
|
||||
import static org.jooq.impl.DSL.exists;
|
||||
import static org.jooq.impl.DSL.insertInto;
|
||||
@ -169,6 +170,7 @@ import org.jooq.Select;
|
||||
import org.jooq.Table;
|
||||
import org.jooq.TableLike;
|
||||
import org.jooq.UniqueKey;
|
||||
import org.jooq.conf.ParamType;
|
||||
import org.jooq.impl.Tools.DataExtendedKey;
|
||||
import org.jooq.tools.StringUtils;
|
||||
|
||||
@ -1458,6 +1460,7 @@ implements
|
||||
if (usingDual) {
|
||||
switch (c2.family()) {
|
||||
case DERBY:
|
||||
|
||||
c2.visit(new Dual());
|
||||
break;
|
||||
default:
|
||||
|
||||
@ -64,7 +64,6 @@ final class NotField extends AbstractField<Boolean> {
|
||||
public final void accept(Context<?> ctx) {
|
||||
switch (ctx.family()) {
|
||||
|
||||
// [#2485] Some of these don't work nicely, yet
|
||||
|
||||
|
||||
|
||||
|
||||
@ -1555,10 +1555,11 @@ final class SelectQueryImpl<R extends Record> extends AbstractResultQuery<R> imp
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
else
|
||||
ctx.data(DATA_TRANSFORM_ROWNUM_TO_LIMIT, null, c -> accept0(c));
|
||||
accept0(ctx);
|
||||
}
|
||||
|
||||
final void accept0(Context<?> context) {
|
||||
@ -3097,9 +3098,6 @@ final class SelectQueryImpl<R extends Record> extends AbstractResultQuery<R> imp
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -4847,6 +4847,7 @@ final class Tools {
|
||||
// [#5062] H2's (and others') AUTO_INCREMENT flag is syntactically located *after* NULL flags.
|
||||
switch (ctx.family()) {
|
||||
|
||||
|
||||
case H2: ctx.sql(' ').visit(K_GENERATED_BY_DEFAULT_AS_IDENTITY); break;
|
||||
|
||||
|
||||
|
||||
@ -102,11 +102,6 @@ extends
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
case POSTGRES:
|
||||
ctx.visit(keyword("width_bucket")).sql('(').visit(field).sql(", ").visit(low).sql(", ").visit(high).sql(", ").visit(buckets).sql(')');
|
||||
break;
|
||||
|
||||
@ -37,11 +37,14 @@
|
||||
*/
|
||||
package org.jooq.impl;
|
||||
|
||||
// ...
|
||||
import static org.jooq.impl.DSL.inline;
|
||||
import static org.jooq.impl.DSL.xmlparseDocument;
|
||||
import static org.jooq.impl.DSL.xmlquery;
|
||||
import static org.jooq.impl.Keywords.K_CONTENT;
|
||||
import static org.jooq.impl.Keywords.K_DOCUMENT;
|
||||
import static org.jooq.impl.Keywords.K_PRESERVE;
|
||||
import static org.jooq.impl.Keywords.K_WHITESPACE;
|
||||
import static org.jooq.impl.Names.N_XMLPARSE;
|
||||
import static org.jooq.impl.SQLDataType.VARCHAR;
|
||||
import static org.jooq.impl.XMLParse.DocumentOrContent.DOCUMENT;
|
||||
@ -86,6 +89,7 @@ final class XMLParse extends AbstractField<XML> {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
case POSTGRES:
|
||||
default:
|
||||
@ -101,8 +105,14 @@ final class XMLParse extends AbstractField<XML> {
|
||||
) {
|
||||
ctx.visit(N_XMLPARSE).sql('(')
|
||||
.visit(documentOrContent == DOCUMENT ? K_DOCUMENT : K_CONTENT).sql(' ')
|
||||
.visit(content)
|
||||
.sql(')');
|
||||
.visit(content);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
ctx.sql(')');
|
||||
}
|
||||
|
||||
enum DocumentOrContent { DOCUMENT, CONTENT }
|
||||
|
||||
Loading…
Reference in New Issue
Block a user