waterWang opened a new pull request, #2545:
URL: https://github.com/apache/age/pull/2545
## Description
Fixes #2540
```sql
MATCH p = ()-[*1]->(n:End {id: 2})
RETURN *
```
fails with `ERROR: return row and column definition list do not match` while
the equivalent explicit `RETURN p, n` succeeds.
## Root cause
When a variable-length edge pattern has no explicit start/end variable,
`build_VLE_relation` in cypher_gram.y assigns internal helper names via
`create_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 by `RETURN *` 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 with
`AGE_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-existing `age_load`/file-path
and `age_upgrade` env failures, unrelated to this change)
- Manual repro now returns the expected (n, p) columns matching the AGE
convention that `RETURN *` orders entities before the path variable
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]