Oracle foreign key reflection broken when multiple tables named ParentTable

Issue #373 resolved
Former user created an issue

In Oracle, when child_tbl contains a foreign key constraint to parent_tbl, and there are multiple tables named parent_tbl (in various schemas) that are visible (SELECT privilege) to the connecting user account, then autoload of child_tbl will throw the exception

There are multiple tables with name child_tbl in the schema, you must specifie owner

(not a strictly accurate message; the multiple tables are not in the schema, they are simply visible to the schema.)

The problem arises because, at line 283 in oracle.py, in schema.Table(remote_table, table.metadata, autoload=True, autoload_with=connection)

no ownership data is used to instantiate. This ownership data is easily available, however, by adding one more column (rem.owner) to constraintSQL, and passing that data into Table().

Comments (5)

  1. Mike Bayer repo owner

    patched this in changeset:2107, fixed my typo in changeset:2108. existing unit tests pass. im using Oracle XE and i cant locate the admin PW for it right now so ill take your word that this particular test works also. thanks for the patch !

  2. Log in to comment