Open dadrake3 opened 6 months ago
Hi
I've yet to relook at the code, but I'm not really sure how to solve this. Using a recursive query to find the actual synonym seems a bit too heavy handed.
@zzzeek do you have suggestions on your part?
@dadrake3 Is the issue blocking of can you work around it by avoiding the double synonym?
@CaselIT Yes I was able to work around it by just accessing the base synonym directly once I determined that its a nested synonym.
However, the errors I was getting weren't intuitive, just "table or view does not exist", so I thought Id post about it here
ok, thanks for reporting it.
I think that maybe just mentioning it in the docs about synonym in oracle is enough here. @zzzeek what do you think?
Talked with mike about this. The idea is to have a better error when a table not found error is raised while reflecting synonyms to check if it's a nested one. So not supporting this use case, but it should at least be easier to debug what's up.
The documentation can also be updated
Describe the bug
I get a table not found error when trying to reflect a synonym of a synonym on a dblink. I try reflecting the table as such
the queries that it runs are
The second query returns nothing. It appears that it is taking the
table_owner
field from the first query and then using that in the second query. However since this is a synonym of a synonym the truetable_owner
is not the same as the owner of the second synonym, which causes this to return no results.Optional link from https://docs.sqlalchemy.org which documents the behavior that is expected
No response
SQLAlchemy Version in Use
2.0.25
DBAPI (i.e. the database driver)
oracledb 1.4.2
Database Vendor and Major Version
Oracle 19.0.0.0.0,
Python Version
3.11.7
Operating system
OSX
To Reproduce
Error
Additional context
No response