Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed creation of where clause in translateJoin #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

joschne
Copy link
Collaborator

@joschne joschne commented Aug 14, 2019

Problem
When adding a where condition on $relation of a certain depth (zero based level 2 and deeper), the wrong where clause is used to close the join.

Steps to reproduce: Create a filter definition with at least 3 nested relations and add a where clause to the innermost child of the filter. This should then lead to an error like "column [child_table].[column used in where clause] does not exist"

Solution
Use the parentJoin.where instead of closeJoin.where in translateJoin().

https://github.com/kleiolab/findComplex/blob/3d9a3d48df3071675f11443f36b00db149e21170/findComplex.js#L489-L501

Remark
Since I don't understand the full complexity of the library, I'm not sure if this PR really solves this problem. There are two comment in the changed code section.
Can you please review this @tellex ?
That would be wonderful! Thanks

When closing joins after a certain level of depth (3rd level), the wrong where clause was used to close the join. This commit tries to fix that.
@vanderdill
Copy link

@joschne found the same problem and your solution worked for me too. Thanks!

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.

2 participants