Bug in System.Data.OracleClient w/Public Synonyms + FIX

  • Thread starter Thread starter Matt Mastracci
  • Start date Start date
M

Matt Mastracci

There's a bug in the System.Data.OracleClient when another tablespace
contains a public synonym with the same name as a table in the current
user's tablespace. Any ideas who I should contact to sent my problem & fix?

When grabbing the schema information for the table in the *current*
tablespace, you end up with the schema information for the table in the
*other* tablespace.

For instance: I create a table in another tablespace named "B" with no
public keys and create a public synonym named "B" to it. I then go to
my tablespace "TABLESPACE" and create a table "B" with the primary key
of "X".

When I run GetSchemaTable on a CommandReader() with the SQL "select *
from B", it returns that there are no public keys! This is because it's
picked up the other table's columns.

The query run to get the schema information looks like this:

SELECT * FROM ALL_SYNONYMS WHERE owner IN ('PUBLIC',USER) AND
synonym_name='PLC_FILTER'

It should look like this to pick up the local table before the public
synonym.

SELECT owner,table_name FROM ALL_TABLES WHERE TABLE_NAME='B' AND owner
IN ('PUBLIC',USER)
UNION ALL
SELECT table_owner, table_name FROM ALL_SYNONYMS WHERE owner IN
('PUBLIC',USER) AND synonym_name='B'
 
Where should I report this bug? It's a pretty obscure but serious one
if encountered.
 
Back
Top