linhongyu510 commented on code in PR #2559:
URL: https://github.com/apache/age/pull/2559#discussion_r4371915053
##########
src/backend/parser/cypher_clause.c:
##########
@@ -4621,6 +4629,132 @@ static ParseNamespaceItem
*transform_RangeFunction(cypher_parsestate *cpstate,
return pnsi;
}
+static const char *find_static_edge_label(List *pattern,
+ const char *variable_name)
+{
+ ListCell *path_cell;
+ const char *label = NULL;
+
+ foreach (path_cell, pattern)
+ {
+ cypher_path *path = lfirst(path_cell);
+ ListCell *entity_cell;
+
+ foreach (entity_cell, path->path)
+ {
+ Node *entity = lfirst(entity_cell);
+ cypher_relationship *rel;
+
+ if (!is_ag_node(entity, cypher_relationship))
+ continue;
+
+ rel = (cypher_relationship *)entity;
+ if (rel->name == NULL ||
+ strcmp(rel->name, variable_name) != 0)
+ continue;
+
+ if (rel->varlen != NULL || rel->parsed_label == NULL)
Review Comment:
Fixed in a8cb30bc: `is_redundant_edge_type_qual` now returns `false` when
`IS_DEFAULT_LABEL_EDGE(static_label)`, so a `type(r) = '_ag_label_edge'`
predicate is no longer elided.
Verified your repro on PostgreSQL 18.6: with the fix the query returns 0
rows (matches master), whereas the old PR returned '"P"'. Covered in
regress/sql/expr.sql (commit 3d3741b3) — the `_ag_label_edge` case asserts an
empty result, and the LIKES/OR/variable-length guards round out the set.
--
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]