Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Session variables with subtypes crash #223

Open
apeiros opened this issue Sep 30, 2022 · 0 comments
Open

Session variables with subtypes crash #223

apeiros opened this issue Sep 30, 2022 · 0 comments

Comments

@apeiros
Copy link
Contributor

apeiros commented Sep 30, 2022

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.

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

No branches or pull requests

1 participant