[jOOQ/jOOQ#8832] Correct rendering of CREATE SEQUENCE for Oracle

Oracle's `NO` clauses need to be rendered as e.g. `NOCACHE` rather than
`NO CACHE`.

Additionally the parser should also accept this alternative syntax.
This commit is contained in:
Knut Wannheden 2019-06-21 09:11:44 +02:00
parent a0516326eb
commit 96e2e8288a
2 changed files with 5 additions and 4 deletions

View File

@ -49,6 +49,7 @@ import static org.jooq.SQLDialect.FIREBIRD;
import static org.jooq.SQLDialect.HSQLDB;
// ...
// ...
// ...
import static org.jooq.impl.Keywords.K_CACHE;
import static org.jooq.impl.Keywords.K_CREATE;
import static org.jooq.impl.Keywords.K_CYCLE;

View File

@ -2932,7 +2932,7 @@ final class ParserImpl implements Parser {
s = s.minvalue(parseUnsignedInteger(ctx));
continue;
}
else if (parseKeywordIf(ctx, "NO MINVALUE")) {
else if (parseKeywordIf(ctx, "NO MINVALUE") || parseKeywordIf(ctx, "NOMINVALUE")) {
s = s.noMinvalue();
continue;
}
@ -2940,7 +2940,7 @@ final class ParserImpl implements Parser {
s = s.maxvalue(parseUnsignedInteger(ctx));
continue;
}
else if (parseKeywordIf(ctx, "NO MAXVALUE")) {
else if (parseKeywordIf(ctx, "NO MAXVALUE") || parseKeywordIf(ctx, "NOMAXVALUE")) {
s = s.noMaxvalue();
continue;
}
@ -2948,7 +2948,7 @@ final class ParserImpl implements Parser {
s = s.cycle();
continue;
}
else if (parseKeywordIf(ctx, "NO CYCLE")) {
else if (parseKeywordIf(ctx, "NO CYCLE") || parseKeywordIf(ctx, "NOCYCLE")) {
s = s.noCycle();
continue;
}
@ -2956,7 +2956,7 @@ final class ParserImpl implements Parser {
s = s.cache(parseUnsignedInteger(ctx));
continue;
}
else if (parseKeywordIf(ctx, "NO CACHE")) {
else if (parseKeywordIf(ctx, "NO CACHE") || parseKeywordIf(ctx, "NOCACHE")) {
s = s.noCache();
continue;
}