Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow usage of aliases defined in previous matches. (vesoft-inc#1870)
<!-- Thanks for your contribution! In order to review PR more efficiently, please add information according to the template. --> ## What type of PR is this? - [X] bug - [ ] feature - [ ] enhancement ## What problem(s) does this PR solve? #### Issue(s) number: Close vesoft-inc#5020 #### Description: The `with *` in a match clause like `match ...(v999)... match ... match ... match ...(v999)... with *` from a multi-match query, where v999 is defined in a previous match, rebuilds named aliases from all query parts, causing v999 to duplicate and trigger a false error. This is actually ok, since they are in fact the same ones. There is actually no redefinition. This compiles with openCypher and neo4j. ## How do you solve it? 1. Allow the usage of aliases defined in previous matches. Only report redefinition of aliases if an alias is repeateed within the current query part. 2. Fixed an unstable tck case. ## Special notes for your reviewer, ex. impact of this fix, design document, etc: ## Checklist: Tests: - [ ] Unit test(positive and negative cases) - [ ] Function test - [ ] Performance test - [X] TCK Affects: - [ ] Documentation affected (Please add the label if documentation needs to be modified.) - [ ] Incompatibility (If it breaks the compatibility, please describe it and add the label.) - [ ] If it's needed to cherry-pick (If cherry-pick to some branches is required, please label the destination version(s).) - [ ] Performance impacted: Consumes more CPU/Memory ## Release notes: Please confirm whether to be reflected in release notes and how to describe: > ex. Fixed the bug ..... Migrated from vesoft-inc#5021 Co-authored-by: Cheng Xuntao <[email protected]>
- Loading branch information