This commit is contained in:
Mike Bayer
2010-03-19 21:42:35 -04:00
parent 5cd6539191
commit 268c64a6aa
2 changed files with 2 additions and 3 deletions
+2 -2
View File
@@ -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)
-1
View File
@@ -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