[jOOQ/jOOQ#18202] DSL.excluded with UDTField creates query with syntax error

This commit is contained in:
Lukas Eder 2025-03-24 15:12:28 +01:00
parent 79c88c3031
commit 31dc00fb1d

View File

@ -121,11 +121,15 @@ implements
default:
// [#7552] When emulating INSERT .. ON DUPLICATE KEY UPDATE using
// MERGE, the EXCLUDED pseudo table is called "t", instead
ctx.visit(ctx.data(ExtendedDataKey.DATA_INSERT_ON_DUPLICATE_KEY_UPDATE) != null
? name("t")
: N_EXCLUDED)
.sql('.')
.qualify(false, c -> c.visit(field));
// [#18202] Don't render the EXCLUDED name here in case it needs to be enclosed
// in parentheses, e.g. in a UDTPathField
Table<?> t = (Table<?>) ctx.data(SimpleDataKey.DATA_DML_TARGET_TABLE);
ctx.scopeRegister(t, false,
ctx.data(ExtendedDataKey.DATA_INSERT_ON_DUPLICATE_KEY_UPDATE) != null
? table(name("t"))
: table(N_EXCLUDED))
.visit(field)
.scopeRegister(t, false, null);
break;
}
}