[jOOQ/jOOQ#12599] Incorrect MERGE statement syntax generated in FIREBIRD when aliasing USING derived table
This commit is contained in:
parent
fcc4467913
commit
167ba3c705
@ -87,6 +87,7 @@ import static org.jooq.impl.Tools.map;
|
||||
import static org.jooq.impl.Tools.visitSubquery;
|
||||
import static org.jooq.impl.Tools.BooleanDataKey.DATA_AS_REQUIRED;
|
||||
import static org.jooq.impl.Tools.BooleanDataKey.DATA_UNALIAS_ALIASED_EXPRESSIONS;
|
||||
import static org.jooq.impl.Tools.BooleanDataKey.DATA_WRAP_DERIVED_TABLES_IN_PARENTHESES;
|
||||
import static org.jooq.impl.Tools.DataKey.DATA_SELECT_ALIASES;
|
||||
import static org.jooq.impl.Values.NO_SUPPORT_VALUES;
|
||||
|
||||
@ -359,6 +360,13 @@ final class Alias<Q extends QueryPart> extends AbstractQueryPart implements UEmp
|
||||
private final void toSQLWrapped(Context<?> ctx) {
|
||||
boolean wrap = wrapInParentheses.test(ctx);
|
||||
|
||||
if (wrap)
|
||||
ctx.data(DATA_WRAP_DERIVED_TABLES_IN_PARENTHESES, false, c -> toSQLWrapped(c, wrap));
|
||||
else
|
||||
toSQLWrapped(ctx, wrap);
|
||||
}
|
||||
|
||||
private final void toSQLWrapped(Context<?> ctx, boolean wrap) {
|
||||
ctx.sql(wrap ? "(" : "")
|
||||
.visit(wrapped)
|
||||
.sql(wrap ? ")" : "");
|
||||
|
||||
@ -1260,9 +1260,8 @@ implements
|
||||
}
|
||||
|
||||
// This should probably execute an INSERT statement
|
||||
else {
|
||||
else
|
||||
throw new IllegalStateException("Cannot omit KEY() clause on a non-Updatable Table");
|
||||
}
|
||||
}
|
||||
else {
|
||||
for (int i = 0; i < getUpsertKeys().size(); i++) {
|
||||
@ -1351,9 +1350,8 @@ implements
|
||||
break;
|
||||
}
|
||||
}
|
||||
else {
|
||||
else
|
||||
toSQLStandard(ctx);
|
||||
}
|
||||
}
|
||||
|
||||
private final void toSQLMySQLOnDuplicateKeyUpdate(Context<?> ctx) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user