Skip to content

Session variables with subtypes crash #223

Description

@apeiros

Tested in version 0.7.1

If a session variable uses a subtype, querying its value or trying to set its value crashes.

To reproduce, create the following package in a schema:

CREATE OR REPLACE PACKAGE demo_pkg IS
   SUBTYPE demo_type IS NUMBER(38,0) NOT NULL;
   demo_var1 NUMBER(38,0) := 21;
   demo_var2 demo_pkg.demo_type := 34;
END;

And run this ruby code in e.g. a rails console

plsql.demo_pkg.demo_var1 # => 21 (as expected)
plsql.demo_pkg.demo_var2 # !> ArgumentError (Package variable data type DEMO_PKG.DEMO_TYPE is not object type defined in schema)

For people experiencing the same problem: I currently work around the problem by wrapping the variable access in functions which typecasts to base types.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions