[#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:
Lukas Eder 2014-01-27 11:52:31 +01:00
parent 889d6be1ed
commit b118ea6fcb
2 changed files with 6 additions and 2 deletions

View File

@ -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)

View File

@ -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) {