GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Engine: NPEs accessing rid when it is null · Issue #31 · ArcadeData/arcadedb

Engine: NPEs accessing rid when it is null #31

New issue
Copy link
New issue
Copy link
Closed
Closed
Engine: NPEs accessing rid when it is null#31
Copy link
Assignees
antarcticgiraffe
Milestone
21.9.1

Description

@giastfader
giastfader
opened on Sep 3, 2021
Issue body actions

ArcadeDB Version: 21.9.1-SNAPSHOT

JDK Version: N/A

OS: N/A

I found at least two points where there is an explicit use of the rid variable when it is for sure null, because there is an explicit test on the null condition.

arcadedb/engine/src/main/java/com/arcadedb/query/sql/parser/Rid.java

Line 167 in bb85560

public PInteger getBucket() {

    public PInteger getBucket() {
        if (expression != null) {
            RID rid = toRecordId((Result) null, new BasicCommandContext());
            if (rid == null) {
                PInteger result = new PInteger(-1);
                result.setValue(rid.getBucketId());
                return result;
            }
        }
        return bucket;
    }

    public PInteger getPosition() {
        if (expression != null) {
            RID rid = toRecordId((Result) null, new BasicCommandContext());
            if (rid == null) {
                PInteger result = new PInteger(-1);
                result.setValue(rid.getPosition());
                return result;
            }
        }
        return position;
    }

Activity

  1. lvca commented on Sep 3, 2021

    @lvca
    lvca
    on Sep 3, 2021
    Member
    More actions

    I believe we get that code from OrientDB when we ported the SQL layer.

  2. lvca
    assigned
    lvca
    and
    antarcticgiraffe
    and unassigned
    lvca
    on Sep 3, 2021
  3. lvca
    added this to the 21.9.1 milestone on Sep 3, 2021
  4. antarcticgiraffe commented on Sep 6, 2021

    @antarcticgiraffe
    antarcticgiraffe
    on Sep 6, 2021
    Contributor
    More actions

    Hi @lvca @giastfader

    I checked OrientDB code and it's exactly the same.
    I agree with you that this logic makes no sense at all. Probably the null check is just inverted, ie. if the expression exists, try to use it to calculate the RID and in case (rid != null) use it to return the bucket or the position; otherwise just use the raw bucket/position value.

    I'm fixing the code in this sense.

    We should also report the problem to OrientDB project, as it could be of interest.

    Regards

    AG

  5. antarcticgiraffe commented on Sep 6, 2021

    @antarcticgiraffe
    antarcticgiraffe
    on Sep 6, 2021
    Contributor
    More actions

    Fixed with 11b6800

  6. antarcticgiraffe
    closed this as completedon Sep 6, 2021
  7. mergify
    added a commit that references this issue on Aug 18, 2026

    chore(deps): bump the go-modules group across 1 directory with 3 upda…

    4e0e573
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @antarcticgiraffe
    antarcticgiraffe

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    • 21.9.1

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.