#435 Copying PKs fails under certain conditions in Oracle

2.3final
closed-fixed
Rob Manning
5
2006-10-27
2006-10-25
Rob Manning
No

The SQL that is produced for the primary key
is erroneous when the user has access to more than
one schema and the table and PK column exist in
more than one schema. Suppose that table 'test'
is in multiple schemas (A, B and C) that the user
has access to and with the same definition.
The SQL that is generated by DBCopy plugin
looks like:

CREATE TABLE test (
pkcol char(10),
col2 char(10),
PRIMARY KEY (pkcol, pkcol, pkcol)
);

This has to do with the code that queries the
metadata for PK for test doesn't specify the schema
or column. So PK columns for all accessible tables
named "test" in any schema are returned. The code
should be changed to respect schema (and if applicable,
catalog)

Discussion

  • Rob Manning
    Rob Manning
    2006-10-27

    Logged In: YES
    user_id=1287991

    Fixed in CVS. Now catalog or schema is used instead of null unless the driver claims not to support them. The FK SQL generation algorithm was similarly affected so the same solution was applied to this as well.

     
  • Rob Manning
    Rob Manning
    2006-10-27

    • status: open --> closed-fixed