[jOOQ/jOOQ#8758] [jOOQ/jOOQ#7518] DEFAULT in INSERT and MERGE
The DEFAULT keyword is now also properly supported in the INSERT and MERGE statements.
This commit is contained in:
parent
82e4a12712
commit
9cd09f5b70
@ -1670,7 +1670,12 @@ final class ParserImpl implements Parser {
|
||||
if (fields == null && parseIf(ctx, ')'))
|
||||
break valuesLoop;
|
||||
|
||||
List<Field<?>> values = parseFields(ctx);
|
||||
List<Field<?>> values = new ArrayList<Field<?>>();
|
||||
do {
|
||||
Field<?> value = parseKeywordIf(ctx, "DEFAULT") ? default_() : parseField(ctx);
|
||||
values.add(value);
|
||||
}
|
||||
while (parseIf(ctx, ','));
|
||||
|
||||
if (fields != null && fields.length != values.size())
|
||||
throw ctx.exception("Insert field size (" + fields.length + ") must match values size (" + values.size() + ")");
|
||||
@ -1884,7 +1889,12 @@ final class ParserImpl implements Parser {
|
||||
parse(ctx, ')');
|
||||
parseKeyword(ctx, "VALUES");
|
||||
parse(ctx, '(');
|
||||
insertValues = parseFields(ctx);
|
||||
insertValues = new ArrayList<Field<?>>();
|
||||
do {
|
||||
Field<?> value = parseKeywordIf(ctx, "DEFAULT") ? default_() : parseField(ctx);
|
||||
insertValues.add(value);
|
||||
}
|
||||
while (parseIf(ctx, ','));
|
||||
parse(ctx, ')');
|
||||
|
||||
if (insertColumns.length != insertValues.size())
|
||||
|
||||
Loading…
Reference in New Issue
Block a user