def intersect(self):
        """Target database must support INTERSECT or equivalent."""

        return fails_if(
            ["firebird", self._mysql_not_mariadb_103, "sybase"],
            "no support for INTERSECT",
        )
    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 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 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 ... LIMIT ..) UNION (SELECT .. OFFSET ..)

        This is known to fail on SQLite.

        """
        return fails_if("sqlite")
    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")
 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"),
     ])
    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 ...) UNION (SELECT ..)

        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"])
    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"),
        ])
    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.",
            ),
        ])
Пример #10
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"),
        ])
Пример #11
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',
        )
Пример #12
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",
            ),
        ])
Пример #13
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 ",
         ),
     ])
Пример #14
0
 def sql_expression_limit_offset(self):
     return (fails_if(
         ["mysql"],
         "Target backend can't accommodate full expressions in "
         "OFFSET or LIMIT",
     ) + self.offset)
Пример #15
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",
     )
Пример #16
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")
Пример #17
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")
Пример #18
0
 def json_array_indexes(self):
     return self.json_type + fails_if("+pg8000")