[jOOQ/jOOQ#15934] Code generator and MetaImpl return CREATE DEFAULT
statement instead of just the default expression
This commit is contained in:
parent
fedbec9243
commit
f9b7eb038f
@ -449,6 +449,10 @@ public abstract class AbstractDatabase implements Database {
|
||||
// separator is illegal
|
||||
configuration.settings().setNamePathSeparator("__");
|
||||
|
||||
// [#15934] The parser might expose dialect specific behaviour, e.g.
|
||||
// when parsing defaults.
|
||||
configuration.settings().setParseDialect(configuration.dialect());
|
||||
|
||||
if (muteExceptions) {
|
||||
return DSL.using(configuration);
|
||||
}
|
||||
|
||||
@ -1397,13 +1397,20 @@ final class MetaImpl extends AbstractMeta {
|
||||
}
|
||||
else {
|
||||
try {
|
||||
type = type.defaultValue(dsl()
|
||||
DSLContext ctx = dsl()
|
||||
.configuration()
|
||||
.deriveSettings(s -> s.withParseUnknownFunctions(ParseUnknownFunctions.IGNORE))
|
||||
.dsl()
|
||||
.parser()
|
||||
.parseField(defaultValue)
|
||||
);
|
||||
.deriveSettings(s -> s
|
||||
.withParseDialect(dialect())
|
||||
.withParseUnknownFunctions(ParseUnknownFunctions.IGNORE))
|
||||
.dsl();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
type = type.defaultValue(ctx.parser().parseField(defaultValue));
|
||||
}
|
||||
catch (ParserException e) {
|
||||
log.info("Cannot parse default expression (to skip parsing, use Settings.parseMetaViewDefaultExpressions): " + defaultValue, e);
|
||||
|
||||
@ -8625,6 +8625,19 @@ final class DefaultParseContext extends AbstractScope implements ParseContext {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
switch (characterUpper()) {
|
||||
|
||||
// [#8821] Known prefixes so far:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user