Open
Description
When we try to access the constant version
in package sys.dbms_db_version
, ruby-plsql bails out with
No PL/SQL procedure or variable 'VERSION' found
package.rb:83:in `method_missing'
The cause seems to be a change in the source code of sys.dbms_db_version
in combination with the way plsql-ruby tries to identify variables and constants.
variable.rb
selects all rows from all_source
that match the variable name and then verifies the variable with a regex. The regex assumes that the variable declaration ends with a semicolon on the same line.
Unfortunately, this fails if the assignment to the variable is wrapped to the next line. This is exactly what changed in sys.dbms_db_version
between 12 and 19:
SELECT * FROM all_source WHERE owner = 'SYS' AND name = 'DBMS_DB_VERSION' AND type = 'PACKAGE';
-- Oracle 12:
package dbms_db_version is
version constant pls_integer := 12; -- RDBMS version number
release constant pls_integer := 2; -- RDBMS release number
-- Oracle 19:
package dbms_db_version is
version constant pls_integer :=
19; -- RDBMS version number
release constant pls_integer := 0; -- RDBMS release number
An easy fix would be to make the semicolon at the end of the line optional. I can create a PR if that's acceptable.
Metadata
Metadata
Assignees
Labels
No labels