Skip to content

[BUG] Valid MERGE query fails in planner with unsupported alias-management operator 31 #164

@d1zzy126

Description

@d1zzy126

Describe the bug
NeuG accepts MERGE syntax and plans the query as an update, but a valid MERGE query fails during planning with:

Unsupported operator type for alias management: 31

Statement delta reduced the original relationship MERGE reproducer to a single-node MERGE, so this does not appear to be specific to relationship writes.

Minimal reproducer

from __future__ import annotations

import shutil
import tempfile
from pathlib import Path

from neug import Database


def main() -> None:
    db_path = Path(tempfile.gettempdir()) / "neug_bug_004"
    shutil.rmtree(db_path, ignore_errors=True)

    db = Database(str(db_path), mode="w")
    conn = db.connect()

    setup = [
        ("CREATE NODE TABLE L0(id INT64, k0 INT64, PRIMARY KEY(id));", "schema"),
    ]

    for idx, (query, mode) in enumerate(setup, start=1):
        print(f"STEP {idx}: {query}")
        conn.execute(query, access_mode=mode)

    query = "MERGE (:L0 {id: 2})"
    print(f"STEP {len(setup) + 1}: {query}")
    conn.execute(query, access_mode="update")


if __name__ == "__main__":
    main()

Observed output

STEP 2: MERGE (:L0 {id: 2})
RuntimeError: Failed to execute query: MERGE (:L0 {id: 2}). Error code: 3000, Error Message: Unsupported operator type for alias management: 31 at /project/src/compiler/gopt/g_alias_manager.cpp:121 func: extractSingleOpGAliasNames, Error Code: 9999

Expected behavior
The MERGE query is valid and should execute successfully.

Why this looks like a bug instead of an unsupported feature

  • MERGE is part of the parser and planner pipeline.
  • The error is not a parser or binder rejection.
  • Operator type 31 maps to MERGE, so the failure happens because planner alias-management does not handle the MERGE logical operator.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

Status

In progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions