[jOOQ/jOOQ#10437] Get HANA dialect up to date
This includes: - [jOOQ/jOOQ#9472] Correct UUID support - [jOOQ/jOOQ#11458] ANY_VALUE emulation - [jOOQ/jOOQ#11985] REGEXP_REPLACE support
This commit is contained in:
parent
761a5df503
commit
0eba4e8dea
@ -171,7 +171,7 @@ implements
|
||||
ctx.sql(')');
|
||||
}
|
||||
|
||||
final void acceptArguments2(Context<?> ctx, QueryPartCollectionView<Field<?>> args) {
|
||||
/* non-final */ void acceptArguments2(Context<?> ctx, QueryPartCollectionView<Field<?>> args) {
|
||||
if (filter == null || SUPPORT_FILTER.contains(ctx.dialect()))
|
||||
ctx.visit(args);
|
||||
|
||||
|
||||
@ -103,6 +103,7 @@ extends
|
||||
case DERBY:
|
||||
case FIREBIRD:
|
||||
case H2:
|
||||
|
||||
case HSQLDB:
|
||||
case IGNITE:
|
||||
case MARIADB:
|
||||
@ -127,12 +128,5 @@ extends
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void accept(Context<?> ctx) {
|
||||
super.accept(ctx);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -288,6 +288,7 @@ final class Keywords {
|
||||
static final Keyword K_NULLS_LAST = keyword("nulls last");
|
||||
static final Keyword K_NUMERIC = keyword("numeric");
|
||||
static final Keyword K_NVARCHAR = keyword("nvarchar");
|
||||
static final Keyword K_OCCURRENCE = keyword("occurrence");
|
||||
static final Keyword K_OF = keyword("of");
|
||||
static final Keyword K_OFFSET = keyword("offset");
|
||||
static final Keyword K_OLD = keyword("old");
|
||||
|
||||
@ -268,6 +268,8 @@ final class Limit extends AbstractQueryPart {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -279,7 +281,6 @@ final class Limit extends AbstractQueryPart {
|
||||
|
||||
|
||||
|
||||
|
||||
case MYSQL:
|
||||
case SQLITE: {
|
||||
acceptDefaultLimitMandatory(ctx, castMode);
|
||||
|
||||
@ -293,6 +293,7 @@ final class Names {
|
||||
static final Name N_REGR_SYY = unquotedName("regr_syy");
|
||||
static final Name N_REPEAT = unquotedName("repeat");
|
||||
static final Name N_REPLACE = unquotedName("replace");
|
||||
static final Name N_REPLACE_REGEXPR = unquotedName("replace_regexpr");
|
||||
static final Name N_REPLICATE = unquotedName("replicate");
|
||||
static final Name N_REVERSE = unquotedName("reverse");
|
||||
static final Name N_RIGHT = unquotedName("right");
|
||||
|
||||
@ -9805,6 +9805,19 @@ final class DefaultParseContext extends AbstractScope implements ParseContext {
|
||||
? regexpReplaceFirst(field, pattern, replacement)
|
||||
: regexpReplaceAll(field, pattern, replacement);
|
||||
}
|
||||
else if (parseFunctionNameIf("REPLACE_REGEXPR")) {
|
||||
parse('(');
|
||||
Field pattern = parseField(S);
|
||||
parseKeyword("IN");
|
||||
Field field = parseField(S);
|
||||
Field replacement = parseKeywordIf("WITH") ? parseField(S) : inline("");
|
||||
first = parseKeywordIf("OCCURRENCE") && !parseKeywordIf("ALL") && parse("1");
|
||||
|
||||
parse(')');
|
||||
return first
|
||||
? regexpReplaceFirst(field, pattern, replacement)
|
||||
: regexpReplaceAll(field, pattern, replacement);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -37,8 +37,12 @@
|
||||
*/
|
||||
package org.jooq.impl;
|
||||
|
||||
import static org.jooq.impl.Keywords.K_IN;
|
||||
import static org.jooq.impl.Keywords.K_OCCURRENCE;
|
||||
import static org.jooq.impl.Keywords.K_WITH;
|
||||
import static org.jooq.impl.Names.N_REGEXP_REPLACE;
|
||||
import static org.jooq.impl.Names.N_REGEX_REPLACE;
|
||||
import static org.jooq.impl.Names.N_REPLACE_REGEXPR;
|
||||
|
||||
import org.jooq.Context;
|
||||
import org.jooq.Field;
|
||||
@ -88,6 +92,15 @@ final class RegexpReplace extends AbstractField<String> {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -4838,7 +4838,6 @@ final class Tools {
|
||||
|
||||
|
||||
|
||||
|
||||
case CUBRID: ctx.sql(' ').visit(K_AUTO_INCREMENT); break;
|
||||
|
||||
case HSQLDB: ctx.sql(' ').visit(K_GENERATED_BY_DEFAULT_AS_IDENTITY).sql('(').visit(K_START_WITH).sql(" 1)"); break;
|
||||
@ -4872,6 +4871,7 @@ final class Tools {
|
||||
switch (ctx.family()) {
|
||||
|
||||
|
||||
|
||||
case H2: ctx.sql(' ').visit(K_GENERATED_BY_DEFAULT_AS_IDENTITY); break;
|
||||
|
||||
|
||||
|
||||
@ -127,6 +127,10 @@ extends
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
case H2:
|
||||
ctx.visit(function(N_RANDOM_UUID, getDataType()));
|
||||
break;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user