Skip to content

RENAME MODULE fails: case mismatch between visitor and executor #473

@retran

Description

@retran

Description

RENAME MODULE OldModule TO NewModule; fails with:

Error: rename not supported for MODULE

Root Cause

Case mismatch between visitor and executor:

  • Visitor (visitor_entity.go:841): sets ObjectType: "MODULE" (uppercase)
  • Executor (cmd_rename.go:38): checks case "module": (lowercase)

The executor's switch statement at line 38 matches "module" but the visitor produces "MODULE", so it falls through to the default case which returns NewUnsupported.

Fix

Either:

  • Change visitor_entity.go:841 to ObjectType: "module" (consistent with all other rename types which are lowercase)
  • Or add strings.ToLower(s.ObjectType) in the switch

Reproduction

mxcli -c "CREATE MODULE OldMod; RENAME MODULE OldMod TO NewMod;" -p app.mpr
# Error: rename not supported for MODULE

Severity

Medium — feature is fully implemented but unreachable due to a one-character casing bug.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions