From: Mike Bayer Date: Tue, 9 Jul 2013 15:52:31 +0000 (-0400) Subject: - we dont actually need this unicode cast, on py3k + linux it seems the X-Git-Tag: rel_0_9_0b1~187 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=cd8a40284d0fb053f652f4a3d2745c22674603f8;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git - we dont actually need this unicode cast, on py3k + linux it seems the has_table issues are OK. On OSX forget it. - still some issues with PY3k + pyodbc + decimal values it doesn't expect, not sure --- diff --git a/lib/sqlalchemy/dialects/mssql/base.py b/lib/sqlalchemy/dialects/mssql/base.py index 3c329fe5e5..7621f4aabe 100644 --- a/lib/sqlalchemy/dialects/mssql/base.py +++ b/lib/sqlalchemy/dialects/mssql/base.py @@ -1161,17 +1161,11 @@ class MSDialect(default.DefaultDialect): pass return self.schema_name - def _unicode_cast(self, column): - if self.server_version_info >= MS_2005_VERSION: - return cast(column, NVARCHAR(_warn_on_bytestring=False)) - else: - return column - @_db_plus_owner def has_table(self, connection, tablename, dbname, owner, schema): columns = ischema.columns - whereclause = self._unicode_cast(columns.c.table_name) == tablename + whereclause = columns.c.table_name == tablename if owner: whereclause = sql.and_(whereclause, diff --git a/lib/sqlalchemy/dialects/mssql/information_schema.py b/lib/sqlalchemy/dialects/mssql/information_schema.py index c0d5d91681..7ac1b703e2 100644 --- a/lib/sqlalchemy/dialects/mssql/information_schema.py +++ b/lib/sqlalchemy/dialects/mssql/information_schema.py @@ -7,7 +7,7 @@ # TODO: should be using the sys. catalog with SQL Server, not information schema from ... import Table, MetaData, Column -from ...types import String, Unicode, Integer, TypeDecorator +from ...types import String, Unicode, UnicodeText, Integer, TypeDecorator from ... import cast from ... import util from ...sql import expression diff --git a/test/sql/test_query.py b/test/sql/test_query.py index 0ed429850c..39c8962666 100644 --- a/test/sql/test_query.py +++ b/test/sql/test_query.py @@ -1370,6 +1370,8 @@ class TableInsertTest(fixtures.TablesTest): inserted_primary_key=[1] ) + @testing.crashes("mssql+pyodbc", + "Pyodbc + SQL Server + Py3K, some decimal handling issue") def test_uppercase_inline_implicit(self): t = self.tables.foo self._test(