fixed creation of where clause in translateJoin#3
Open
joschne wants to merge 1 commit into
Open
Conversation
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.
|
@joschne found the same problem and your solution worked for me too. Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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