Skip to content

Migration shows successful when only exception stubs are generated due to missing package body in source #290

Description

@FranckPachot

Describe the bug

When a source Oracle package cannot be fully extracted/compiled, the conversion pipeline may generate PostgreSQL function stubs that only raise Oracle-compatible exceptions (ORA-06508 / ORA-04067). However, the migration report still marks the package as Converted with 100% success rate, which overstates migration readiness because the package implementation was not migrated.

observed on ms-ossdata.vscode-pgsql version 1.27.3

To Reproduce

Create a package where body compiles with error in the source (Oracle) and run the migration.

In PostgreSQL the migration create functions like this:

CREATE OR REPLACE FUNCTION _mig_scratch_soe."orderentry$browseproducts"
(
    cust_id text,
    min_sleep integer,
    max_sleep integer
)
RETURNS character varying
LANGUAGE 'plpgsql'
AS $BODY$
BEGIN
    -- Oracle raises ORA-04067 + ORA-06508
    RAISE EXCEPTION
        USING
            ERRCODE = 'U6508',
            MESSAGE = 'ORA-06508: PL/SQL: could not find program unit being called: ORDERENTRY.BROWSEPRODUCTS',
            DETAIL = 'ORA-04067: not executed, package body does not exist';
END;
$BODY$;

And the report shows:

Package Objects

Object Type   Extracted   Converted   Merged   Fallback   Failed   Skipped   Success Rate
PACKAGE       1           1           0        0          0        0         100.0%

Total Package

Additionally, when fixing the source (either remove the package because it is not used, or fix it) we cannot re-run the migration:

Image

Expected behavior

I would expect at least a warning when the generated PostgreSQL routine contains a stub with error, not an all-green 100% success in the report, and a review task, with the possibility to re-run when the root cause has been fixed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions