diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2023-04-26 10:34:46 -0400 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2023-04-26 15:40:18 -0400 |
| commit | 6a0d61f12110624ad8709f67d4523e82bde262e5 (patch) | |
| tree | ac1a7f60ab8e277224e0e1eedc01a4d6c3316b44 /test | |
| parent | 9f675fd042b05977f1b38887c2fbbb54ecd424f7 (diff) | |
| download | sqlalchemy-6a0d61f12110624ad8709f67d4523e82bde262e5.tar.gz | |
ensure correct cast for floats vs. numeric; other fixes
Fixed regression caused by the fix for :ticket:`9618` where floating point
values would lose precision being inserted in bulk, using either the
psycopg2 or psycopg drivers.
Implemented the :class:`_sqltypes.Double` type for SQL Server, having it
resolve to ``REAL``, or :class:`_mssql.REAL`, at DDL rendering time.
Fixed issue in Oracle dialects where ``Decimal`` returning types such as
:class:`_sqltypes.Numeric` would return floating point values, rather than
``Decimal`` objects, when these columns were used in the
:meth:`_dml.Insert.returning` clause to return INSERTed values.
Fixes: #9701
Change-Id: I8865496a6ccac6d44c19d0ca2a642b63c6172da9
Diffstat (limited to 'test')
| -rw-r--r-- | test/dialect/mssql/test_types.py | 2 | ||||
| -rw-r--r-- | test/requirements.py | 4 |
2 files changed, 6 insertions, 0 deletions
diff --git a/test/dialect/mssql/test_types.py b/test/dialect/mssql/test_types.py index d94984e0e..916d4252f 100644 --- a/test/dialect/mssql/test_types.py +++ b/test/dialect/mssql/test_types.py @@ -300,6 +300,8 @@ class TypeDDLTest(fixtures.TestBase): (types.Float, [None], {}, "FLOAT"), (types.Float, [12], {}, "FLOAT(12)"), (mssql.MSReal, [], {}, "REAL"), + (types.Double, [], {}, "DOUBLE PRECISION"), + (types.Double, [53], {}, "DOUBLE PRECISION"), (types.Integer, [], {}, "INTEGER"), (types.BigInteger, [], {}, "BIGINT"), (mssql.MSTinyInteger, [], {}, "TINYINT"), diff --git a/test/requirements.py b/test/requirements.py index 9a8500ac3..3c72cd07d 100644 --- a/test/requirements.py +++ b/test/requirements.py @@ -1396,6 +1396,10 @@ class DefaultRequirements(SuiteRequirements): ) @property + def float_or_double_precision_behaves_generically(self): + return skip_if(["oracle", "mysql", "mariadb"]) + + @property def precision_generic_float_type(self): """target backend will return native floating point numbers with at least seven decimal places when using the generic Float type.""" |
