fix: exclude internal VLE helper vars from RETURN * expansion (#2540) - #2545
Open
waterWang wants to merge 1 commit into
Open
fix: exclude internal VLE helper vars from RETURN * expansion (#2540)#2545waterWang wants to merge 1 commit into
waterWang wants to merge 1 commit into
Conversation
…#2540) When a variable-length edge pattern assigns internal helper column names via create_unique_name(AGE_DEFAULT_PREFIX"vle_function_{start,end}_var") in cypher_gram.y, those columns land in the namespace and are picked up by RETURN * expansion (ExpandAllTables -> expand_pnsi_attrs). The SRF is then invoked with one column more than the caller's column definition list declares, producing: ERROR: return row and column definition list do not match e.g. MATCH p = ()-[*1]->(n:End {id: 2}) RETURN * AS (p agtype, n agtype) Filter out the internal VLE helper columns in expand_pnsi_attrs the same way hidden vars/aliases are already excluded. Regression-tested with make installcheck: 41/43 pass (age_load/age_upgrade fail for pre-existing environment reasons unrelated to this change).
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.
Description
Fixes #2540
fails with
ERROR: return row and column definition list do not matchwhile the equivalent explicitRETURN p, nsucceeds.Root cause
When a variable-length edge pattern has no explicit start/end variable,
build_VLE_relationin cypher_gram.y assigns internal helper names viacreate_unique_name(AGE_DEFAULT_PREFIX"vle_function_{start,end}_var")(e.g._age_default_vle_function_start_var_1). Those columns land in the parse namespace and are picked up byRETURN *expansion (ExpandAllTables->expand_pnsi_attrs). The SRF is then invoked with one extra column, producing the row/column mismatch error.Fix
In
expand_pnsi_attrs, skip columns whose name begins withAGE_DEFAULT_PREFIX "vle_function_", the same way the existing hidden-var (AGE_DEFAULT_VARNAME_PREFIX) and hidden-alias (AGE_DEFAULT_ALIAS_PREFIX) filters work.Verification
make installcheck: 41/43 pass (only pre-existingage_load/file-path andage_upgradeenv failures, unrelated to this change)RETURN *orders entities before the path variable