Beispiel #1
0
 def order_by_label_with_expression(self):
     return fails_if([
                 ('firebird', None, None, "kinterbasdb doesn't send full type information"),
                 ('postgresql', None, None, 'only simple labels allowed'),
                 ('sybase', None, None, 'only simple labels allowed'),
                 ('mssql', None, None, 'only simple labels allowed')
             ])
Beispiel #2
0
    def empty_strings_varchar(self):
        """
        target database can persist/return an empty string with a varchar.
        """

        return fails_if(["oracle"],
                        'oracle converts empty strings to a blank space')
    def intersect(self):
        """Target database must support INTERSECT or equivalent."""

        return fails_if([
            "firebird", self._mysql_not_mariadb_103,
            "sybase",
        ], 'no support for INTERSECT')
Beispiel #4
0
    def parens_in_union_contained_select(self):
        """Target database must support parenthesized SELECT in UNION.

        E.g. (SELECT ...) UNION (SELECT ..)

        """
        return fails_if('sqlite')
Beispiel #5
0
    def expressions_against_unbounded_text(self):
        """target database supports use of an unbounded textual field in a
        WHERE clause."""

        return fails_if(
            ["oracle"],
            "ORA-00932: inconsistent datatypes: expected - got CLOB",
        )
    def precision_numerics_many_significant_digits(self):
        """target backend supports values with many digits on both sides,
        such as 319438950232418390.273596, 87673.594069654243

        """
        return exclusions.fails_if(lambda: True,
                    "Throws error SQL0604N, regarding Decimal(38, 12)"
            )
Beispiel #7
0
    def precision_numerics_enotation_large(self):
        """target backend supports Decimal() objects using E notation
        to represent very large values."""

        return fails_if(
            ("sybase+pyodbc", None, None, "Don't know how do get these values through FreeTDS + Sybase"),
            ("firebird", None, None, "Precision must be from 1 to 18"),
        )
Beispiel #8
0
 def two_phase_recovery(self):
     return self.two_phase_transactions + (
         exclusions.fails_if(
            lambda config: config.db.name == 'mysql' and (
                     config.db.dialect._is_mariadb or
                     config.db.dialect.server_version_info < (5, 7)
            )
         )
     )
Beispiel #9
0
    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."""

        return fails_if([
                    ('mysql', None, None,
                                'mysql FLOAT type only returns 4 decimals'),
                    ('firebird', None, None,
                                "firebird FLOAT type isn't high precision"),
                ])
Beispiel #10
0
    def order_by_col_from_union(self):
        """target database supports ordering by a column from a SELECT
        inside of a UNION

        E.g.  (SELECT id, ...) UNION (SELECT id, ...) ORDER BY id

        Fails on SQL Server

        """
        return fails_if('mssql')
Beispiel #11
0
    def parens_in_union_contained_select_w_limit_offset(self):
        """Target database must support parenthesized SELECT in UNION
        when LIMIT/OFFSET is specifically present.

        E.g. (SELECT ...) UNION (SELECT ..)

        This is known to fail on SQLite.

        """
        return fails_if('sqlite')
Beispiel #12
0
 def floats_to_four_decimals(self):
     return fails_if([
                 ("mysql+oursql", None, None, "Floating point error"),
                 ("firebird", None, None,
                     "Firebird still has FP inaccuracy even "
                     "with only four decimal places"),
                 ('mssql+pyodbc', None, None,
                             'mssql+pyodbc has FP inaccuracy even with '
                             'only four decimal places '
                         )
             ])
Beispiel #13
0
    def precision_numerics_many_significant_digits(self):
        """target backend supports values with many digits on both sides,
        such as 319438950232418390.273596, 87673.594069654243

        """
        return fails_if(
                    [('sqlite', None, None, 'TODO'),
                    ("firebird", None, None, "Precision must be from 1 to 18"),
                    ("sybase+pysybase", None, None, "TODO"),
                    ('mssql+pymssql', None, None, 'FIXME: improve pymssql dec handling')]
                )
Beispiel #14
0
    def precision_numerics_retains_significant_digits(self):
        """A precision numeric type will return empty significant digits,
        i.e. a value such as 10.000 will come back in Decimal form with
        the .000 maintained."""

        return fails_if(
            [
                ("oracle", None, None, "driver doesn't do this automatically"),
                ("firebird", None, None,
                 "database and/or driver truncates decimal places.")
            ]
        )
Beispiel #15
0
    def parens_in_union_contained_select_wo_limit_offset(self):
        """Target database must support parenthesized SELECT in UNION
        when OFFSET/LIMIT is specifically not present.

        E.g. (SELECT ... LIMIT ..) UNION (SELECT .. OFFSET ..)

        This is known to fail on SQLite.  It also fails on Oracle
        because without LIMIT/OFFSET, there is currently no step that
        creates an additional subquery.

        """
        return fails_if(['sqlite', 'oracle'])
Beispiel #16
0
    def update_where_target_in_subquery(self):
        """Target must support UPDATE where the same table is present in a
        subquery in the WHERE clause.

        This is an ANSI-standard syntax that apparently MySQL can't handle,
        such as:

        UPDATE documents SET flag=1 WHERE documents.title IN
            (SELECT max(documents.title) AS title
                FROM documents GROUP BY documents.user_id
            )
        """
        return fails_if("mysql", 'MySQL error 1093 "Cant specify target table ' 'for update in FROM clause"')
Beispiel #17
0
 def order_by_label_with_expression(self):
     return fails_if(
         [
             (
                 "firebird",
                 None,
                 None,
                 "kinterbasdb doesn't send full type information",
             ),
             ("postgresql", None, None, "only simple labels allowed"),
             ("sybase", None, None, "only simple labels allowed"),
             ("mssql", None, None, "only simple labels allowed"),
         ]
     )
Beispiel #18
0
    def precision_numerics_retains_significant_digits(self):
        """A precision numeric type will return empty significant digits,
        i.e. a value such as 10.000 will come back in Decimal form with
        the .000 maintained."""

        return fails_if(
                [
                    ('oracle', None, None,
            "this may be a bug due to the difficulty in handling "
            "oracle precision numerics"),
                    ("firebird", None, None,
        "database and/or driver truncates decimal places.")
                ]
                )
Beispiel #19
0
    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."""

        return fails_if([
            (
                "mysql",
                None,
                None,
                "mysql FLOAT type only returns 4 decimals",
            ),
            (
                "firebird",
                None,
                None,
                "firebird FLOAT type isn't high precision",
            ),
        ])
 def floats_to_four_decimals(self):
     return fails_if([
         ("mysql+oursql", None, None, "Floating point error"),
         ("firebird", None, None, "Firebird still has FP inaccuracy even "
          "with only four decimal places"),
         ('mssql+pyodbc', None, None,
          'mssql+pyodbc has FP inaccuracy even with '
          'only four decimal places '),
         ('mssql+pymssql', None, None,
          'mssql+pymssql has FP inaccuracy even with '
          'only four decimal places '),
         ('postgresql+pg8000', None, None,
          'postgresql+pg8000 has FP inaccuracy even with '
          'only four decimal places '),
         ('postgresql+psycopg2cffi', None, None,
          'postgresql+psycopg2cffi has FP inaccuracy even with '
          'only four decimal places ')
     ])
Beispiel #21
0
    def precision_numerics_many_significant_digits(self):
        """target backend supports values with many digits on both sides,
        such as 319438950232418390.273596, 87673.594069654243

        """

        def broken_cx_oracle(config):
            return against(config, 'oracle+cx_oracle') and \
                config.db.dialect.cx_oracle_ver <= (6, 0, 2) and \
                config.db.dialect.cx_oracle_ver > (6, )

        return fails_if(
            [
                ('sqlite', None, None, 'TODO'),
                ("firebird", None, None, "Precision must be from 1 to 18"),
                ("sybase+pysybase", None, None, "TODO"),
            ]
        )
Beispiel #22
0
    def precision_numerics_many_significant_digits(self):
        """target backend supports values with many digits on both sides,
        such as 319438950232418390.273596, 87673.594069654243

        """

        def broken_cx_oracle(config):
            return against(config, 'oracle+cx_oracle') and \
                config.db.dialect.cx_oracle_ver <= (6, 0, 2) and \
                config.db.dialect.cx_oracle_ver > (6, )

        return fails_if(
            [
                ('sqlite', None, None, 'TODO'),
                ("firebird", None, None, "Precision must be from 1 to 18"),
                ("sybase+pysybase", None, None, "TODO"),
            ]
        )
Beispiel #23
0
    def update_where_target_in_subquery(self):
        """Target must support UPDATE (or DELETE) where the same table is
        present in a subquery in the WHERE clause.

        This is an ANSI-standard syntax that apparently MySQL can't handle,
        such as::

            UPDATE documents SET flag=1 WHERE documents.title IN
                (SELECT max(documents.title) AS title
                    FROM documents GROUP BY documents.user_id
                )

        """
        return fails_if(
            self._mysql_not_mariadb_103,
            'MySQL error 1093 "Cant specify target table '
            'for update in FROM clause", resolved by MariaDB 10.3',
        )
Beispiel #24
0
 def floats_to_four_decimals(self):
     return fails_if(
         [
             ("mysql+oursql", None, None, "Floating point error"),
             (
                 "firebird",
                 None,
                 None,
                 "Firebird still has FP inaccuracy even "
                 "with only four decimal places",
             ),
             (
                 "mssql+pyodbc",
                 None,
                 None,
                 "mssql+pyodbc has FP inaccuracy even with "
                 "only four decimal places ",
             ),
             (
                 "mssql+pymssql",
                 None,
                 None,
                 "mssql+pymssql has FP inaccuracy even with "
                 "only four decimal places ",
             ),
             (
                 "postgresql+pg8000",
                 None,
                 None,
                 "postgresql+pg8000 has FP inaccuracy even with "
                 "only four decimal places ",
             ),
             (
                 "postgresql+psycopg2cffi",
                 None,
                 None,
                 "postgresql+psycopg2cffi has FP inaccuracy even with "
                 "only four decimal places ",
             ),
         ]
     )
Beispiel #25
0
 def json_array_indexes(self):
     return self.json_type + fails_if("+pg8000")
Beispiel #26
0
 def sane_multi_rowcount(self):
     return fails_if(
         lambda config: not config.db.dialect.supports_sane_multi_rowcount,
         "driver %(driver)s %(doesnt_support)s 'sane' multi row count")
 def two_phase_recovery(self):
     return self.two_phase_transactions + (
         exclusions.fails_if(lambda config: config.db.name == 'mysql' and
                             (config.db.dialect._is_mariadb or config.db.
                              dialect.server_version_info < (5, 7))))
Beispiel #28
0
    def empty_strings_varchar(self):
        """target database can persist/return an empty string with a varchar."""

        return fails_if(["oracle"],
                        'oracle converts empty strings to a blank space')
Beispiel #29
0
 def offset(self):
     """Target database must support some method of adding OFFSET or
     equivalent to a result set."""
     return fails_if(["sybase"], "no support for OFFSET or equivalent")
Beispiel #30
0
 def json_array_indexes(self):
     return self.json_type + fails_if("+pg8000")
Beispiel #31
0
 def precision_numerics_enotation_small(self):
     """target backend supports Decimal() objects using E notation
     to represent very small values."""
     return fails_if('mssql+pymssql', 'FIXME: improve pymssql dec handling')
Beispiel #32
0
    def empty_strings_text(self):
        """target database can persist/return an empty string with an
        unbounded text."""

        return fails_if(["oracle"],
                        "oracle converts empty strings to a blank space")
 def precision_numerics_many_significant_digits(self):
     """target backend supports values with many digits on both sides,
     such as 319438950232418390.273596, 87673.594069654243
     """
     return exclusions.fails_if(
         lambda: True, "Throws error SQL0604N, regarding Decimal(38, 12)")
Beispiel #34
0
    def intersect(self):
        """Target database must support INTERSECT or equivalent."""

        return fails_if(["firebird", "mysql", "sybase", "informix"],
                        'no support for INTERSECT')
Beispiel #35
0
 def except_(self):
     """Target database must support EXCEPT or equivalent (i.e. MINUS)."""
     return fails_if([
             "firebird", "mysql", "sybase",
         ], 'no support for EXCEPT')
Beispiel #36
0
 def except_(self):
     """Target database must support EXCEPT or equivalent (i.e. MINUS)."""
     return fails_if(["firebird", "mysql", "sybase", "informix"],
                     'no support for EXCEPT')
Beispiel #37
0
 def floats_to_four_decimals(self):
     return fails_if("mysql+oursql", "Floating point error")
Beispiel #38
0
 def precision_numerics_general(self):
     """target backend has general support for moderately high-precision
     numerics."""
     return fails_if('mssql+pymssql', 'FIXME: improve pymssql dec handling')
Beispiel #39
0
 def except_(self):
     """Target database must support EXCEPT or equivalent (i.e. MINUS)."""
     return fails_if(
         ["firebird", self._mysql_not_mariadb_103, "sybase"],
         "no support for EXCEPT",
     )
Beispiel #40
0
 def except_(self):
     """Target database must support EXCEPT or equivalent (i.e. MINUS)."""
     return fails_if(
         ["firebird", self._mysql_not_mariadb_103, "sybase"],
         "no support for EXCEPT",
     )
Beispiel #41
0
 def floats_to_four_decimals(self):
     return fails_if("mysql+oursql", "Floating point error")
Beispiel #42
0
 def sql_expression_limit_offset(self):
     return (fails_if(
         ["mysql", "mssql"],
         "Target backend can't accommodate full expressions in "
         "OFFSET or LIMIT",
     ) + self.offset)
Beispiel #43
0
    def intersect(self):
        """Target database must support INTERSECT or equivalent."""

        return fails_if([
                "firebird", "mysql", "sybase", "informix"
            ], 'no support for INTERSECT')
Beispiel #44
0
 def sane_multi_rowcount(self):
     return fails_if(
         lambda config: not config.db.dialect.supports_sane_multi_rowcount,
         "driver %(driver)s %(doesnt_support)s 'sane' multi row count"
     )
Beispiel #45
0
 def precision_numerics_general(self):
     """target backend has general support for moderately high-precision
     numerics."""
     return fails_if('mssql+pymssql', 'FIXME: improve pymssql dec handling')
 def sane_multi_rowcount(self):
     """Insert DocString Here."""
     return exclusions.fails_if(
         lambda config: not config.db.dialect.supports_sane_multi_rowcount,
         "driver %(driver)s %(doesnt_support)s 'sane' multi row count",
     )
Beispiel #47
0
 def precision_numerics_enotation_small(self):
     """target backend supports Decimal() objects using E notation
     to represent very small values."""
     return fails_if('mssql+pymssql', 'FIXME: improve pymssql dec handling')
Beispiel #48
0
 def offset(self):
     """Target database must support some method of adding OFFSET or
     equivalent to a result set."""
     return fails_if([
             "sybase"
         ], 'no support for OFFSET or equivalent')
Beispiel #49
0
    def non_native_boolean(self):
        """test will fail if native boolean is provided"""

        return exclusions.fails_if(
            exclusions.LambdaPredicate(
                lambda config: config.db.dialect.supports_native_boolean))
Beispiel #50
0
    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."""

        return fails_if('mysql', 'mysql FLOAT type only returns 4 decimals')
Beispiel #51
0
 def sql_expression_limit_offset(self):
     return (fails_if(
         ["mysql"],
         "MySQL can't accommodate full expressions in OFFSET or LIMIT",
     ) + self.offset)