Use type_owner for cross-schema type lookups - #254
Conversation
There was a problem hiding this comment.
Pull request overview
This PR fixes cross-schema PL/SQL type resolution by using the actual type owner from argument metadata when looking up composite type details, ensuring procedure/function parameters can reference types owned by other schemas.
Changes:
- Update composite type metadata queries to use
argument_metadata[:type_owner]instead of@schema_namefor type lookups. - Expand the secondary test user (arunit) privileges to support creating types/procedures needed by specs.
- Add an RSpec case that creates a type in a second schema, grants access, and validates cross-schema function discovery/execution.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| spec/support/create_arunit_user.sql | Grants additional privileges to the secondary schema user so cross-schema type tests can create required objects. |
| spec/plsql/procedure_spec.rb | Adds an integration spec covering cross-schema object type parameters and execution. |
| lib/plsql/procedure.rb | Fixes cross-schema composite type lookups by querying dictionary views using type_owner from all_arguments. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
8a90dc3 to
5b23804CompareThere was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Use argument_metadata[:type_owner] instead of @schema_name when querying ALL_PLSQL_TYPE_ATTRS, ALL_TAB_COLUMNS, ALL_PLSQL_COLL_TYPES, and ALL_COLL_TYPES so that types defined in another schema are resolved correctly. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
5b23804 to
8848b0bCompareUh oh!
There was an error while loading. Please reload this page.
Summary
argument_metadata[:type_owner]instead of@schema_namewhen queryingALL_PLSQL_TYPE_ATTRS,ALL_TAB_COLUMNS,ALL_PLSQL_COLL_TYPES, andALL_COLL_TYPESinget_field_definitionsandget_element_definitioncreate type,create procedure, andunlimited tablespaceto thearunittest user for cross-schema testingTest plan
testworkflow passes (Oracle 23c Free)test_11gworkflow passes (Oracle 11g XE)🤖 Generated with Claude Code