[#2982] Variable binding doesn't work in vendor-specific UPDATE t1 JOIN t2 queries, when joined tables are subqueries with bind values
This commit is contained in:
parent
889d6be1ed
commit
b118ea6fcb
@ -1328,7 +1328,7 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
|
||||
assertEquals("YY", b1.getValue(TBook_TITLE()));
|
||||
|
||||
// [#2982] Check if variable binding takes place correctly in this situation
|
||||
Select<?> subquery = select(TAuthor_ID()).from(TAuthor()).where(TAuthor_LAST_NAME().eq("Orwell"));
|
||||
Select<?> subquery = select(TAuthor_ID()).from(TAuthor()).where(TAuthor_ID().eq(1));
|
||||
assertEquals(2,
|
||||
create().update(TBook()
|
||||
.join(subquery)
|
||||
|
||||
@ -526,7 +526,11 @@ class UpdateQueryImpl<R extends Record> extends AbstractStoreQuery<R> implements
|
||||
|
||||
@Override
|
||||
public final void bind(BindContext context) {
|
||||
context.visit(getInto());
|
||||
boolean declareTables = context.declareTables();
|
||||
|
||||
context.declareTables(true)
|
||||
.visit(getInto())
|
||||
.declareTables(declareTables);
|
||||
|
||||
// A multi-row update was specified
|
||||
if (multiRow != null) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user