summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/dialects/mssql
diff options
context:
space:
mode:
authorBrad Allen <bradallen137@gmail.com>2010-03-18 11:20:45 -0600
committerBrad Allen <bradallen137@gmail.com>2010-03-18 11:20:45 -0600
commite9df4ff45a0b494fa8ab8a4232ea770603439636 (patch)
treec58770b55713b7b30111f5be4e60899234966367 /lib/sqlalchemy/dialects/mssql
parentb7f0b5b2c2c544e212ca0bd51deca38a0b0f8b3a (diff)
parentfc2f095c65f8cade25dee21f775edb3cd52122c0 (diff)
downloadsqlalchemy-e9df4ff45a0b494fa8ab8a4232ea770603439636.tar.gz
Merged from main tip.
Diffstat (limited to 'lib/sqlalchemy/dialects/mssql')
-rw-r--r--lib/sqlalchemy/dialects/mssql/base.py25
1 files changed, 6 insertions, 19 deletions
diff --git a/lib/sqlalchemy/dialects/mssql/base.py b/lib/sqlalchemy/dialects/mssql/base.py
index bd5af4e8e..6425291c8 100644
--- a/lib/sqlalchemy/dialects/mssql/base.py
+++ b/lib/sqlalchemy/dialects/mssql/base.py
@@ -277,27 +277,14 @@ RESERVED_WORDS = set(
class _MSNumeric(sqltypes.Numeric):
- def result_processor(self, dialect, coltype):
- if self.asdecimal:
- # TODO: factor this down into the sqltypes.Numeric class,
- # use dialect flags
- if getattr(self, 'scale', None) is None:
- # we're a "float". return a default decimal factory
- return processors.to_decimal_processor_factory(decimal.Decimal)
- elif dialect.supports_native_decimal:
- # we're a "numeric", DBAPI will give us Decimal directly
- return None
- else:
- # we're a "numeric", DBAPI returns floats, convert.
- return processors.to_decimal_processor_factory(decimal.Decimal, self.scale)
- else:
- #XXX: if the DBAPI returns a float (this is likely, given the
- # processor when asdecimal is True), this should be a None
- # processor instead.
- return processors.to_float
-
+
def bind_processor(self, dialect):
def process(value):
+ # TODO: this seems exceedingly complex.
+ # need to know exactly what tests cover this, so far
+ # test_types.NumericTest.test_enotation_decimal
+ # see the _SybNumeric type in sybase/pyodbc for possible
+ # generalized solution on pyodbc
if isinstance(value, decimal.Decimal):
if value.adjusted() < 0:
result = "%s0.%s%s" % (