- attached mssql.py.diff
MSSQL get_default_schema_name is hardcoded in the dialect
Issue #1258
resolved
In the mssql dialect, the method get_default_schema_name returns the instance attribute schema_name instead of requesting the default schema from the server. It defaults to 'dbo'. If the user's default schema is not 'dbo', this method fails to return the the correct schema name.
Example:
import sqlalchemy as sa
e = sa.create_engine('mssql://scott:tiger@localhost/test')
print e.dialect.get_default_schema_name(e) # is dbo, but should be test.
I'm attaching a patch which uses an approach similar to the postgres dialect. Before the patch, with a default schema != 'dbo', one test would fail in test/dialect.mssql.py and all tests in test/engine/reflection.py failed. With the patch, all of these tests pass.
-Randall
Comments (4)
-
Account Deleted -
repo owner - changed milestone to 0.5.0
looks great to me, yall know what to do
-
- changed status to resolved
Corrected in 88aad2a374074e2b5992e9e9e110967707da0bc1. Thanks Randall Smith.
-
repo owner - removed milestone
Removing milestone: 0.5.0 (automated comment)
- Log in to comment
patch