Skip to content

fix: WITH clause scoping and filtering edge cases #362

@DecisionNerd

Description

@DecisionNerd

Summary

Phase 3 of v0.3.8 TCK compliance push. WITH clause has ~104 failing TCK scenarios.

Failure categories (from TCK analysis)

  • WITH WHERE filtering: predicate applied after projection (variable scope)
  • WITH DISTINCT: deduplication of projected values
  • Chained WITH: multiple WITH clauses, variable scoping between them
  • WITH after aggregation: scope after aggregate projection
  • Variable scoping: variables before WITH not visible after unless projected

TCK Impact

~104 scenarios (largest remaining failure category)

Acceptance Criteria

  • WITH n WHERE n.x > 0 filters correctly after projection
  • WITH DISTINCT x deduplicates projected values
  • Variables from before WITH are not visible after unless projected
  • Chained WITH clauses maintain correct scope
  • Subscript expressions on WITH-projected variables work correctly

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingexecutorChanges to query executorplannerChanges to query planner

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions