Skip to content

fix: add rid.setLegacy(true) in collection branches to prevent NullPointerException (#5505) - #5506

Merged
robfrank merged 3 commits into
ArcadeData:mainfrom
waterWang:fix/rid-collection-npe-5505
Aug 1, 2026
Merged

robfrank merged 3 commits into
ArcadeData:mainfrom
waterWang:fix/rid-collection-npe-5505

Conversation

@waterWang

Copy link
Copy Markdown
Contributor

Fixes #5505

Problem: Passing a collection of RIDs as a query parameter to SELECT or TRAVERSE throws NullPointerException:

Root cause: The collection branches in both and create objects without calling . The singleton RID branches beside them do call it. Without this flag, tries to dereference a null field instead of reading / directly.

Fix: Added in the collection branch of both planners:

  • (after )
  • (after )

Testing: Single-element bound RID collections and multi-element collections now work correctly for both SELECT and TRAVERSE.

@mergify

mergify Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@codecov

codecov Bot commented Jul 28, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 67.48%. Comparing base (7469a24) to head (664dfce).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5506      +/-   ##
==========================================
+ Coverage   67.45%   67.48%   +0.02%     
==========================================
  Files        1724     1724              
  Lines      142993   142995       +2     
  Branches    30643    30643              
==========================================
+ Hits        96463    96504      +41     
+ Misses      33852    33812      -40     
- Partials    12678    12679       +1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@lvca lvca self-assigned this Jul 28, 2026
@lvca lvca added this to the 26.8.1 milestone Jul 28, 2026
@justinblethrow-cloud

Copy link
Copy Markdown
Contributor

Confirmed this independently on current main (cda99c1c) and added focused regression coverage for both planner paths. Before rid.setLegacy(true), both tests fail with the reported Rid.toRecordId null dereference; with the two changes in this PR, both pass.

Tests-only commit: justinblethrow-cloud@59b631f

It can be applied with:

git cherry-pick 59b631f82fc38bd9116408d71eb53f2dee1c87a4

The tests cover:

  • SELECT @rid AS rid FROM :seeds with two bound record identifiers.
  • SELECT FROM (TRAVERSE ... FROM :seeds MAXDEPTH 1) with two roots and verified expanded results.

Focused verification: 2 tests run, 0 failures, 0 errors. This should also exercise the two lines that Codecov currently reports as uncovered.

waterWang and others added 3 commits August 1, 2026 10:07
…nd TRAVERSE targets

Both planners' collection branches built the per-element Rid AST node without
flagging it legacy, so Rid.toRecordId dereferenced a null expression. A bare
bound RID always worked, so each test binds a collection; the single-element
list is covered separately because it fails on the same path.
@robfrank
robfrank force-pushed the fix/rid-collection-npe-5505 branch from 59fe889 to 664dfce Compare August 1, 2026 08:08
@robfrank robfrank changed the title fix: add rid.setLegacy(true) in collection branches to prevent NullPointerException (#5505) [fj4WqyCCw3C5ShR1RfB7MoBPTpkRrBFYP1uT35g3MvT] fix: add rid.setLegacy(true) in collection branches to prevent NullPointerException (#5505) Aug 1, 2026
@robfrank
robfrank merged commit 83448ea into ArcadeData:main Aug 1, 2026
18 of 22 checks passed
robfrank added a commit that referenced this pull request Aug 14, 2026
…interException (#5505) (#5506)

Co-authored-by: robfrank <ro.franchini@gmail.com>
(cherry picked from commit 83448ea)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TRAVERSE and SELECT from a bound RID collection throw NullPointerException

4 participants