Skip to content

fixed creation of where clause in translateJoin#3

Open
joschne wants to merge 1 commit into
tellex:masterfrom
kleiolab:fix-where-clause
Open

fixed creation of where clause in translateJoin#3
joschne wants to merge 1 commit into
tellex:masterfrom
kleiolab:fix-where-clause

Conversation

@joschne
Copy link
Copy Markdown
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
Copy Markdown

@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