From 268c64a6aaa64f3e09ec5a37ddffde57eb160d2d Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Fri, 19 Mar 2010 21:42:35 -0400 Subject: [PATCH] try < 0 --- lib/sqlalchemy/dialects/mssql/pyodbc.py | 4 ++-- test/dialect/test_mssql.py | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/sqlalchemy/dialects/mssql/pyodbc.py b/lib/sqlalchemy/dialects/mssql/pyodbc.py index 5625e3cd26..7f46ec7fb5 100644 --- a/lib/sqlalchemy/dialects/mssql/pyodbc.py +++ b/lib/sqlalchemy/dialects/mssql/pyodbc.py @@ -17,7 +17,7 @@ from sqlalchemy import types as sqltypes, util import decimal class _MSNumeric_pyodbc(sqltypes.Numeric): - """Turns Decimals with adjusted() < -6 or > 7 into strings. + """Turns Decimals with adjusted() < 0 or > 7 into strings. This is the only method that is proven to work with Pyodbc+MSSQL without crashing (floats can be used but seem to cause sporadic @@ -33,7 +33,7 @@ class _MSNumeric_pyodbc(sqltypes.Numeric): isinstance(value, decimal.Decimal): adjusted = value.adjusted() - if adjusted < -6: + if adjusted < 0: return self._small_dec_to_string(value) elif adjusted > 7: return self._large_dec_to_string(value) diff --git a/test/dialect/test_mssql.py b/test/dialect/test_mssql.py index c411427b65..7a4e4dc425 100644 --- a/test/dialect/test_mssql.py +++ b/test/dialect/test_mssql.py @@ -764,7 +764,6 @@ class TypesTest(TestBase, AssertsExecutionResults, ComparesTables): def teardown(self): metadata.drop_all() - @testing.crashes('mssql+pyodbc', 'FIXME: no clue what is up here.') @testing.fails_on_everything_except('mssql+pyodbc', 'this is some pyodbc-specific feature') def test_decimal_notation(self): import decimal -- 2.47.3