Skip to content

Conversation

@falkenhawk
Copy link
Member

@falkenhawk falkenhawk commented Dec 22, 2022

This fixes an issue with 'partial' subqueries that they lose aliasMap from q._context (QueryBuilder's "internal context") while generating nested where sql part. QueryBuilder.subqueryOf() used to grab context from "parent" query, but it doesn't anymore. (since 2019-02-13) Vincit@524e0be

In our case, we were getting SQL errors where alias was necessary to make it work, but it was missing

ER_NON_UNIQ_ERROR: Column 'event_id' in IN/ALL/ANY subquery is ambiguous

Basically reintroducing what was deleted in Vincit@524e0be (to fix Vincit#1205) but wrap merging context with a condition that it should only apply to "partial" subqueries + reverse the sequence that isPartial() is set before subqueryOf()

This fixes an issue with 'partial' suibqueries that they lose `aliasMap` from `q._context`
(QueryBuilder's "internal context") while generating nested `where` sql part.
`QueryBuilder.subqueryOf()` used to grab context from "parent" query, but it doesn't anymore. (since 2019-02-13)
Vincit@524e0be

Basically reintroducing what was deleted in Vincit@524e0be but wrap merging context with a condition that it should only apply to "partial" subqueries + reverse the sequence that `isPartial()` is set before `subqueryOf()`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Subqueries break upgrading from 1.4.0 to 1.5.3

2 participants